Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Factory.h File Reference

#include <iostream>
#include <map>
#include <string>
#include <vector>
#include "PhysicsNtuple/Handle.h"

Go to the source code of this file.

Namespaces

namespace  Anp

Classes

class  Anp::Factory< T >

Defines

#define REGISTER_ANP_OBJECT(BASE, CLASS)
#define REGISTER_ANY_OBJECT(PREF, BASE, CLASS)


Define Documentation

#define REGISTER_ANP_OBJECT BASE,
CLASS   ) 
 

Value:

namespace                                                               \
   {                                                                    \
      Anp::Handle<Anp::BASE> Create##BASE()                             \
      {                                                                 \
         return Anp::Handle<Anp::BASE>(new Anp::CLASS);                 \
      }                                                                 \
      bool Registered##BASE = Anp::Factory<Anp::BASE>::Instance().      \
         Register(#CLASS, Create##BASE);                                \
   }
REGISTER_ANP_OBJECT(BaseClass,MyClass)

expands to this code:

namespace { Anp::Handle<Anp::BaseClass> CreateBaseClass() { return Anp::Handle<Anp::BaseClass>(new Anp::MyClass); } bool RegisteredBaseClass = Anp::Factory<Anp::BaseClass>::Instance(). Register("MyClass", CreateBaseClass); }

Definition at line 105 of file Factory.h.

#define REGISTER_ANY_OBJECT PREF,
BASE,
CLASS   ) 
 

Value:

namespace                                                               \
   {                                                                    \
      Anp::Handle<PREF::BASE> Create##PREF##BASE()                      \
      {                                                                 \
         return Anp::Handle<PREF::BASE>(new PREF::CLASS);               \
      }                                                                 \
      bool Registered##BASE = Anp::Factory<PREF::BASE>::Instance().     \
         Register(#CLASS, Create##PREF##BASE);                          \
   }

Definition at line 116 of file Factory.h.


Generated on Mon Feb 15 11:07:57 2010 for loon by  doxygen 1.3.9.1