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

#include <AbstractCIDModule.h>

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

Public Member Functions

virtual ~AbstractCIDModule ()
 
virtual float getFrequency () const
 
uint32_t getIdentifier () const
 
const string getMultiCastGroup () const
 
uint32_t getCID () const
 
bool isProfiling () const
 
bool isRealtime () const
 
uint32_t getRealtimePriority () const
 
virtual void waitForNextFullSecond (const uint32_t &secondsIncrement)
 
void setBreakpoint (Breakpoint *bp)
 
virtual
odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode 
runModule ()=0
 
void setModuleState (const odcore::data::dmcp::ModuleStateMessage::ModuleState &s)
 
odcore::data::dmcp::ModuleStateMessage::ModuleState getModuleState ()
 
odcore::data::dmcp::ModuleStateMessage::ModuleState getModuleStateAndWaitForRemainingTimeInTimeslice ()
 

Static Public Member Functions

static bool isVerbose ()
 
static int32_t getVerbosity ()
 
static vector< AbstractModule * > & getListOfModules ()
 

Protected Member Functions

 AbstractCIDModule (const int32_t &argc, char **argv) throw (exceptions::InvalidArgumentException)
 
virtual void wait ()
 

Detailed Description

This class is the abstract base for every module consisting to one specific CID. 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::AbstractCIDModule::AbstractCIDModule ( const int32_t &  argc,
char **  argv 
)
throw (exceptions::InvalidArgumentException
)
protected

Constructor for any module.

Parameters
argcNumber of command line arguments.
argvCommand line arguments.
Exceptions
InvalidArgumentExceptionif the signal handler could not be registered or if –id was found but the identifier contains white spaces.
odcore::base::module::AbstractCIDModule::~AbstractCIDModule ( )
virtual

Member Function Documentation

uint32_t odcore::base::module::AbstractCIDModule::getCID ( ) const

This method returns the CID.

Returns
CID.
float odcore::base::module::AbstractCIDModule::getFrequency ( ) const
virtual

This method returns the runtime frequency.

Returns
Runtime frequency.

Implements odcore::base::module::Periodic.

uint32_t odcore::base::module::AbstractCIDModule::getIdentifier ( ) const

This method returns this module's identifier as specified in the command line.

Returns
This module's identifier.
vector< AbstractModule * > & odcore::base::module::AbstractModule::getListOfModules ( )
staticinherited

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 odcore::base::module::AbstractModule::~AbstractModule().

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

This method returns the module MODULE_STATE.

Returns
Module MODULE_STATE.

Referenced by odcore::base::module::AbstractModule::getModuleStateAndWaitForRemainingTimeInTimeslice().

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

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 odcore::base::module::AbstractModule::calledGetModuleState(), and odcore::base::module::AbstractModule::getModuleState().

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

const string odcore::base::module::AbstractCIDModule::getMultiCastGroup ( ) const

This method returns the module's multicast group as specified in the command line

uint32_t odcore::base::module::AbstractCIDModule::getRealtimePriority ( ) const

This method returns the priority, if –realtime is enabled.

Returns
Scheduling priority.
int32_t odcore::base::module::AbstractCIDModule::getVerbosity ( )
static

This method returns the level of verbosity.

Returns
Level of verbosity.
bool odcore::base::module::AbstractCIDModule::isProfiling ( ) const
inline

This method returns true, if –profiling is enabled.

Returns
true if profiling is enabled.
bool odcore::base::module::AbstractCIDModule::isRealtime ( ) const
inline

This method returns true, if –realtime is enabled.

Returns
true if realtime is enabled.
bool odcore::base::module::AbstractCIDModule::isVerbose ( )
static

This method returns true, if –verbose is enabled.

Returns
true if verbose.
virtual odcore::data::dmcp::ModuleExitCodeMessage::ModuleExitCode odcore::base::module::InterruptibleModule::runModule ( )
pure virtualinherited

This method executes the application body.

Implemented in odcore::base::module::MasterModule, and odcore::base::module::ClientModule.

void odcore::base::module::InterruptibleModule::setBreakpoint ( Breakpoint bp)
inherited
void odcore::base::module::AbstractModule::setModuleState ( const odcore::data::dmcp::ModuleStateMessage::ModuleState &  s)
inherited

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 ( )
protectedvirtualinherited

This method is called to enforce a specific frequency.

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

Referenced by odcore::base::module::AbstractModule::calledGetModuleState().

void odcore::base::module::AbstractCIDModule::waitForNextFullSecond ( const uint32_t &  secondsIncrement)
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?

Implements odcore::base::module::AbstractModule.

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