#include "dds_rtf2_dcps.idl" module CCM_DDS { // ---------- // Exceptions // ---------- exception AlreadyCreated { ULongSeq indexes; // of the erroneous }; exception NonExistent{ ULongSeq indexes; // of the erroneous }; exception InternalError{ unsigned long error_code;// DDS codes that are relevant: // ERROR (1); UNSUPPORTED (2); OUT_OF_RESOURCE (5) unsigned long index; // of the erroneaous }; exception BadParameter {}; // ------------------------------------- // Interfaces to be 'used' or 'provided' // ------------------------------------- // Data access - publishing side // ----------------------------- interface Writer { // T assumed to be a data type void write (in T an_instance) raises (InternalError); }; interface MultiWriter { typedef sequence T$Seq; unsigned long write(in T$Seq instances) // returns nb of written raises (InternalError); attribute boolean is_coherent_write; // behaviour: // - attempt to write is stopped at the first error // - if is_coherent_write, write orders are placed betwen begin/end // coherent updates (even if an error occurs) }; interface Updater { void create (in T an_instance) raises (AlreadyCreated, InternalError); void update (in T an_instance) raises (NonExistent, InternalError); void delete (in T an_instance) raises (NonExistent, InternalError); readonly attribute boolean is_lifecycle_checked; // behaviour: // - exceptions AlreadyCreated or NonExistent are raised only if // is_lifecycle_checked // - note: this check requires to previously attempt to read (not free) // - note: this check is not 100% guarantee as a creation or a deletion may // occur between the check and the actual write od dispose order }; interface MultiUpdater { typedef sequence T$Seq; unsigned long create (in T$Seq instances) // returns nb of created instances raises (AlreadyCreated, InternalError unsigned long update (in T$Seq instances) // returns nb of updated instances raises (NonExistent, InternalError); unsigned long delete (in T$Seq instances) // returns nb of deleted instances raises (NonExistent, InternalError); readonly attribute boolean is_lifecycle_checked; attribute boolean is_coherent_write; // behaviour: // - exceptions AlreadyCreated or NonExistent are raised only if // is_lifecycle_checked // - global check is performed before actual write or dispose // (in case of error, all the erroneous instances are reported // in the exception) // - attempt to write or dispose is stopped at the first error // - if is_coherent_write, write orders are placed betwen begin/end // coherent updates (even if an error occurs) }; // Data access - subscribing side // ------------------------------ // read => no wait // get => wait enum AccessStatus { FRESH_INFO, ALREADY_SEEN }; enum InstanceStatus { INSTANCE_CREATED, INSTANCE_UPDATED, INSTANCE_DELETED }; struct ReadInfo { AccessStatus access_status; InstanceStatus instance_status; DDS::Time_t timestamp; unsigned long instance_rank; }; typedef sequence ReadInfoSeq; struct QueryFilter { string query; StringSeq query_parameters; }; interface Reader { typedef sequence T$Seq; void read_all (out T$Seq instances, out ReadInfoSeq infos) raises (InternalError); void read_all_history (out T$Seq instances, out ReadInfoSeq infos) raises (InternalError); void read_one (inout T an_instance, out ReadInfo info) raises (NonExistent, InternalError); void read_one_history (in T an_instance, out T$Seq instances, out ReadInfoSeq infos) raises (NonExistent, InternalError); attribute QueryFilter filter setraises (BadParameter); // behaviour // - read operations are performed with the following parameters // - READ or NO_READ // - NEW or NOT_NEW // - ALIVE // - through the query as specified in the filter ("" means no query) // - data returned: // - read_all returns for each living instance, its last sample // ordered by instance first and then by sample // - read_all_history returns all the samples of all instances // ordered by instance first and then by sample // - read_one returns the last sample of the given instance // - read_one_history returns all the samples for the given instance }; interface Getter { typedef sequence T$Seq; boolean get_all (out T$Seq instances, out ReadInfoSeq infos) raises (InternalError); boolean get_all_history (out T$Seq instances, out ReadInfoSeq infos) raises (InternalError); boolean get_one (inout T an_instance, out ReadInfo info) raises (NonExistent, InternalError); boolean get_one_history (in T an_instance, out T$Seq instances, out ReadInfoSeq infos) raises (NonExistent, InternalError); boolean get_next (out T an_instance, out ReadInfo info) raises (InternalError); attribute QueryFilter filter setraises (BadParameter); attribute DDS::Duration_t time_out; // behaviour // - get operations are performed with the following parameters // - NO_READ // - NEW or NOT_NEW // - ALIVE or NOT_ALIVE // - through the query as specified in the filter ("" means no query) // - within the time limit specified in time_out // - all operations returns TRUE if data are provided, // FALSE if time-out occurred // - data returned: // - get_all returns for all the instances their last sample // - get_all_history returns all the samples of all instances // - get_one returns the last sample of the given instance // - get_one_history returns all the samples for the given instance // - get_next returns each read sample one by one }; interface RawListener { void on_data (in T an_instance, in ReadInfo info); // behaviour // - similar to a get_next, except that in push mode instead of pull mode // - triggered only if enabled is the associated ListenerControl // - query filter (if any) in the associated Reader }; interface StateListener { void on_creation (in T an_instance, in DDS::Time_t timestamp); void on_update (in T an_instance, in DDS::Time_t timestamp); void on_deletion (in T an_instance, in DDS::Time_t timestamp); // behaviour // - similar to a get_next, except that different operations are called // depending on the instance state // - triggered only if enabled is the associated ListenerControl // - query filter (if any) in the associated Reader enum GroupingMode { INSTANCE_HISTORY, LAST_SAMPLE_ALL_INSTANCES, ALL_SAMPLES_ALL_INSTANCES }; interface MultiListener { typedef sequence T$Seq; void on_data (in T$Seq instances, in ReadInfoSeq infos); attribute GroupingMode grouping_mode; // behaviour // - depending on grouping_mode similar to get_one_history(any new instance), // get_all or get_all_history, except that in push mode instead of // pull mode // - triggered only if enabled is the associated ListenerControl // - query filter (if any) in the associated Reader }; interface ListenerControl { attribute boolean enabled; }; // Status Access // ------------- interface PortStatusListener { // status that are relevant to the component void on_requested_deadline_missed( in DDS::DataReader the_reader, in DDS::RequestedDeadlineMissedStatus status); void on_sample_lost( in DDS::DataReader the_reader, in DDS::SampleLostStatus status); }; interface ConnectorStatusListener { // status that are relevant system-wide void on_inconsistent_topic( in DDS::Topic the_topic, in DDS::InconsistentTopicStatus status); void on_requested_incompatible_qos( in DDS::DataReader the_reader, in DDS::RequestedIncompatibleQosStatus status); void on_sample_rejected( in DDS::DataReader the_reader, in DDS::SampleRejectedStatus status); void on_offered_deadline_missed( in DDS::DataWriter the_writer, in DDS::OfferedDeadlineMissedStatus status); void on_offered_incompatible_qos( in DDS::DataWriter the_writer, in DDS::OfferedIncompatibleQosStatus status); void on_unexpected_status ( in DDS::Entity the_entity, in DDS::StatusKind); }; // --------- // DDS Ports // --------- porttype DDS_Write { uses Writer data; uses DDS::DataWriter dds_entity; }; porttype DDS_MultiWrite { uses MultiWriter data; uses DDS::DataWriter dds_entity; }; porttype DDS_Update { uses Updater data; uses DDS::DataWriter dds_entity; }; porttype DDS_MultiUpdate { uses MultiUpdater data; uses DDS::DataWriter dds_entity; }; porttype DDS_Read { uses Reader data; uses DDS::DataReader dds_entity; provides PortStatusListener status; }; porttype DDS_Get { uses Getter data; uses DDS::DataReader dds_entity; provides PortStatusListener status; }; porttype DDS_RawListen { uses Reader data; uses ListenerControl control; provides RawListener listener; uses DDS::DataReader dds_entity; provides PortStatusListener status; }; porttype DDS_StateListen { uses Reader data; uses ListenerControl control; provides StateListener listener; uses DDS::DataReader dds_entity; provides PortStatusListener status; }; porttype DDS_MultiListen { uses Reader data; uses ListenerControl control; provides MultiListener listener; uses DDS::DataReader dds_entity; provides PortStatusListener status; }; // ---------------------------- // Connectors // (Correspond to DDS patterns) // ---------------------------- connector DDS_Base { uses ConnectorStatusListener error_listener; readonly attribute DDS::DomainId_t domain_id; readonly attribute string qos_profile;// File URL or XML string }; connector DDS_TopicBase : DDS_Base { readonly attribute string topic_name; readonly attribute StringSeq key_fields; }; connector DDS_State : DDS_TopicBase { // T assumed to be a data type mirrorport DDS_Update observable; mirrorport DDS_Read passive_observer; mirrorport DDS_Get pull_observer; mirrorport DDS_StateListen push_observer; }; connector DDS_Event : DDS_TopicBase { // T assumed to be a data type mirrorport DDS_Write supplier; mirrorport DDS_Get pull_consumer; mirrorport DDS_Listen push_consumer; }; };