OpenDaVINCI  4.16.0
odcore::base::module::AbstractModule Class Referenceabstract

#include <AbstractModule.h>

Inheritance diagram for odcore::base::module::AbstractModule:
Inheritance graph

Public Member Functions

virtual ~AbstractModule ()
 
void setModuleState (const odcore::data::dmcp::ModuleStateMessage::ModuleState &s)
 
odcore::data::dmcp::ModuleStateMessage::ModuleState getModuleState ()
 
odcore::data::dmcp::ModuleStateMessage::ModuleState getModuleStateAndWaitForRemainingTimeInTimeslice ()
 
virtual void waitForNextFullSecond (const uint32_t &secondsIncrement)=0
 

Static Public Member Functions

static vector< AbstractModule * > & getListOfModules ()
 

Protected Member Functions

 AbstractModule ()
 
virtual void wait ()
 
virtual void calledGetModuleState ()
 

Detailed Description

This class is the abstract base for every module. For concrete classes, use either ClientModule or MasterModule. ClientModules use DMCP client requests for getting configuration data. MasterModules however must provide DMCP services.

Constructor & Destructor Documentation

odcore::base::module::AbstractModule::AbstractModule ( )
protected
odcore::base::module::AbstractModule::~AbstractModule ( )
virtual

References getListOfModules().

Member Function Documentation

void odcore::base::module::AbstractModule::calledGetModuleState ( )
protectedvirtual

This method can be used indicate to subclasses that getModuleStateAndWaitForRemainingTimeInTimeslice() was called. This is used by InterruptibleModule with private inheritance to not permit overriding getModuleStateAndWaitForRemainingTimeInTimeslice() in subclasses from InterruptibleModule.

References wait().

Referenced by getModuleStateAndWaitForRemainingTimeInTimeslice().

vector< AbstractModule * > & odcore::base::module::AbstractModule::getListOfModules ( )
static

This method returns the list of created modules for this class. This method can be used to broadcast signals to all instances.

Referenced by odcore::base::module::finalize(), odcore::base::module::signalHandler(), and ~AbstractModule().

odcore::data::dmcp::ModuleStateMessage::ModuleState odcore::base::module::AbstractModule::getModuleState ( )

This method returns the module MODULE_STATE.

Returns
Module MODULE_STATE.

Referenced by getModuleStateAndWaitForRemainingTimeInTimeslice().

odcore::data::dmcp::ModuleStateMessage::ModuleState odcore::base::module::AbstractModule::getModuleStateAndWaitForRemainingTimeInTimeslice ( )

This method returns the module MODULE_STATE and suspends the execution of the calling thread for the rest of the current time slice.

Returns
Module MODULE_STATE.

References calledGetModuleState(), and getModuleState().

Referenced by odcontext::base::RuntimeControl::run().

void odcore::base::module::AbstractModule::setModuleState ( const odcore::data::dmcp::ModuleStateMessage::ModuleState &  s)

This method sets the module MODULE_STATE.

Parameters
sMODULE_STATE of the module.

Referenced by odcontext::base::TimeTriggeredConferenceClientModuleRunner::beforeStop(), odcontext::base::RuntimeControl::run(), and odcore::base::module::signalHandler().

void odcore::base::module::AbstractModule::wait ( )
protectedvirtual

This method is called to enforce a specific frequency.

References odcore::base::Thread::usleepFor().

Referenced by calledGetModuleState().

virtual void odcore::base::module::AbstractModule::waitForNextFullSecond ( const uint32_t &  secondsIncrement)
pure virtual

This method suspends the execution of this thread to the next full second.

Parameters
secondsIncrementFrom the current point in time, for how many full seconds shall we wait?

Implemented in odcore::base::module::AbstractCIDModule.