RobWorkProject
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::common::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::common::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< Extension::DescriptorgetExtensionDescriptors () const
 get all extension descriptions of this extension point
 
std::vector< rw::common::Ptr< Extension > > getExtensions () const
 get all extensions of this extension point
 

Protected Member Functions

rw::common::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::common::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::common::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);
...

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: