00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DCPS_IR_SUBSCRIPTION_H
00009 #define DCPS_IR_SUBSCRIPTION_H
00010
00011 #include "inforepo_export.h"
00012 #include "UpdateDataTypes.h"
00013 #include "dds/DdsDcpsInfrastructureC.h"
00014 #include "dds/DdsDcpsSubscriptionC.h"
00015 #include "dds/DCPS/InfoRepoDiscovery/InfoC.h"
00016 #include "dds/DCPS/InfoRepoDiscovery/DataReaderRemoteC.h"
00017 #include "ace/Unbounded_Set.h"
00018
00019 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00020 #pragma once
00021 #endif
00022
00023
00024 class DCPS_IR_Publication;
00025 typedef ACE_Unbounded_Set<DCPS_IR_Publication*> DCPS_IR_Publication_Set;
00026
00027 class DCPS_IR_Participant;
00028 class DCPS_IR_Topic_Description;
00029 class DCPS_IR_Topic;
00030
00031
00032
00033
00034
00035
00036
00037
00038 class OpenDDS_InfoRepoLib_Export DCPS_IR_Subscription {
00039 public:
00040 DCPS_IR_Subscription(const OpenDDS::DCPS::RepoId& id,
00041 DCPS_IR_Participant* participant,
00042 DCPS_IR_Topic* topic,
00043 OpenDDS::DCPS::DataReaderRemote_ptr reader,
00044 const DDS::DataReaderQos& qos,
00045 const OpenDDS::DCPS::TransportLocatorSeq& info,
00046 const DDS::SubscriberQos& subscriberQos,
00047 const char* filterClassName,
00048 const char* filterExpression,
00049 const DDS::StringSeq& exprParams);
00050
00051 ~DCPS_IR_Subscription();
00052
00053
00054
00055
00056
00057
00058 int add_associated_publication(DCPS_IR_Publication* pub, bool active);
00059
00060
00061
00062
00063
00064 void association_complete(const OpenDDS::DCPS::RepoId& remote);
00065
00066
00067
00068 void call_association_complete(const OpenDDS::DCPS::RepoId& remote);
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 int remove_associated_publication(DCPS_IR_Publication* pub,
00083 CORBA::Boolean sendNotify,
00084 CORBA::Boolean notify_lost,
00085 bool notify_both_side = false);
00086
00087
00088
00089
00090
00091
00092
00093 int remove_associations(CORBA::Boolean notify_lost);
00094
00095
00096 void disassociate_participant(OpenDDS::DCPS::RepoId id,
00097 bool reassociate = false);
00098
00099
00100 void disassociate_topic(OpenDDS::DCPS::RepoId id);
00101
00102
00103 void disassociate_publication(OpenDDS::DCPS::RepoId id,
00104 bool reassociate = false);
00105
00106
00107
00108 void update_incompatible_qos();
00109
00110
00111
00112
00113 CORBA::Boolean is_publication_ignored(OpenDDS::DCPS::RepoId partId,
00114 OpenDDS::DCPS::RepoId topicId,
00115 OpenDDS::DCPS::RepoId pubId);
00116
00117
00118
00119 const DDS::DataReaderQos* get_datareader_qos();
00120
00121
00122
00123 const DDS::SubscriberQos* get_subscriber_qos();
00124
00125
00126
00127 bool set_qos(const DDS::DataReaderQos & qos,
00128 const DDS::SubscriberQos & subscriberQos,
00129 Update::SpecificQos& specificQos);
00130
00131
00132 void set_qos(const DDS::DataReaderQos& qos);
00133
00134
00135 void set_qos(const DDS::SubscriberQos& qos);
00136
00137 void reevaluate_defunct_associations();
00138
00139
00140
00141
00142
00143
00144
00145 void reevaluate_existing_associations();
00146
00147
00148
00149
00150
00151 bool reevaluate_association(DCPS_IR_Publication* publication);
00152
00153 OpenDDS::DCPS::TransportLocatorSeq get_transportLocatorSeq() const;
00154
00155
00156
00157 OpenDDS::DCPS::IncompatibleQosStatus* get_incompatibleQosStatus();
00158
00159 OpenDDS::DCPS::RepoId get_id();
00160 OpenDDS::DCPS::RepoId get_topic_id();
00161 OpenDDS::DCPS::RepoId get_participant_id();
00162
00163 DCPS_IR_Topic_Description* get_topic_description();
00164
00165 DCPS_IR_Topic* get_topic();
00166
00167 DDS::InstanceHandle_t get_handle();
00168 void set_handle(DDS::InstanceHandle_t handle);
00169
00170 CORBA::Boolean is_bit();
00171 void set_bit_status(CORBA::Boolean isBIT);
00172
00173
00174 OpenDDS::DCPS::DataReaderRemote_ptr reader();
00175
00176 std::string get_filter_class_name() const;
00177 std::string get_filter_expression() const;
00178 DDS::StringSeq get_expr_params() const;
00179
00180
00181 void update_expr_params(const DDS::StringSeq& params);
00182
00183 std::string dump_to_string(const std::string& prefix, int depth) const;
00184
00185 private:
00186 OpenDDS::DCPS::RepoId id_;
00187 DCPS_IR_Participant* participant_;
00188 DCPS_IR_Topic* topic_;
00189 DDS::InstanceHandle_t handle_;
00190 CORBA::Boolean isBIT_;
00191
00192
00193 OpenDDS::DCPS::DataReaderRemote_var reader_;
00194 DDS::DataReaderQos qos_;
00195 OpenDDS::DCPS::TransportLocatorSeq info_;
00196 DDS::SubscriberQos subscriberQos_;
00197 std::string filterClassName_;
00198 std::string filterExpression_;
00199 DDS::StringSeq exprParams_;
00200
00201 DCPS_IR_Publication_Set associations_;
00202 DCPS_IR_Publication_Set defunct_;
00203
00204 OpenDDS::DCPS::IncompatibleQosStatus incompatibleQosStatus_;
00205 };
00206
00207 #endif