roviz  0.7
Code Documentation of roviz
Public Member Functions | List of all members
ConfigImpl Class Referenceabstract

Base class for all config implementations. More...

#include <config_impl.h>

Inheritance diagram for ConfigImpl:
Inheritance graph
Collaboration diagram for ConfigImpl:
Collaboration graph

Public Member Functions

virtual void * value (void)=0
 Get the value of the config. More...
 
virtual void lock (void)=0
 Lock the mutex of the config. More...
 
virtual void unlock (void)=0
 Unlock the mutex of the config. More...
 
virtual bool changed (void)=0
 Check if the config value changed. More...
 

Detailed Description

Base class for all config implementations.

See also
Config

Member Function Documentation

◆ changed()

virtual bool ConfigImpl::changed ( void  )
pure virtual

Check if the config value changed.

Returns
True if the config value changed, false otherwise

Implemented in ConfigImplDev< T >, and ConfigImplCmdline< T >.

◆ lock()

virtual void ConfigImpl::lock ( void  )
pure virtual

Lock the mutex of the config.

See also
unlock

Implemented in ConfigImplDev< T >, and ConfigImplCmdline< T >.

◆ unlock()

virtual void ConfigImpl::unlock ( void  )
pure virtual

Unlock the mutex of the config.

See also
lock

Implemented in ConfigImplDev< T >, and ConfigImplCmdline< T >.

◆ value()

virtual void* ConfigImpl::value ( void  )
pure virtual

Get the value of the config.

Returns
A pointer to the value

This function uses a type-erasure technique to work around the fact that virtual templates are not allowed. We only know the true type of the value if we know the template type, but this function cannot be a template because it has to be overridden by the actual implementation. Because of that, we return a void* to the value, assuming that the Config class, which is a template and knows the type of the value, will cast this pointer correctly and returns a properly typed value.

See also
Config::value

Implemented in ConfigImplDev< T >, and ConfigImplCmdline< T >.


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