OpenRTM
1.0.0
|
00001 // RTC.idl 00002 00003 #ifndef RTC_IDL 00004 #define RTC_IDL 00005 00006 #include "SDOPackage.idl" 00007 00008 #pragma prefix "omg.org" 00009 00010 #define EXECUTION_HANDLE_TYPE_NATIVE long 00011 00012 module RTC 00013 { 00031 typedef EXECUTION_HANDLE_TYPE_NATIVE ExecutionContextHandle_t; 00032 00033 typedef SDOPackage::UniqueIdentifier UniqueIdentifier; 00034 typedef SDOPackage::NVList NVList; 00035 00082 enum ReturnCode_t 00083 { 00084 RTC_OK, 00085 RTC_ERROR, 00086 BAD_PARAMETER, 00087 UNSUPPORTED, 00088 OUT_OF_RESOURCES, 00089 PRECONDITION_NOT_MET 00090 }; 00091 00103 enum LifeCycleState 00104 { 00116 CREATED_STATE, 00117 00138 INACTIVE_STATE, 00139 00159 ACTIVE_STATE, 00160 00175 ERROR_STATE 00176 }; 00177 00178 interface ExecutionContext; 00179 typedef sequence<ExecutionContext> ExecutionContextList; 00180 00204 interface ComponentAction 00205 { 00222 ReturnCode_t on_initialize(); 00223 00240 ReturnCode_t on_finalize(); 00241 00255 ReturnCode_t on_startup(in ExecutionContextHandle_t exec_handle); 00256 00270 ReturnCode_t on_shutdown(in ExecutionContextHandle_t exec_handle); 00271 00284 ReturnCode_t on_activated(in ExecutionContextHandle_t exec_handle); 00285 00298 ReturnCode_t on_deactivated(in ExecutionContextHandle_t exec_handle); 00299 00319 ReturnCode_t on_aborting(in ExecutionContextHandle_t exec_handle); 00320 00348 ReturnCode_t on_error(in ExecutionContextHandle_t exec_handle); 00349 00370 ReturnCode_t on_reset(in ExecutionContextHandle_t exec_handle); 00371 }; 00372 00443 interface LightweightRTObject 00444 : ComponentAction 00445 { 00469 ReturnCode_t initialize(); 00470 00504 ReturnCode_t finalize(); 00505 00527 boolean is_alive(in ExecutionContext exec_context); 00528 00559 ReturnCode_t exit(); 00560 00581 ExecutionContextHandle_t attach_context(in ExecutionContext exec_context); 00582 00611 ReturnCode_t detach_context(in ExecutionContextHandle_t exec_handle); 00612 00632 ExecutionContext get_context(in ExecutionContextHandle_t exec_handle); 00633 00652 ExecutionContextList get_owned_contexts(); 00653 00684 ExecutionContextList get_participating_contexts(); 00685 00702 ExecutionContextHandle_t get_context_handle(in ExecutionContext cxt); 00703 }; 00704 00719 enum ExecutionKind 00720 { 00735 PERIODIC, 00750 EVENT_DRIVEN, 00765 OTHER 00766 }; 00767 00834 interface ExecutionContext 00835 { 00836 00855 boolean is_running(); 00856 00889 ReturnCode_t start(); 00890 00918 ReturnCode_t stop(); 00919 00947 double get_rate(); 00948 00982 ReturnCode_t set_rate(in double rate); 00983 01015 ReturnCode_t add_component(in LightweightRTObject comp); 01016 01046 ReturnCode_t remove_component(in LightweightRTObject comp); 01047 01087 ReturnCode_t activate_component(in LightweightRTObject comp); 01088 01122 ReturnCode_t deactivate_component(in LightweightRTObject comp); 01123 01158 ReturnCode_t reset_component(in LightweightRTObject comp); 01159 01182 LifeCycleState get_component_state(in LightweightRTObject comp); 01183 01197 ExecutionKind get_kind(); 01198 }; 01199 01200 01216 interface DataFlowComponentAction 01217 { 01243 ReturnCode_t on_execute(in ExecutionContextHandle_t exec_handle); 01270 ReturnCode_t on_state_update(in ExecutionContextHandle_t exec_handle); 01289 ReturnCode_t on_rate_changed(in ExecutionContextHandle_t exec_handle); 01290 }; 01291 01317 interface DataFlowComponent 01318 : LightweightRTObject, DataFlowComponentAction 01319 { 01320 }; 01321 01343 interface Fsm 01344 : LightweightRTObject 01345 { 01346 }; 01347 01363 interface FsmParticipantAction 01364 { 01365 01384 ReturnCode_t on_action(in ExecutionContextHandle_t exec_handle); 01385 }; 01386 01394 interface FsmParticipant 01395 : LightweightRTObject, FsmParticipantAction 01396 { 01397 }; 01398 01412 interface Mode 01413 { 01414 }; 01415 01458 interface ModeCapable 01459 { 01477 Mode get_default_mode(); 01496 Mode get_current_mode(); 01514 Mode get_current_mode_in_context(in ExecutionContext exec_context); 01529 Mode get_pending_mode(); 01551 Mode get_pending_mode_in_context(in ExecutionContext exec_context); 01578 ReturnCode_t set_mode(in Mode new_mode, 01579 in boolean immediate); 01580 }; 01581 01593 interface MultiModeComponentAction 01594 { 01617 ReturnCode_t on_mode_changed(in ExecutionContextHandle_t exec_handle); 01618 }; 01619 01627 interface MultiModeObject 01628 : LightweightRTObject, ModeCapable, MultiModeComponentAction 01629 { 01630 }; 01631 01632 interface RTObject; 01633 01645 enum PortInterfacePolarity 01646 { 01660 PROVIDED, 01673 REQUIRED 01674 }; 01675 01691 struct PortInterfaceProfile 01692 { 01705 string instance_name; 01718 string type_name; 01732 PortInterfacePolarity polarity; 01733 }; 01734 01735 typedef sequence<PortInterfaceProfile> PortInterfaceProfileList; 01736 01737 interface PortService; 01738 typedef sequence<PortService> PortServiceList; 01739 typedef sequence<RTObject> RTCList; 01740 01754 struct ConnectorProfile 01755 { 01768 string name; 01783 UniqueIdentifier connector_id; 01797 PortServiceList ports; 01816 NVList properties; 01817 }; 01818 01819 typedef sequence<ConnectorProfile> ConnectorProfileList; 01820 01836 struct PortProfile 01837 { 01856 string name; 01870 PortInterfaceProfileList interfaces; 01883 PortService port_ref; 01897 ConnectorProfileList connector_profiles; 01910 RTObject owner; 01929 NVList properties; 01930 }; 01931 01932 typedef sequence<PortProfile> PortProfileList; 01933 01941 struct ExecutionContextProfile 01942 { 01955 ExecutionKind kind; 01975 double rate; 01988 RTObject owner; 02001 RTCList participants; 02021 NVList properties; 02022 }; 02023 02024 typedef sequence<ExecutionContextProfile> 02025 ExecutionContextProfileList; 02026 02040 interface FsmObject 02041 { 02076 ReturnCode_t send_stimulus(in string message, 02077 in ExecutionContextHandle_t exec_handle); 02078 }; 02079 02099 struct FsmBehaviorProfile 02100 { 02115 FsmParticipantAction action_component; 02128 UniqueIdentifier id; 02129 }; 02130 02131 typedef sequence<FsmBehaviorProfile> FsmBehaviorProfileList; 02146 struct FsmProfile 02147 { 02161 FsmBehaviorProfileList behavior_profiles; 02162 }; 02163 02177 interface FsmService 02178 : SDOPackage::SDOService 02179 { 02198 FsmProfile get_fsm_profile(); 02212 ReturnCode_t set_fsm_profile(in FsmProfile fsm_profile); 02213 }; 02214 02228 struct ComponentProfile 02229 { 02247 string instance_name; 02265 string type_name; 02279 string description; 02298 string version; 02312 string vendor; 02327 string category; 02347 PortProfileList port_profiles; 02362 RTObject parent; 02381 NVList properties; 02382 }; 02383 02384 typedef sequence<ComponentProfile> ComponentProfileList; 02385 02413 interface PortService 02414 : SDOPackage::SDOService 02415 { 02428 PortProfile get_port_profile(); 02442 ConnectorProfileList get_connector_profiles(); 02456 ConnectorProfile get_connector_profile(in UniqueIdentifier connector_id); 02479 ReturnCode_t connect(inout ConnectorProfile connector_profile); 02501 ReturnCode_t disconnect(in UniqueIdentifier connector_id); 02515 ReturnCode_t disconnect_all(); 02540 ReturnCode_t notify_connect(inout ConnectorProfile connector_profile); 02565 ReturnCode_t notify_disconnect(in UniqueIdentifier connector_id); 02566 }; 02567 02586 interface ExecutionContextService 02587 : ExecutionContext, SDOPackage::SDOService 02588 { 02602 ExecutionContextProfile get_profile(); 02603 }; 02604 02605 typedef sequence<ExecutionContextService> 02606 ExecutionContextServiceList; 02607 02621 interface RTObject 02622 : LightweightRTObject, SDOPackage::SDO 02623 { 02636 ComponentProfile get_component_profile(); 02649 PortServiceList get_ports(); 02650 }; 02651 }; 02652 02653 #endif // RTC_IDL