Update of /cvsroot/pclasses/pclasses2/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15745/test
Modified Files:
CType.cpp FactoryTest.cpp FactoryTest.h
Log Message:
Added some non-default ctors to TheBase, to test out ideas for Factorying with non-default ctors.
Index: FactoryTest.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- FactoryTest.cpp 26 Dec 2004 09:30:37 -0000 1.9
+++ FactoryTest.cpp 31 Dec 2004 15:11:49 -0000 1.10
@@ -12,7 +12,6 @@
#include <pclasses/Plugin/Plugin.h>
-
int main( int argc, char ** argv )
{
CERR << "Factory tests...\n";
@@ -20,6 +19,7 @@
TheBase * a = 0;
+
typedef P::NamedTypeFactory<TheBase> NTF;
typedef P::Plugin::PluginManager<TheBase> PM;
Index: FactoryTest.h
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/test/FactoryTest.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- FactoryTest.h 30 Dec 2004 23:09:45 -0000 1.7
+++ FactoryTest.h 31 Dec 2004 15:11:49 -0000 1.8
@@ -18,7 +18,11 @@
struct TheBase
{
-
+ TheBase() {}
+ explicit TheBase( int i )
+ {
+ CERR << "TheBase("<<i<<")\n";
+ }
virtual ~TheBase() {}
virtual std::string classname() const = 0;
@@ -63,6 +67,10 @@
struct AType : public TheBase
{
+ explicit AType( int i ) : TheBase(i)
+ {
+ CERR << "AType("<<i<<")\n";
+ }
AType()
{
CERR << "AType()\n";
@@ -79,6 +87,11 @@
struct BType : public AType
{
+ explicit BType( int i ) : AType(i)
+ {
+ CERR << "BType("<<i<<")\n";
+ }
+
BType()
{
CERR << "BType()\n";
Index: CType.cpp
===================================================================
RCS file: /cvsroot/pclasses/pclasses2/test/CType.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CType.cpp 26 Dec 2004 06:00:55 -0000 1.3
+++ CType.cpp 31 Dec 2004 15:11:49 -0000 1.4
@@ -4,6 +4,11 @@
struct CType : public BType
{
+ explicit CType( int i ) : BType(i)
+ {
+ CERR << "CType("<<i<<")\n";
+ }
+
CType()
{
CERR << "CType()\n";
|