SST/macro
Classes | Namespaces | Macros
factory.h File Reference
#include <cstdio>
#include <iostream>
#include <sprockit/errors.h>
#include <sprockit/statics.h>
#include <sprockit/sim_parameters.h>
#include <sprockit/basic_string_tokenizer.h>
#include <sprockit/spkt_config.h>
#include <map>
Include dependency graph for factory.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sprockit::factory_type
 
class  sprockit::SpktBuilder< T, Args >
 
class  sprockit::SpktBuilderImpl< Child, Factory >
 
class  sprockit::Factory< T, Args >
 
class  sprockit::SpktBuilderImpl< Child, Factory< Parent, Args... > >
 
class  sprockit::factory< T >
 
class  sprockit::template_factory< T, Factory >
 
class  sprockit::factory2< T >
 
class  sprockit::template_factory2< T, Factory >
 
class  sprockit::CleanupFactory< Factory >
 

Namespaces

 sprockit
 

Macros

#define FirstArgStr(X, ...)   #X
 
#define FirstArgFactoryName(X, ...)   X##_factory
 
#define DeclareFactory(...)   typedef ::sprockit::Factory<__VA_ARGS__> FirstArgFactoryName(__VA_ARGS__);
 
#define ImplementFactory(type_name)
 
#define SpktTemplateRegister(cls_str, parent_cls, child_cls, unique_name, ...)   static ::sprockit::SpktBuilderImpl<child_cls, parent_cls##_factory> unique_name##_cd(cls_str)
 
#define SpktRegister(cls_str, parent_cls, child_cls, ...)   static ::sprockit::SpktBuilderImpl<child_cls,parent_cls##_factory> child_cls##_cd(cls_str)
 
#define DeclareFactory1InitParam(type_name, param1_name)   DeclareFactory(type_name, param1_name);
 
#define DeclareFactory2InitParams(type_name, param1_name, param2_name)   DeclareFactory(type_name, param1_name, param2_name);
 
#define DeclareFactory3InitParams(type_name, param1_name, param2_name, param3_name)   DeclareFactory(type_name, param1_name, param2_name, param3_name);
 

Macro Definition Documentation

#define DeclareFactory (   ...)    typedef ::sprockit::Factory<__VA_ARGS__> FirstArgFactoryName(__VA_ARGS__);

Definition at line 297 of file factory.h.

Referenced by DeclareDebugSlot().

#define DeclareFactory1InitParam (   type_name,
  param1_name 
)    DeclareFactory(type_name, param1_name);

Definition at line 315 of file factory.h.

Referenced by DeclareDebugSlot().

#define DeclareFactory2InitParams (   type_name,
  param1_name,
  param2_name 
)    DeclareFactory(type_name, param1_name, param2_name);

Definition at line 318 of file factory.h.

#define DeclareFactory3InitParams (   type_name,
  param1_name,
  param2_name,
  param3_name 
)    DeclareFactory(type_name, param1_name, param2_name, param3_name);

Definition at line 321 of file factory.h.

#define FirstArgFactoryName (   X,
  ... 
)    X##_factory

Definition at line 295 of file factory.h.

#define FirstArgStr (   X,
  ... 
)    #X

Definition at line 294 of file factory.h.

#define ImplementFactory (   type_name)
Value:
template<> const char* type_name##_factory::name_ = #type_name; \
template<> std::map<std::string, type_name##_factory::builder_t*>* type_name##_factory::builder_map_ = 0; \
template<> std::map<std::string, std::list<std::string>>* type_name##_factory::alias_map_ = 0; \
namespace { static sprockit::CleanupFactory<type_name##_factory> cleaner; }

Definition at line 300 of file factory.h.

#define SpktRegister (   cls_str,
  parent_cls,
  child_cls,
  ... 
)    static ::sprockit::SpktBuilderImpl<child_cls,parent_cls##_factory> child_cls##_cd(cls_str)

Definition at line 311 of file factory.h.

#define SpktTemplateRegister (   cls_str,
  parent_cls,
  child_cls,
  unique_name,
  ... 
)    static ::sprockit::SpktBuilderImpl<child_cls, parent_cls##_factory> unique_name##_cd(cls_str)

Definition at line 308 of file factory.h.