00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DCPSINFO_I_H
00009 #define DCPSINFO_I_H
00010
00011 #include "inforepo_export.h"
00012 #include "DCPS_IR_Topic.h"
00013 #include "DCPS_IR_Topic_Description.h"
00014 #include "DCPS_IR_Participant.h"
00015 #include "DCPS_IR_Publication.h"
00016 #include "DCPS_IR_Subscription.h"
00017 #include "DCPS_IR_Domain.h"
00018 #include "dds/DCPS/RepoIdGenerator.h"
00019 #include "FederationId.h"
00020 #include "UpdateManager.h"
00021
00022 #include "dds/DCPS/InfoRepoDiscovery/InfoS.h"
00023 #include "dds/DCPS/InfoRepoDiscovery/DataReaderRemoteC.h"
00024 #include "dds/DCPS/InfoRepoDiscovery/DataWriterRemoteC.h"
00025
00026 #include "tao/ORB_Core.h"
00027
00028 #include <map>
00029
00030 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00031 #pragma once
00032 #endif
00033
00034
00035 typedef std::map<DDS::DomainId_t, DCPS_IR_Domain*> DCPS_IR_Domain_Map;
00036
00037
00038 namespace Update {
00039 class Manager;
00040 }
00041
00042 class ShutdownInterface;
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 class OpenDDS_InfoRepoLib_Export TAO_DDS_DCPSInfo_i
00053 : public virtual POA_OpenDDS::DCPS::DCPSInfo,
00054 public ACE_Event_Handler {
00055 public:
00056
00057 TAO_DDS_DCPSInfo_i(
00058 CORBA::ORB_ptr orb,
00059 bool reincarnate,
00060 ShutdownInterface* shutdown,
00061 const TAO_DDS_DCPSFederationId& federation);
00062
00063
00064 virtual ~TAO_DDS_DCPSInfo_i();
00065
00066 virtual int handle_timeout(const ACE_Time_Value& now,
00067 const void* arg);
00068
00069 virtual CORBA::Boolean attach_participant(
00070 DDS::DomainId_t domainId,
00071 const OpenDDS::DCPS::RepoId& participantId);
00072
00073 virtual OpenDDS::DCPS::TopicStatus assert_topic(
00074 OpenDDS::DCPS::RepoId_out topicId,
00075 DDS::DomainId_t domainId,
00076 const OpenDDS::DCPS::RepoId& participantId,
00077 const char * topicName,
00078 const char * dataTypeName,
00079 const DDS::TopicQos & qos,
00080 bool hasDcpsKey);
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 bool add_topic(const OpenDDS::DCPS::RepoId& topicId,
00100 DDS::DomainId_t domainId,
00101 const OpenDDS::DCPS::RepoId& participantId,
00102 const char* topicName,
00103 const char* dataTypeName,
00104 const DDS::TopicQos& qos);
00105
00106 virtual OpenDDS::DCPS::TopicStatus find_topic(
00107 DDS::DomainId_t domainId,
00108 const char * topicName,
00109 CORBA::String_out dataTypeName,
00110 DDS::TopicQos_out qos,
00111 OpenDDS::DCPS::RepoId_out topicId);
00112
00113 virtual OpenDDS::DCPS::TopicStatus remove_topic(
00114 DDS::DomainId_t domainId,
00115 const OpenDDS::DCPS::RepoId& participantId,
00116 const OpenDDS::DCPS::RepoId& topicId);
00117
00118 virtual OpenDDS::DCPS::RepoId add_publication(
00119 DDS::DomainId_t domainId,
00120 const OpenDDS::DCPS::RepoId& participantId,
00121 const OpenDDS::DCPS::RepoId& topicId,
00122 OpenDDS::DCPS::DataWriterRemote_ptr publication,
00123 const DDS::DataWriterQos & qos,
00124 const OpenDDS::DCPS::TransportLocatorSeq & transInfo,
00125 const DDS::PublisherQos & publisherQos);
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148 bool add_publication(DDS::DomainId_t domainId,
00149 const OpenDDS::DCPS::RepoId& participantId,
00150 const OpenDDS::DCPS::RepoId& topicId,
00151 const OpenDDS::DCPS::RepoId& pubId,
00152 const char* pub_str,
00153 const DDS::DataWriterQos & qos,
00154 const OpenDDS::DCPS::TransportLocatorSeq & transInfo,
00155 const DDS::PublisherQos & publisherQos,
00156 bool associate = false);
00157
00158 virtual void remove_publication(
00159 DDS::DomainId_t domainId,
00160 const OpenDDS::DCPS::RepoId& participantId,
00161 const OpenDDS::DCPS::RepoId& publicationId);
00162
00163 virtual OpenDDS::DCPS::RepoId add_subscription(
00164 DDS::DomainId_t domainId,
00165 const OpenDDS::DCPS::RepoId& participantId,
00166 const OpenDDS::DCPS::RepoId& topicId,
00167 OpenDDS::DCPS::DataReaderRemote_ptr subscription,
00168 const DDS::DataReaderQos & qos,
00169 const OpenDDS::DCPS::TransportLocatorSeq & transInfo,
00170 const DDS::SubscriberQos & subscriberQos,
00171 const char* filterClassName,
00172 const char* filterExpression,
00173 const DDS::StringSeq& exprParams);
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 bool add_subscription(DDS::DomainId_t domainId,
00197 const OpenDDS::DCPS::RepoId& participantId,
00198 const OpenDDS::DCPS::RepoId& topicId,
00199 const OpenDDS::DCPS::RepoId& subId,
00200 const char* sub_str,
00201 const DDS::DataReaderQos & qos,
00202 const OpenDDS::DCPS::TransportLocatorSeq & transInfo,
00203 const DDS::SubscriberQos & subscriberQos,
00204 const char* filterClassName,
00205 const char* filterExpression,
00206 const DDS::StringSeq& exprParams,
00207 bool associate = false);
00208
00209 virtual void remove_subscription(
00210 DDS::DomainId_t domainId,
00211 const OpenDDS::DCPS::RepoId& participantId,
00212 const OpenDDS::DCPS::RepoId& subscriptionId);
00213
00214 virtual OpenDDS::DCPS::AddDomainStatus add_domain_participant(
00215 DDS::DomainId_t domain,
00216 const DDS::DomainParticipantQos & qos);
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233 bool add_domain_participant(DDS::DomainId_t domainId
00234 , const OpenDDS::DCPS::RepoId& participantId
00235 , const DDS::DomainParticipantQos & qos);
00236
00237 virtual void remove_domain_participant(
00238 DDS::DomainId_t domainId,
00239 const OpenDDS::DCPS::RepoId& participantId);
00240
00241 virtual void association_complete(DDS::DomainId_t domainId,
00242 const OpenDDS::DCPS::RepoId& participantId,
00243 const OpenDDS::DCPS::RepoId& localId,
00244 const OpenDDS::DCPS::RepoId& remoteId);
00245
00246 bool remove_by_owner(
00247 DDS::DomainId_t domain,
00248 long owner);
00249
00250 virtual void disassociate_participant(
00251 DDS::DomainId_t domainId,
00252 const OpenDDS::DCPS::RepoId& local_id,
00253 const OpenDDS::DCPS::RepoId& remote_id);
00254
00255 virtual void disassociate_subscription(
00256 DDS::DomainId_t domainId,
00257 const OpenDDS::DCPS::RepoId& participantId,
00258 const OpenDDS::DCPS::RepoId& local_id,
00259 const OpenDDS::DCPS::RepoId& remote_id);
00260
00261 virtual void disassociate_publication(
00262 DDS::DomainId_t domainId,
00263 const OpenDDS::DCPS::RepoId& participantId,
00264 const OpenDDS::DCPS::RepoId& local_id,
00265 const OpenDDS::DCPS::RepoId& remote_id);
00266
00267 virtual void ignore_domain_participant(
00268 DDS::DomainId_t domainId,
00269 const OpenDDS::DCPS::RepoId& myParticipantId,
00270 const OpenDDS::DCPS::RepoId& ignoreId);
00271
00272 virtual void ignore_topic(
00273 DDS::DomainId_t domainId,
00274 const OpenDDS::DCPS::RepoId& myParticipantId,
00275 const OpenDDS::DCPS::RepoId& ignoreId);
00276
00277 virtual void ignore_subscription(
00278 DDS::DomainId_t domainId,
00279 const OpenDDS::DCPS::RepoId& myParticipantId,
00280 const OpenDDS::DCPS::RepoId& ignoreId);
00281
00282 virtual void ignore_publication(
00283 DDS::DomainId_t domainId,
00284 const OpenDDS::DCPS::RepoId& myParticipantId,
00285 const OpenDDS::DCPS::RepoId& ignoreId);
00286
00287 virtual CORBA::Boolean update_publication_qos(
00288 DDS::DomainId_t domainId,
00289 const OpenDDS::DCPS::RepoId& partId,
00290 const OpenDDS::DCPS::RepoId& dwId,
00291 const DDS::DataWriterQos & qos,
00292 const DDS::PublisherQos & publisherQos);
00293
00294
00295 void update_publication_qos(
00296 DDS::DomainId_t domainId,
00297 const OpenDDS::DCPS::RepoId& partId,
00298 const OpenDDS::DCPS::RepoId& dwId,
00299 const DDS::DataWriterQos& qos);
00300
00301
00302 void update_publication_qos(
00303 DDS::DomainId_t domainId,
00304 const OpenDDS::DCPS::RepoId& partId,
00305 const OpenDDS::DCPS::RepoId& dwId,
00306 const DDS::PublisherQos& qos);
00307
00308 virtual CORBA::Boolean update_subscription_qos(
00309 DDS::DomainId_t domainId,
00310 const OpenDDS::DCPS::RepoId& partId,
00311 const OpenDDS::DCPS::RepoId& drId,
00312 const DDS::DataReaderQos & qos,
00313 const DDS::SubscriberQos & subscriberQos);
00314
00315
00316 void update_subscription_qos(
00317 DDS::DomainId_t domainId,
00318 const OpenDDS::DCPS::RepoId& partId,
00319 const OpenDDS::DCPS::RepoId& drId,
00320 const DDS::DataReaderQos& qos);
00321
00322
00323 void update_subscription_qos(
00324 DDS::DomainId_t domainId,
00325 const OpenDDS::DCPS::RepoId& partId,
00326 const OpenDDS::DCPS::RepoId& drId,
00327 const DDS::SubscriberQos& qos);
00328
00329 virtual ::CORBA::Boolean update_subscription_params(
00330 DDS::DomainId_t domainId,
00331 const OpenDDS::DCPS::RepoId& participantId,
00332 const OpenDDS::DCPS::RepoId& subscriptionId,
00333 const DDS::StringSeq& params);
00334
00335 virtual CORBA::Boolean update_topic_qos(
00336 const OpenDDS::DCPS::RepoId& topicId,
00337 DDS::DomainId_t domainId,
00338 const OpenDDS::DCPS::RepoId& participantId,
00339 const DDS::TopicQos & qos);
00340
00341 virtual CORBA::Boolean update_domain_participant_qos(
00342 DDS::DomainId_t domain,
00343 const OpenDDS::DCPS::RepoId& participantId,
00344 const DDS::DomainParticipantQos & qos);
00345
00346
00347 virtual void shutdown();
00348
00349
00350 virtual char* dump_to_string();
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377 bool changeOwnership(
00378 DDS::DomainId_t domainId,
00379 const OpenDDS::DCPS::RepoId& participantId,
00380 long sender,
00381 long owner);
00382
00383
00384
00385 int init_transport(int listen_address_given,
00386 const char* listen_str);
00387
00388 bool receive_image(const Update::UImage& image);
00389
00390
00391 void add(Update::Updater* updater);
00392
00393
00394 DCPS_IR_Domain* domain(DDS::DomainId_t domain);
00395
00396
00397 const DCPS_IR_Domain_Map& domains() const;
00398
00399
00400 CORBA::ORB_ptr orb();
00401
00402 bool init_persistence();
00403
00404 bool init_reassociation(const ACE_Time_Value& delay);
00405
00406 bool init_dispatchChecking(const ACE_Time_Value& delay);
00407
00408
00409 void finalize();
00410
00411 private:
00412 DCPS_IR_Domain_Map domains_;
00413 CORBA::ORB_var orb_;
00414 CORBA::ORB_var dispatchingOrb_;
00415
00416 const TAO_DDS_DCPSFederationId& federation_;
00417 RepoIdGenerator participantIdGenerator_;
00418
00419 Update::Manager* um_;
00420 bool reincarnate_;
00421
00422
00423 ShutdownInterface* shutdown_;
00424
00425 ACE_Recursive_Thread_Mutex lock_;
00426
00427 long reassociate_timer_id_;
00428 long dispatch_check_timer_id_;
00429 };
00430
00431 #endif