typetable.cc
Go to the documentation of this file.
1 #include "stage.hh"
2 using namespace Stg;
3 
4 
5 /* Create named wrappers for model constructors */
6 template <class T>
7 Model* Creator( World* world, Model* parent, const std::string& type )
8 {
9  return new T( world, parent, type );
10 }
11 
12 static void Register( const std::string& type,
13  creator_t func )
14 {
15  Model::name_map[type] = func;
16 }
17 
20 {
21  // generic model
22  Register( "model", Creator<Model> );
23 
24  Register( "actuator", Creator<ModelActuator> );
25  Register( "blinkenlight", Creator<ModelBlinkenlight> );
26  Register( "blobfinder", Creator<ModelBlobfinder> );
27  Register( "camera", Creator<ModelCamera> );
28  Register( "fiducial", Creator<ModelFiducial> );
29  Register( "gripper", Creator<ModelGripper> );
30  Register( "lightindicator", Creator<ModelLightIndicator> );
31  Register( "position", Creator<ModelPosition> );
32  Register( "ranger", Creator<ModelRanger> );
33 }
34 
Model class
Definition: stage.hh:1742
World class
Definition: stage.hh:814
The Stage library uses its own namespace.
Definition: canvas.hh:8
Model * Creator(World *world, Model *parent, const std::string &type)
Definition: typetable.cc:7
void RegisterModels()
Definition: typetable.cc:19
Model *(* creator_t)(World *, Model *, const std::string &type)
Definition: stage.hh:87
static void Register(const std::string &type, creator_t func)
Definition: typetable.cc:12
static std::map< std::string, creator_t > name_map
Definition: stage.hh:2466


stage
Author(s): Richard Vaughan , Brian Gerkey , Reed Hedges , Andrew Howard , Toby Collett , Pooya Karimian , Jeremy Asher , Alex Couture-Beil , Geoff Biggs , Rich Mattes , Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:10