testLibObjectRegistrar.h
Go to the documentation of this file.
1 
9 #ifndef _STL_testLibObjectRegistrar_h_
10 #define _STL_testLibObjectRegistrar_h_
11 
12 
13 #include <utl/ObjectFactory.h>
14 #include <utl/ObjectRegistrar.h>
15 
16 namespace tst {
18  {
19  public:
20  virtual ~ExternalObjectBase() {}
21  virtual int GetId() = 0;
22  };
23 
25 
26  template<int id>
28  : public ExternalObjectBase
29  {
30  public:
31  int GetId() { return GetRegistrationId(); }
32 
34  GetRegistrationId() { return id; }
35 
37  { return new ExternalObject; }
38  private:
40  };
41 } // tst
42 
43 
44 #endif // _STL_testLibObjectRegistrar_h_
45 
46 // Configure (x)emacs for this file ...
47 // Local Variables:
48 // mode:c++
49 // compile-command: "make -C .. -k testSTL && ../testSTL"
50 // End:
utl::ObjectRegistrar< ExternalObject< id >, ExternalObjectFactory > fAutoReg
IdentType IdentifierType
Definition: ObjectFactory.h:78
static ExternalObjectBase * Create()
static ExternalObjectFactory::IdentifierType GetRegistrationId()
Class for the automatic registration of an object.
Template for object factory.
Definition: ObjectFactory.h:71
utl::ObjectFactory< ExternalObjectBase *, int > ExternalObjectFactory
virtual int GetId()=0

, generated on Tue Sep 26 2023.