Ignition Gazebo

API Reference

5.1.0
Factory.hh File Reference
#include <cstdint>
#include <cstring>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <ignition/common/SingletonT.hh>
#include <ignition/common/Util.hh>
#include <ignition/gazebo/components/Component.hh>
#include <ignition/gazebo/detail/ComponentStorageBase.hh>
#include <ignition/gazebo/config.hh>
#include <ignition/gazebo/Export.hh>
#include <ignition/gazebo/Types.hh>

Go to the source code of this file.

Classes

class  ComponentDescriptor< ComponentTypeT >
 A class for an object responsible for creating components. More...
 
class  ComponentDescriptorBase
 A base class for an object responsible for creating components. More...
 
class  Factory
 A factory that generates a component based on a string type. More...
 
class  StorageDescriptor< ComponentTypeT >
 A class for an object responsible for creating storages. More...
 
class  StorageDescriptorBase
 A base class for an object responsible for creating storages. More...
 

Namespaces

 ignition
 This library is part of the Ignition Robotics project.
 
 ignition::gazebo
 Gazebo is a leading open source robotics simulator, that provides high fidelity physics, rendering, and sensor simulation.
 
 ignition::gazebo::components
 Components represent data, such as position information. An Entity usually has one or more associated components.
 

Macros

#define IGN_GAZEBO_REGISTER_COMPONENT(_compType, _classname)
 Static component registration macro. More...
 

Macro Definition Documentation

◆ IGN_GAZEBO_REGISTER_COMPONENT

#define IGN_GAZEBO_REGISTER_COMPONENT (   _compType,
  _classname 
)
Value:
class IgnGazeboComponents##_classname \
{ \
public: IgnGazeboComponents##_classname() \
{ \
if (_classname::typeId != 0) \
return; \
using namespace ignition;\
using Desc = gazebo::components::ComponentDescriptor<_classname>; \
using StorageDesc = gazebo::components::StorageDescriptor<_classname>; \
gazebo::components::Factory::Instance()->Register<_classname>(\
_compType, new Desc(), new StorageDesc());\
} \
}; \
static IgnGazeboComponents##_classname\
IgnitionGazeboComponentsInitializer##_classname;
This library is part of the Ignition Robotics project.

Static component registration macro.

Use this macro to register components.

Each time a plugin which uses a component is loaded, it tries to register the component again, so we prevent that.

Parameters
[in]_compTypeComponent type name.
[in]_classnameClass name for component.