OpenDaVINCI  4.15.3
odcontext::base::RuntimeControl Class Reference

#include <RuntimeControl.h>

Inheritance diagram for odcontext::base::RuntimeControl:
Inheritance graph

Classes

class  DisableTimeFactory
 

Public Types

enum  RUNTIMECONTROL { UNSPECIFIED, DONT_TAKE_CONTROL, TAKE_CONTROL }
 
enum  ERRORCODES {
  NO_ERROR_OCCURRED, APPLICATIONS_FINISHED, RUNTIME_TIMEOUT, RUNTIMECONTROL_FORCED_TO_QUIT,
  SETUP_NOT_CALLED, EXCEPTION_CAUGHT, STRING_EXCEPTION_CAUGHT, UNKNOWN_EXCEPTION_CAUGHT
}
 

Public Member Functions

 RuntimeControl (const RuntimeControlInterface &sci)
 
virtual ~RuntimeControl ()
 
void setup (const enum RUNTIMECONTROL &takeControl)
 
enum ERRORCODES run ()
 
enum ERRORCODES run (RuntimeEnvironment &rte, const uint32_t &maxRunningTimeInSeconds)
 
void tearDown ()
 
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 vector< AbstractModule * > & getListOfModules ()
 

Protected Member Functions

virtual enum ERRORCODES runStandalone ()
 
void setupSystemContextComponents (RuntimeEnvironment &rte)
 
void tearDownSystemContextComponents (RuntimeEnvironment &rte)
 
virtual void wait ()
 
virtual void calledGetModuleState ()
 

Detailed Description

This class controls the system's context.

Member Enumeration Documentation

Enumerator
NO_ERROR_OCCURRED 
APPLICATIONS_FINISHED 
RUNTIME_TIMEOUT 
RUNTIMECONTROL_FORCED_TO_QUIT 
SETUP_NOT_CALLED 
EXCEPTION_CAUGHT 
STRING_EXCEPTION_CAUGHT 
UNKNOWN_EXCEPTION_CAUGHT 
Enumerator
UNSPECIFIED 
DONT_TAKE_CONTROL 
TAKE_CONTROL 

Constructor & Destructor Documentation

odcontext::base::RuntimeControl::RuntimeControl ( const RuntimeControlInterface sci)

Contructor.

Parameters
sciRuntimeControlInterface to be used.
odcontext::base::RuntimeControl::~RuntimeControl ( )
virtual

Member Function Documentation

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

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

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

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 run().

enum RuntimeControl::ERRORCODES odcontext::base::RuntimeControl::run ( )

This method actually runs the system's context.

Returns
Any errorcode.

References runStandalone().

enum RuntimeControl::ERRORCODES odcontext::base::RuntimeControl::runStandalone ( )
protectedvirtual

This method actually runs the system's context for standalone system simulations. It is overridden in StandaloneRuntimeControl. In this class this method actually does nothing.

Returns
Any errorcode.

References NO_ERROR_OCCURRED.

Referenced by run().

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(), run(), and odcore::base::module::signalHandler().

void odcontext::base::RuntimeControl::setup ( const enum RUNTIMECONTROL takeControl)

This method must be called to setup the system context.

Parameters
takeControlany of the enum, if the RuntimeControl should take control for ContainerConference and TimeFactory for example.

References odcontext::base::RuntimeControlInterface::getCID(), odcontext::base::RuntimeControlInterface::getConfiguration(), odcontext::base::RuntimeControlInterface::getMulticastGroup(), odcontext::base::RuntimeControlInterface::isSupercomponent(), TAKE_CONTROL, and UNSPECIFIED.

void odcontext::base::RuntimeControl::setupSystemContextComponents ( RuntimeEnvironment rte)
protected

This method calls the setup-method of all SystemContextComponents registered at the given RuntimeEnvironment.

Parameters
rteRuntimeEnvironment.

References odcontext::base::RuntimeEnvironment::getListOfSystemFeedbackComponents(), and odcontext::base::SystemContextComponent::setup().

void odcontext::base::RuntimeControl::tearDown ( )

This method must be called to tear down the system's context.

Referenced by ~RuntimeControl().

void odcontext::base::RuntimeControl::tearDownSystemContextComponents ( RuntimeEnvironment rte)
protected
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().