#define EXECUTION_HANDLE_TYPE_NATIVE long namespace RTC { typedef EXECUTION_HANDLE_TYPE_NATIVE ExecutionContextHandle_t; typedef char * UniqueIdentifier; typedef SDOPackage::NVList NVList; enum ReturnCode_t { RTC_OK, RTC_ERROR, BAD_PARAMETER, UNSUPPORTED, OUT_OF_RESOURCES, PRECONDITION_NOT_MET }; enum LifeCycleState { CREATED_STATE, INACTIVE_STATE, ACTIVE_STATE, ERROR_STATE }; class ExecutionContext; class ExecutionContextList { public: ExecutionContextList (void); ExecutionContextList (RTC::UnsignedLong max); ExecutionContextList ( RTC::UnsignedLong max, RTC::UnsignedLong length, ExecutionContext** buffer, RTC::Boolean release = 0 ); ExecutionContextList (const ExecutionContextList &); ~ExecutionContextList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; ExecutionContext& operator[](RTC::UnsignedLong index); const ExecutionContext& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, ExecutionContext* data, Boolean release = FALSE ); ExecutionContext* get_buffer(RTC::Boolean orphan = FALSE); const ExecutionContext* get_buffer() const; }; class ComponentAction { public: virtual ReturnCode_t on_initialize ( ) = 0; virtual ReturnCode_t on_finalize ( ) = 0; virtual ReturnCode_t on_startup ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_shutdown ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_activated ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_deactivated ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_aborting ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_error ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_reset ( ExecutionContextHandle_t exec_context ) = 0; protected: ComponentAction (void); virtual ~ComponentAction (void); private: ComponentAction (const ComponentAction &); void operator= (const ComponentAction &); }; class LightweightRTObject : public virtual ComponentAction { public: virtual ReturnCode_t initialize ( ) = 0; virtual ReturnCode_t finalize ( ) = 0; virtual RTC::Boolean is_alive ( ExecutionContext* exec_context ) = 0; virtual ReturnCode_t exit ( ) = 0; virtual ExecutionContextHandle_t attach_context( ExecutionContext* exec_context ) = 0; virtual ReturnCode_t detach_context( ExecutionContextHandle_t exec_handle ) = 0; virtual ExecutionContext* get_context( ExecutionContextHandle_t exec_handle ) = 0; virtual ExecutionContextList* get_owned_contexts( ) = 0; virtual ExecutionContextList* get_participating_contexts( ) = 0; virtual ExecutionContextHandle_t get_context_handle( ExecutionContext cxt ) = 0; protected: LightweightRTObject (void); virtual ~LightweightRTObject (void); private: LightweightRTObject (const LightweightRTObject &); void operator= (const LightweightRTObject &); }; enum ExecutionKind { PERIODIC, EVENT_DRIVEN, OTHER }; class ExecutionContext { public: virtual RTC::Boolean is_running ( ) = 0; virtual ReturnCode_t start ( ) = 0; virtual ReturnCode_t stop ( ) = 0; virtual RTC::Double get_rate ( ) = 0; virtual ReturnCode_t set_rate ( RTC::Double rate ) = 0; virtual ReturnCode_t add_component( LightweightRTObject* comp ) = 0; virtual ReturnCode_t remove_component( LightweightRTObject* comp ) = 0; virtual ReturnCode_t activate_component ( LightweightRTObject* comp ) = 0; virtual ReturnCode_t deactivate_component ( LightweightRTObject* comp ) = 0; virtual ReturnCode_t reset_component( LightweightRTObject* comp ) = 0; virtual LifeCycleState get_component_state ( LightweightRTObject* comp ) = 0; virtual ExecutionKind get_kind ( ) = 0; protected: ExecutionContext (void); virtual ~ExecutionContext (void); private: ExecutionContext (const ExecutionContext &); void operator= (const ExecutionContext &); }; class DataFlowComponentAction { public: virtual ReturnCode_t on_execute ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_state_update ( ExecutionContextHandle_t exec_context ) = 0; virtual ReturnCode_t on_rate_changed ( ExecutionContextHandle_t* exec_context ) = 0; protected: DataFlowComponentAction (void); virtual ~DataFlowComponentAction (void); private: DataFlowComponentAction (const DataFlowComponentAction &); void operator= (const DataFlowComponentAction &); }; class DataFlowComponent : public virtual LightweightRTObject, public virtual DataFlowComponentAction { public: protected: DataFlowParticipant (void); virtual ~DataFlowParticipant (void); private: DataFlowParticipant (const DataFlowParticipant &); void operator= (const DataFlowParticipant &); }; class Fsm : public virtual LightweightRTObject { public: protected: Fsm (void); virtual ~Fsm (void); private: Fsm (const Fsm &); void operator= (const Fsm &); }; class FsmParticipantAction { public: virtual ReturnCode_t on_action ( ExecutionContextHandle_t exec_context ) = 0; protected: FsmComponentAction (void); virtual ~FsmComponentAction (void); private: FsmComponentAction (const FsmComponentAction &); void operator= (const FsmComponentAction &); }; class FsmParticipant : public virtual LightweightRTObject, public virtual FsmComponentAction { public: protected: FsmParticipant (void); virtual ~FsmParticipant (void); private: FsmParticipant (const FsmParticipant &); void operator= (const FsmParticipant &); }; class FsmObject { public: virtual ReturnCode_t send_stimulus( const char* message, ExecutionContextHandle_t exec_context ) = 0; protected: FsmObject (void); virtual ~FsmObject (void); private: FsmObject (const FsmObject &); void operator= (const FsmObject &); }; struct FsmBehaviorProfile { FsmParticipantAction* comp; UniqueIdentifier id; }; class FsmBehaviorProfileList { public: FsmBehaviorProfileListList (void); FsmBehaviorProfileListList (RTC::UnsignedLong max); FsmBehaviorProfileListList ( RTC::UnsignedLong max, RTC::UnsignedLong length, FsmBehaviorProfileList** buffer, RTC::Boolean release = 0 ); FsmBehaviorProfileList (const FsmBehaviorProfileList &); ~FsmBehaviorProfileList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; FsmBehaviorProfile& operator[](RTC::UnsignedLong index); const FsmBehaviorProfile& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, FsmBehaviorProfile* data, Boolean release = FALSE ); FsmBehaviorProfile* get_buffer(RTC::Boolean orphan = FALSE); const FsmBehaviorProfile* get_buffer() const; }; struct FsmProfile { FsmBehaviorProfileList behavior_profiles; }; class Mode { public: protected: Mode (void); virtual ~Mode (void); private: Mode (const Mode &); void operator= (const Mode &); }; class ModeCapable { public: virtual Mode* get_default_mode ( ) = 0; virtual Mode* get_current_mode ( ) = 0; virtual Mode* get_current_mode_in_context ( ExecutionContext* exec_context ) = 0; virtual Mode* get_pending_mode ( ) = 0; virtual Mode* get_pending_mode_in_context ( ExecutionContext* exec_context ) = 0; virtual ReturnCode_t set_mode ( Mode* new_mode, RTC::Boolean immediate ) = 0; protected: ModeCapable (void); virtual ~ModeCapable (void); private: ModeCapable (const ModeCapable &); void operator= (const ModeCapable &); }; class MultiModeComponentAction { public: virtual ReturnCode_t on_mode_changed ( ExecutionContextHandle_t exec_context ) = 0; protected: MultiModeComponentAction (void); virtual ~MultiModeComponentAction (void); private: MultiModeComponentAction (const MultiModeComponentAction &); void operator= (const MultiModeComponentAction &); }; class MultiModeObject : public virtual LightweightRTObject, public virtual ModeCapable, public virtual MultiModeComponentAction { public: protected: MultiModeObject (void); virtual ~MultiModeObject (void); private: MultiModeObject (const MultiModeObject &); void operator= (const MultiModeObject &); }; class RTObject; enum PortInterfacePolarity { PROVIDED, REQUIRED }; struct PortInterfaceProfile { char* instance_name; char* type_name; PortInterfacePolarity polarity; }; class PortInterfaceProfileList { public: PortInterfaceProfileList (void); PortInterfaceProfileList (RTC::UnsignedLong max); PortInterfaceProfileList ( RTC::UnsignedLong max, RTC::UnsignedLong length, PortInterfaceProfile* buffer, RTC::Boolean release = 0 ); PortInterfaceProfileList (const PortInterfaceProfileList &); ~PortInterfaceProfileList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; PortInterfaceProfile& operator[](RTC::UnsignedLong index); const PortInterfaceProfile& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, PortInterfaceProfile* data, Boolean release = FALSE ); PortInterfaceProfile* get_buffer(RTC::Boolean orphan = FALSE); const PortInterfaceProfile* get_buffer() const; }; class PortService; class PortServiceList { public: PortServiceList (void); PortServiceList (RTC::UnsignedLong max); PortServiceList ( RTC::UnsignedLong max, RTC::UnsignedLong length, PortService** buffer, RTC::Boolean release = 0 ); PortServiceList (const PortServiceList &); ~PortServiceList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; PortService& operator[](RTC::UnsignedLong index); const PortService& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, PortService* data, Boolean release = FALSE ); PortService* get_buffer(RTC::Boolean orphan = FALSE); const PortService* get_buffer() const; }; class RTCList { public: RTCList (void); RTCList (RTC::UnsignedLong max); RTCList ( RTC::UnsignedLong max, RTC::UnsignedLong length, RTObject** buffer, RTC::Boolean release = 0 ); RTCList (const RTCList &); ~RTCList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; RTObject& operator[](RTC::UnsignedLong index); const RTObject& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, RTObject* data, Boolean release = FALSE ); RTObject* get_buffer(RTC::Boolean orphan = FALSE); const RTObject* get_buffer() const; }; struct ConnectorProfile { char* name; UniqueIdentifier connector_id; RTC::PortServiceList ports; RTC::NVList properties; }; class ConnectorProfileList { public: ConnectorProfileList (void); ConnectorProfileList (RTC::UnsignedLong max); ConnectorProfileList ( RTC::UnsignedLong max, RTC::UnsignedLong length, ConnectorProfile* buffer, RTC::Boolean release = 0 ); ConnectorProfileList (const ConnectorProfileList &); ~ConnectorProfileList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; ConnectorProfile& operator[](RTC::UnsignedLong index); const ConnectorProfile& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, ConnectorProfile* data, Boolean release = FALSE ); ConnectorProfile* get_buffer(RTC::Boolean orphan = FALSE); const ConnectorProfile* get_buffer() const; }; struct PortProfile { char* name; PortInterfaceProfileList interfaces; PortService* port_ref; ConnectorProfileList connector_profiles; RTObject* owner; NVList properties; }; class PortProfileList { public: PortProfileList (void); PortProfileList (RTC::UnsignedLong max); PortProfileList ( RTC::UnsignedLong max, RTC::UnsignedLong length, PortProfile* buffer, RTC::Boolean release = 0 ); PortProfileList (const PortProfileList &); ~PortProfileList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; PortProfile& operator[](RTC::UnsignedLong index); const PortProfile& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, PortProfile* data, Boolean release = FALSE ); PortProfile* get_buffer(RTC::Boolean orphan = FALSE); const PortProfile* get_buffer() const; }; struct ExecutionContextProfile { ExecutionKind kind; RTC::Double rate; RTObject* owner; RTCList participants; NVList properties; }; class ExecutionContextProfileList { public: ExecutionContextProfileList (void); ExecutionContextProfileList (RTC::UnsignedLong max); ExecutionContextProfileList ( RTC::UnsignedLong max, RTC::UnsignedLong length, ExecutionContextProfile* buffer, RTC::Boolean release = 0 ); ExecutionContextProfileList (const ExecutionContextProfileList &); ~ExecutionContextProfileList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; ExecutionContextProfile& operator[](RTC::UnsignedLong index); const ExecutionContextProfile& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, ExecutionContextProfile* data, Boolean release = FALSE ); ExecutionContextProfile* get_buffer(RTC::Boolean orphan = FALSE); const ExecutionContextProfile* get_buffer() const; }; struct ComponentProfile { char* instance_name; char* type_name; char* description; char* version; char* vendor; char* category; PortProfileList port_profiles; RTObject* parent; NVList properties; }; class ComponentProfileList { public: ComponentProfileList (void); ComponentProfileList (RTC::UnsignedLong max); ComponentProfileList ( RTC::UnsignedLong max, RTC::UnsignedLong length, ComponentProfile* buffer, RTC::Boolean release = 0 ); ComponentProfileList (const ComponentProfileList &); ~ComponentProfileList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; ComponentProfile& operator[](RTC::UnsignedLong index); const ComponentProfile& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, ComponentProfile* data, Boolean release = FALSE ); ComponentProfile* get_buffer(RTC::Boolean orphan = FALSE); const ComponentProfile* get_buffer() const; }; class PortService : public virtual ::SDOPackage::SDOService { public: virtual PortProfile * get_port_profile ( ) = 0; virtual ConnectorProfileList * get_connector_profiles ( ) = 0; virtual ConnectorProfile * get_connector_profile ( const UniqueIdentifier connector_id ) = 0; virtual ReturnCode_t connect ( ConnectorProfile& connector_profile ) = 0; virtual ReturnCode_t disconnect ( const UniqueIdentifier connector_id ) = 0; virtual ReturnCode_t notify_connect( ConnectorProfile& connector_profile ) = 0; virtual ReturnCode_t notify_disconnect( const UniqueIdentifier connector_id ) = 0; virtual ReturnCode_t disconnect_all ( ) = 0; protected: PortService (void); virtual ~PortService (void); private: PortService (const PortService &); void operator= (const PortService &); }; class ExecutionContextService : public virtual ExecutionContext, public virtual ::SDOPackage::SDOService { public: virtual ExecutionContextProfile * get_profile ( ) = 0; protected: ExecutionContextService (void); virtual ~ExecutionContextService (void); private: ExecutionContextService (const ExecutionContextService &); void operator= (const ExecutionContextService &); }; class ExecutionContextServiceList { public: ExecutionContextServiceList (void); ExecutionContextServiceList (RTC::UnsignedLong max); ExecutionContextServiceList ( RTC::UnsignedLong max, RTC::UnsignedLong length, ExecutionContextService** buffer, RTC::Boolean release = 0 ); ExecutionContextServiceList (const ExecutionContextServiceList &); ~ExecutionContextServiceList (void); RTC::UnsignedLong maximum() const; void length(RTC::UnsignedLong); RTC::UnsignedLong length() const; ExecutionContextService& operator[](RTC::UnsignedLong index); const ExecutionContextService& operator[](RTC::UnsignedLong index) const; RTC::Boolean release() const; void replace( RTC::UnsignedLong max, RTC::UnsignedLong length, ExecutionContextService* data, Boolean release = FALSE ); ExecutionContextService* get_buffer(RTC::Boolean orphan = FALSE); const ExecutionContextService* get_buffer() const; }; class RTObject : public virtual LightweightRTObject, public virtual ::SDOPackage::SDO { public: virtual ComponentProfile * get_component_profile ( ) = 0; virtual PortServiceList * get_ports ( ) = 0; protected: RTObject (void); virtual ~RTObject (void); private: RTObject (const RTObject &); void operator= (const RTObject &); }; class FsmService : public virtual SDOPackage::SDOService { public: virtual FsmProfile* get_fsm_profile( ) = 0; virtual ReturnCode_t set_fsm_profile( const FsmProfile& fsm_profile ) = 0; protected: FsmService (void); virtual ~FsmService (void); private: FsmService (const FsmService &); void operator= (const FsmService &); }; };