RobWorkProject  23.9.11-
Public Types | Public Member Functions | Protected Member Functions | List of all members
ExtensionPoint< ExtensionInterface > Class Template Reference

an extension point is a class that defines a point where Extension can be added. This is typically used together with plugins, however any class may register extensions to an extension point. More...

#include <ExtensionPoint.hpp>

Public Types

typedef rw::core::Ptr< ExtensionPointPtr
 smart pointer type of ExtensionPoint
 

Public Member Functions

 ExtensionPoint (const std::string &id, const std::string &name, Plugin *plugin=NULL)
 Constructor. More...
 
const std::string & getId () const
 get unique identifier of this extensionpoint
 
const std::string & getName () const
 get human readable name of this extension point
 
const rw::core::PropertyMapgetSchema () const
 the schema describe the possible properties/configurations elements which is used in the PropertyMap. It contain examples of all possible configuration options. This can be used to configure any extensions that needs to attach to this extension point.
 
std::vector< rw::core::Extension::DescriptorgetExtensionDescriptors () const
 get all extension descriptions of this extension point
 
std::vector< rw::core::Ptr< Extension > > getExtensions () const
 get all extensions of this extension point
 

Protected Member Functions

rw::core::PropertyMapgetSchema ()
 the schema describe the possible properties/configurations elements which is used in the PropertyMap. The schema property map should just be loaded with all possible configuration options which the extension might use. More...
 

Detailed Description

template<class ExtensionInterface>
class rw::core::ExtensionPoint< ExtensionInterface >

an extension point is a class that defines a point where Extension can be added. This is typically used together with plugins, however any class may register extensions to an extension point.

Constructor & Destructor Documentation

◆ ExtensionPoint()

ExtensionPoint ( const std::string &  id,
const std::string &  name,
Plugin plugin = NULL 
)
inline

Constructor.

Parameters
id[in] unique identifier of this extension point
name[in] human readable name of this extension point
plugin[in] the plugin from which this extension point is defined, NULL if not defined from plugin

Member Function Documentation

◆ getSchema()

rw::core::PropertyMap& getSchema ( )
inlineprotected

the schema describe the possible properties/configurations elements which is used in the PropertyMap. The schema property map should just be loaded with all possible configuration options which the extension might use.

subclassing the ExtensionPoint class enables you to add extra configuration options. This might be done as simply as this:

getSchema().add("SupportedFormats", "Comma seperated String of supported formats",
std::string("GIF,PNG,JPEG")); getSchema().add("ShowLights", "Should lights be on as
default?", true);
...
const rw::core::PropertyMap & getSchema() const
the schema describe the possible properties/configurations elements which is used in the PropertyMap....
Definition: core/ExtensionPoint.hpp:60
rw::core::Ptr< rw::core::Property< T > > add(const std::string &identifier, const std::string &description, const T &value)
Add a property to the map. If a property with the same identifier already exists then nothing is adde...
Definition: core/PropertyMap.hpp:140

which will enable the loading of these options from the plugin xml file descriptor

<plugin ... >
...
<extension>
...
<SupportedFormats>GIF,PNG,JPEG</SupportedFormats>
<ShowLights>false</ShowLights>
</extension>
</plugin>
Returns

The documentation for this class was generated from the following file: