DCPS_IR_Domain Class Reference

Representation of a Domain in the system. More...

#include <DCPS_IR_Domain.h>

Collaboration diagram for DCPS_IR_Domain:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DCPS_IR_Domain (DDS::DomainId_t id, RepoIdGenerator &generator)
 ~DCPS_IR_Domain ()
int add_participant (DCPS_IR_Participant *participant)
int remove_participant (const OpenDDS::DCPS::RepoId &particpantId, CORBA::Boolean notify_lost)
DCPS_IR_Participantparticipant (const OpenDDS::DCPS::RepoId &id) const
 Find the participant with the id.
OpenDDS::DCPS::TopicStatus add_topic (OpenDDS::DCPS::RepoId_out topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, DCPS_IR_Participant *participantPtr)
OpenDDS::DCPS::TopicStatus force_add_topic (const OpenDDS::DCPS::RepoId &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, DCPS_IR_Participant *participantPtr)
OpenDDS::DCPS::TopicStatus find_topic (const char *topicName, DCPS_IR_Topic *&topic)
DCPS_IR_Topicfind_topic (const OpenDDS::DCPS::RepoId &id)
 Find a topic object reference using the topic Id value.
OpenDDS::DCPS::TopicStatus remove_topic (DCPS_IR_Participant *part, DCPS_IR_Topic *&topic)
void remove_topic_id_mapping (const OpenDDS::DCPS::RepoId &topicId)
void add_dead_participant (DCPS_IR_Participant *participant)
void remove_dead_participants ()
 Remove any participants currently marked as dead.
DDS::DomainId_t get_id ()
OpenDDS::DCPS::RepoId get_next_participant_id ()
void last_participant_key (long key)
int init_built_in_topics (bool federated=false)
int cleanup_built_in_topics ()
 Cleans up the Built-In Topic structures.
int reassociate_built_in_topic_pubs ()
void publish_participant_bit (DCPS_IR_Participant *participant)
 Publish the Built-In Topic information.
void publish_topic_bit (DCPS_IR_Topic *topic)
void publish_subscription_bit (DCPS_IR_Subscription *subscription)
void publish_publication_bit (DCPS_IR_Publication *publication)
void dispose_participant_bit (DCPS_IR_Participant *participant)
 Remove the Built-In Topic information.
void dispose_topic_bit (DCPS_IR_Topic *topic)
void dispose_subscription_bit (DCPS_IR_Subscription *subscription)
void dispose_publication_bit (DCPS_IR_Publication *publication)
const DCPS_IR_Participant_Mapparticipants () const
 Expose a readable reference to the participant map.
std::string dump_to_string (const std::string &prefix, int depth) const

Private Types

typedef std::map< OpenDDS::DCPS::RepoId,
DCPS_IR_Topic *, OpenDDS::DCPS::GUID_tKeyLessThan
IdToTopicMap
 Mapping from RepoId values to Topic object references.

Private Member Functions

OpenDDS::DCPS::TopicStatus add_topic_i (OpenDDS::DCPS::RepoId &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, DCPS_IR_Participant *participantPtr)
int add_topic_description (DCPS_IR_Topic_Description *&desc)
int find_topic_description (const char *name, const char *dataTypeName, DCPS_IR_Topic_Description *&desc)
int remove_topic_description (DCPS_IR_Topic_Description *&desc)
int init_built_in_topics_topics ()
int init_built_in_topics_datawriters (bool federated)
int init_built_in_topics_transport ()

Private Attributes

DDS::DomainId_t id_
RepoIdGeneratorparticipantIdGenerator_
DCPS_IR_Participant_Map participants_
 all the participants
DCPS_IR_Participant_Set deadParticipants_
DCPS_IR_Topic_Description_Set topicDescriptions_
 all the topics
IdToTopicMap idToTopicMap_
 Actual mapping of Id values to Topic object references.
bool useBIT_
 indicates if the BuiltIn Topics are enabled
DDS::DomainParticipantFactory_var bitParticipantFactory_
 Built-in Topic variables.
DDS::DomainParticipant_var bitParticipant_
DDS::DomainParticipantListener_var bitParticipantListener_
DDS::Publisher_var bitPublisher_
OpenDDS::DCPS::TransportConfig_rch transportConfig_
DDS::Topic_var bitParticipantTopic_
DDS::ParticipantBuiltinTopicDataDataWriter_var bitParticipantDataWriter_
DDS::Topic_var bitTopicTopic_
DDS::TopicBuiltinTopicDataDataWriter_var bitTopicDataWriter_
DDS::Topic_var bitSubscriptionTopic_
DDS::SubscriptionBuiltinTopicDataDataWriter_var bitSubscriptionDataWriter_
DDS::Topic_var bitPublicationTopic_
DDS::PublicationBuiltinTopicDataDataWriter_var bitPublicationDataWriter_

Detailed Description

Representation of a Domain in the system.

This represents a Domain in the system. It contains the representatives of the entities that are in the corresponding system's domain.

Definition at line 59 of file DCPS_IR_Domain.h.


Member Typedef Documentation

typedef std::map<OpenDDS::DCPS::RepoId, DCPS_IR_Topic*, OpenDDS::DCPS::GUID_tKeyLessThan> DCPS_IR_Domain::IdToTopicMap [private]

Mapping from RepoId values to Topic object references.

Definition at line 215 of file DCPS_IR_Domain.h.


Constructor & Destructor Documentation

DCPS_IR_Domain::DCPS_IR_Domain ( DDS::DomainId_t  id,
RepoIdGenerator generator 
)

Definition at line 52 of file DCPS_IR_Domain.cpp.

00053   : id_(id),
00054     participantIdGenerator_(generator),
00055     useBIT_(false)
00056 {
00057 }

DCPS_IR_Domain::~DCPS_IR_Domain (  ) 

Definition at line 59 of file DCPS_IR_Domain.cpp.

References cleanup_built_in_topics().

00060 {
00061 #if !defined (DDS_HAS_MINIMUM_BIT)
00062 
00063   if (0 != cleanup_built_in_topics()) {
00064     ACE_ERROR((LM_ERROR, "(%P|%t) ERROR: Failed to clean up the Built-In Topics!\n"));
00065   }
00066 
00067 #endif // !defined (DDS_HAS_MINIMUM_BIT)
00068 }


Member Function Documentation

void DCPS_IR_Domain::add_dead_participant ( DCPS_IR_Participant participant  ) 

Mark a participant as being unresponsive (dead) and schedule it to be removed next time remove_dead_participants is called.

Definition at line 982 of file DCPS_IR_Domain.cpp.

References deadParticipants_, and participant().

Referenced by DCPS_IR_Participant::mark_dead().

00983 {
00984   deadParticipants_.insert(participant);
00985 }

int DCPS_IR_Domain::add_participant ( DCPS_IR_Participant participant  ) 

Add the participant This takes ownership of the memory if the particpant is added. Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 90 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Participant::get_id(), id_, participant(), participants_, and publish_participant_bit().

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

00091 {
00092   OpenDDS::DCPS::RepoId participantId = participant->get_id();
00093   OpenDDS::DCPS::RepoIdConverter converter(participantId);
00094 
00095   DCPS_IR_Participant_Map::iterator where
00096   = this->participants_.find(participantId);
00097 
00098   if (where == this->participants_.end()) {
00099     this->participants_.insert(
00100       DCPS_IR_Participant_Map::value_type(participantId, participant));
00101 
00102     // Publish the BIT information
00103     publish_participant_bit(participant);
00104 
00105     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00106       ACE_DEBUG((LM_DEBUG,
00107                  ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_participant: ")
00108                  ACE_TEXT("added participant %C in domain %d ")
00109                  ACE_TEXT("at 0x%x.\n"),
00110                  std::string(converter).c_str(),
00111                  id_,
00112                  participant));
00113     }
00114 
00115   } else {
00116     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00117       ACE_DEBUG((LM_NOTICE,
00118                  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_participant: ")
00119                  ACE_TEXT("attempt to add already existing participant %C in domain %d.\n"),
00120                  std::string(converter).c_str(),
00121                  id_));
00122     }
00123 
00124     return 1;
00125   }
00126 
00127   return 0;
00128 }

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::add_topic ( OpenDDS::DCPS::RepoId_out  topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
DCPS_IR_Participant participantPtr 
)

Add a topic to the domain Returns OpenDDS::DCPS::CREATED if successfull

Definition at line 172 of file DCPS_IR_Domain.cpp.

References add_topic_i(), OpenDDS::DCPS::CREATED, DCPS_IR_Participant::get_next_topic_id(), and OpenDDS::DCPS::GUID_UNKNOWN.

00177 {
00178   topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00179 
00180   OpenDDS::DCPS::RepoId topic_id = participantPtr->get_next_topic_id();
00181   OpenDDS::DCPS::TopicStatus status = add_topic_i(topic_id, topicName
00182                                                   , dataTypeName
00183                                                   , qos, participantPtr);
00184 
00185   if (status == OpenDDS::DCPS::CREATED) {
00186 
00187     topicId = topic_id;
00188   }
00189 
00190   return status;
00191 }

int DCPS_IR_Domain::add_topic_description ( DCPS_IR_Topic_Description *&  desc  )  [private]

Takes ownership of the memory pointed to by desc if successful returns 0 if successful, 1 if description already exists -1 unknown error 2 if confliciting dataTypeName

Definition at line 914 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Topic_Description::get_name(), id_, and topicDescriptions_.

Referenced by add_topic_i().

00915 {
00916   DCPS_IR_Topic_Description* discard = 0;
00917 
00918   switch (this->find_topic_description(
00919             desc->get_name(),
00920             desc->get_dataTypeName(),
00921             discard)) {
00922   case -1:
00923     this->topicDescriptions_.insert(desc);
00924 
00925     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00926       ACE_DEBUG((LM_DEBUG,
00927                  ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_topic_description: ")
00928                  ACE_TEXT("added Topic Description 0x%x in domain %d.\n"),
00929                  desc,
00930                  id_));
00931     }
00932 
00933     return 0;
00934 
00935   case 0:
00936     ACE_DEBUG((LM_NOTICE,
00937                ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_description: ")
00938                ACE_TEXT("attempt to add existing Topic Description 0x%x to domain %d.\n"),
00939                desc,
00940                id_));
00941     return 1;
00942 
00943   case 1:
00944     ACE_DEBUG((LM_NOTICE,
00945                ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_description: ")
00946                ACE_TEXT("attempt to add incompatible Topic Description 0x%x to domain %d.\n"),
00947                desc,
00948                id_));
00949     return 2;
00950 
00951   default:
00952     ACE_ERROR((LM_ERROR,
00953                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic_description: ")
00954                ACE_TEXT("unknown error adding Topic Description 0x%x to domain %d.\n"),
00955                desc,
00956                id_));
00957     return 2;
00958   }
00959 }

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::add_topic_i ( OpenDDS::DCPS::RepoId topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
DCPS_IR_Participant participantPtr 
) [private]

Definition at line 208 of file DCPS_IR_Domain.cpp.

References DCPS_IR_Topic_Description::add_topic(), add_topic_description(), DCPS_IR_Participant::add_topic_reference(), OpenDDS::DCPS::CONFLICTING_TYPENAME, OpenDDS::DCPS::CREATED, OpenDDS::DCPS::DCPS_debug_level, find_topic_description(), OpenDDS::DCPS::GUID_UNKNOWN, idToTopicMap_, OpenDDS::DCPS::NOT_FOUND, publish_topic_bit(), and DCPS_IR_Topic_Description::remove_topic().

Referenced by add_topic(), and force_add_topic().

00213 {
00214   DCPS_IR_Topic_Description* description;
00215   int descriptionLookup = find_topic_description(topicName, dataTypeName, description);
00216 
00217   if (1 == descriptionLookup) {
00218     topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00219     return OpenDDS::DCPS::CONFLICTING_TYPENAME;
00220 
00221   } else if (-1 == descriptionLookup) {
00222     ACE_NEW_RETURN(description,
00223                    DCPS_IR_Topic_Description(
00224                      this,
00225                      topicName,
00226                      dataTypeName),
00227                    OpenDDS::DCPS::NOT_FOUND);
00228 
00229     int descriptionAddition = add_topic_description(description);
00230 
00231     if (0 != descriptionAddition) {
00232       // unable to add the topic
00233       delete description;
00234       description = 0;
00235       topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00236 
00237       if (2 == descriptionAddition) {
00238         return OpenDDS::DCPS::CONFLICTING_TYPENAME;
00239 
00240       } else {
00241         return OpenDDS::DCPS::NOT_FOUND;
00242       }
00243     }
00244   }
00245 
00246   DCPS_IR_Topic* topic;
00247   ACE_NEW_RETURN(topic,
00248                  DCPS_IR_Topic(
00249                    topicId,
00250                    qos,
00251                    this,
00252                    participantPtr,
00253                    description),
00254                  OpenDDS::DCPS::NOT_FOUND);
00255 
00256   OpenDDS::DCPS::TopicStatus topicStatus = OpenDDS::DCPS::NOT_FOUND;
00257 
00258   switch (description->add_topic(topic)) {
00259   case 0: {
00260     switch (participantPtr->add_topic_reference(topic)) {
00261     case 0: {
00262       if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00263         OpenDDS::DCPS::RepoIdConverter converter(topicId);
00264         ACE_DEBUG((LM_DEBUG,
00265                    ACE_TEXT("(%P|%t) DCPS_IR_Domain::add_topic_i: ")
00266                    ACE_TEXT("Domain %d successfully added topic %C ")
00267                    ACE_TEXT("at 0x%x.\n"),
00268                    this->id_,
00269                    std::string(converter).c_str(),
00270                    topic));
00271       }
00272 
00273       topicStatus = OpenDDS::DCPS::CREATED;
00274 
00275       // Keep a reference to easily locate the topic by id.
00276       this->idToTopicMap_[ topicId] = topic;
00277 
00278       // Publish the BIT information
00279       publish_topic_bit(topic);
00280     }
00281     break;
00282 
00283     case 1:
00284 
00285       if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00286         OpenDDS::DCPS::RepoIdConverter converter(topicId);
00287         ACE_DEBUG((LM_NOTICE,
00288                    ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::add_topic_i: ")
00289                    ACE_TEXT("Domain %d declined to add duplicate topic %C at 0x%x.\n"),
00290                    this->id_,
00291                    std::string(converter).c_str(),
00292                    topic));
00293       }
00294 
00295       topicStatus = OpenDDS::DCPS::NOT_FOUND;
00296       topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00297       description->remove_topic(topic);
00298       delete topic;
00299       break;
00300 
00301     case -1: {
00302       OpenDDS::DCPS::RepoIdConverter converter(topicId);
00303       ACE_ERROR((LM_ERROR,
00304                  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic_i: ")
00305                  ACE_TEXT("Domain %d failed to add topic %C at 0x%x.\n"),
00306                  this->id_,
00307                  std::string(converter).c_str(),
00308                  topic));
00309       topicStatus = OpenDDS::DCPS::NOT_FOUND;
00310       topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00311       description->remove_topic(topic);
00312       delete topic;
00313     }
00314     break;
00315     }
00316   }
00317   break;
00318 
00319   case 1:
00320 
00321     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00322       OpenDDS::DCPS::RepoIdConverter converter(topicId);
00323       ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) WARNING: DCPS_IR_Domain::add_topic ")
00324                  ACE_TEXT("Unable to add topic 0x%x id %C to Topic Description\n"),
00325                  topic,
00326                  std::string(converter).c_str()));
00327     }
00328 
00329     topicStatus = OpenDDS::DCPS::NOT_FOUND;
00330     topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00331     delete topic;
00332     break;
00333 
00334   case -1: {
00335     OpenDDS::DCPS::RepoIdConverter converter(topicId);
00336     ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::add_topic ")
00337                ACE_TEXT("Unable to add topic 0x%x id %C to Topic Description\n"),
00338                topic,
00339                std::string(converter).c_str()));
00340     topicStatus = OpenDDS::DCPS::NOT_FOUND;
00341     topicId = OpenDDS::DCPS::GUID_UNKNOWN;
00342     delete topic;
00343   }
00344   break;
00345   }
00346 
00347   return topicStatus;
00348 }

int DCPS_IR_Domain::cleanup_built_in_topics (  ) 

Cleans up the Built-In Topic structures.

Definition at line 881 of file DCPS_IR_Domain.cpp.

References bitParticipant_, bitParticipantDataWriter_, bitParticipantFactory_, bitParticipantTopic_, bitPublicationDataWriter_, bitPublicationTopic_, bitPublisher_, bitSubscriptionDataWriter_, bitSubscriptionTopic_, bitTopicDataWriter_, bitTopicTopic_, and useBIT_.

Referenced by ~DCPS_IR_Domain().

00882 {
00883 #if !defined (DDS_HAS_MINIMUM_BIT)
00884 
00885   if (useBIT_) {
00886     // clean up the Built-in Topic objects
00887 
00888     if (!CORBA::is_nil(bitPublisher_)) {
00889       bitPublisher_->delete_datawriter(bitParticipantDataWriter_);
00890       bitPublisher_->delete_datawriter(bitTopicDataWriter_);
00891       bitPublisher_->delete_datawriter(bitSubscriptionDataWriter_);
00892       bitPublisher_->delete_datawriter(bitPublicationDataWriter_);
00893 
00894       bitParticipant_->delete_publisher(bitPublisher_);
00895     }
00896 
00897     if (!CORBA::is_nil(bitParticipant_)) {
00898       bitParticipant_->delete_topic(bitParticipantTopic_);
00899       bitParticipant_->delete_topic(bitTopicTopic_);
00900       bitParticipant_->delete_topic(bitSubscriptionTopic_);
00901       bitParticipant_->delete_topic(bitPublicationTopic_);
00902 
00903       bitParticipantFactory_->delete_participant(bitParticipant_);
00904     }
00905   }
00906 
00907   return 0;
00908 
00909 #else
00910   return 1;
00911 #endif // !defined (DDS_HAS_MINIMUM_BIT)
00912 }

void DCPS_IR_Domain::dispose_participant_bit ( DCPS_IR_Participant participant  ) 

Remove the Built-In Topic information.

Definition at line 1307 of file DCPS_IR_Domain.cpp.

References bitParticipantDataWriter_, DCPS_IR_Participant::get_handle(), DCPS_IR_Participant::get_id(), DCPS_IR_Participant::is_bit(), participant(), DDS::RETCODE_OK, and useBIT_.

Referenced by remove_participant().

01308 {
01309 #if !defined (DDS_HAS_MINIMUM_BIT)
01310 
01311   if (useBIT_) {
01312     if (!participant->is_bit()) {
01313       try {
01314         DDS::ParticipantBuiltinTopicData key_data;
01315         DDS::InstanceHandle_t handle = participant->get_handle();
01316 
01317         DDS::ReturnCode_t retGetKey
01318         = bitParticipantDataWriter_->get_key_value(key_data,
01319                                                    handle);
01320 
01321         if (DDS::RETCODE_OK != retGetKey) {
01322           OpenDDS::DCPS::RepoIdConverter converter(participant->get_id());
01323           ACE_ERROR((LM_ERROR,
01324                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_participant_bit ")
01325                      ACE_TEXT("Unable to get_key_value for participant %C handle %d.\n"),
01326                      std::string(converter).c_str(),
01327                      handle));
01328         }
01329 
01330         DDS::ReturnCode_t retDispose =
01331           bitParticipantDataWriter_->dispose(key_data,
01332                                              handle);
01333 
01334         if (DDS::RETCODE_OK != retDispose) {
01335           OpenDDS::DCPS::RepoIdConverter converter(participant->get_id());
01336           ACE_ERROR((LM_ERROR,
01337                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_participant_bit ")
01338                      ACE_TEXT("Unable to dispose for participant %C handle %d.\n"),
01339                      std::string(converter).c_str(),
01340                      handle));
01341         }
01342 
01343       } catch (const CORBA::Exception& ex) {
01344         ex._tao_print_exception(
01345           "ERROR: Exception caught in DCPS_IR_Domain::dispose_participant_bit:");
01346       }
01347     }
01348   }
01349 
01350 #else
01351   ACE_UNUSED_ARG(participant);
01352 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01353 }

void DCPS_IR_Domain::dispose_publication_bit ( DCPS_IR_Publication publication  ) 

Definition at line 1455 of file DCPS_IR_Domain.cpp.

References bitPublicationDataWriter_, DCPS_IR_Publication::get_handle(), DCPS_IR_Publication::is_bit(), DDS::RETCODE_OK, and useBIT_.

Referenced by DCPS_IR_Participant::remove_publication().

01456 {
01457 #if !defined (DDS_HAS_MINIMUM_BIT)
01458 
01459   if (useBIT_) {
01460     if (!publication->is_bit()) {
01461       try {
01462         DDS::PublicationBuiltinTopicData key_data;
01463         DDS::InstanceHandle_t handle = publication->get_handle();
01464 
01465         DDS::ReturnCode_t retGetKey
01466         = bitPublicationDataWriter_->get_key_value(key_data, handle);
01467 
01468         if (DDS::RETCODE_OK != retGetKey) {
01469           ACE_ERROR((LM_ERROR,
01470                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_publication_bit ")
01471                      ACE_TEXT("Unable to get_key_value for publication ptr 0x%x handle %d.  ")
01472                      ACE_TEXT("Call returned %d.\n"),
01473                      publication,
01474                      handle,
01475                      retGetKey));
01476         }
01477 
01478         DDS::ReturnCode_t retDispose =
01479           bitPublicationDataWriter_->dispose(key_data,
01480                                              handle);
01481 
01482         if (DDS::RETCODE_OK != retDispose) {
01483           ACE_ERROR((LM_ERROR,
01484                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_publication_bit ")
01485                      ACE_TEXT("Unable to dispose for publication ptr 0x%x handle %d.  ")
01486                      ACE_TEXT("Call returned %d.\n"),
01487                      publication,
01488                      handle,
01489                      retDispose));
01490         }
01491 
01492       } catch (const CORBA::Exception& ex) {
01493         ex._tao_print_exception(
01494           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::dispose_publication_bit:");
01495       }
01496     }
01497   }
01498 
01499 #else
01500   ACE_UNUSED_ARG(publication);
01501 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01502 }

void DCPS_IR_Domain::dispose_subscription_bit ( DCPS_IR_Subscription subscription  ) 

Definition at line 1405 of file DCPS_IR_Domain.cpp.

References bitSubscriptionDataWriter_, DCPS_IR_Subscription::get_handle(), DCPS_IR_Subscription::is_bit(), DDS::RETCODE_OK, and useBIT_.

Referenced by DCPS_IR_Participant::remove_subscription().

01406 {
01407 #if !defined (DDS_HAS_MINIMUM_BIT)
01408 
01409   if (useBIT_) {
01410     if (!subscription->is_bit()) {
01411       try {
01412         DDS::SubscriptionBuiltinTopicData key_data;
01413         DDS::InstanceHandle_t handle = subscription->get_handle();
01414 
01415         DDS::ReturnCode_t retGetKey
01416         = bitSubscriptionDataWriter_->get_key_value(key_data,
01417                                                     handle);
01418 
01419         if (DDS::RETCODE_OK != retGetKey) {
01420           ACE_ERROR((LM_ERROR,
01421                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_subscription_bit ")
01422                      ACE_TEXT("Unable to get_key_value for subscription ptr 0x%x handle %d.  ")
01423                      ACE_TEXT("Call returned %d.\n"),
01424                      subscription,
01425                      handle,
01426                      retGetKey));
01427         }
01428 
01429         DDS::ReturnCode_t retDispose =
01430           bitSubscriptionDataWriter_->dispose(key_data,
01431                                               handle);
01432 
01433         if (DDS::RETCODE_OK != retDispose) {
01434           ACE_ERROR((LM_ERROR,
01435                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_subscription_bit ")
01436                      ACE_TEXT("Unable to dispose for subscription ptr 0x%x handle %d.  ")
01437                      ACE_TEXT("Call returned %d.\n"),
01438                      subscription,
01439                      handle,
01440                      retDispose));
01441         }
01442 
01443       } catch (const CORBA::Exception& ex) {
01444         ex._tao_print_exception(
01445           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::dispose_subscription_bit:");
01446       }
01447     }
01448   }
01449 
01450 #else
01451   ACE_UNUSED_ARG(subscription);
01452 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01453 }

void DCPS_IR_Domain::dispose_topic_bit ( DCPS_IR_Topic topic  ) 

Definition at line 1355 of file DCPS_IR_Domain.cpp.

References bitTopicDataWriter_, DCPS_IR_Topic::get_handle(), DCPS_IR_Topic::is_bit(), DDS::RETCODE_OK, and useBIT_.

Referenced by remove_topic().

01356 {
01357 #if !defined (DDS_HAS_MINIMUM_BIT)
01358 
01359   if (useBIT_) {
01360     if (!topic->is_bit()) {
01361       try {
01362         DDS::TopicBuiltinTopicData key_data;
01363         DDS::InstanceHandle_t handle = topic->get_handle();
01364 
01365         DDS::ReturnCode_t retGetKey
01366         = bitTopicDataWriter_->get_key_value(key_data,
01367                                              handle);
01368 
01369         if (DDS::RETCODE_OK != retGetKey) {
01370           ACE_ERROR((LM_ERROR,
01371                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_topic_bit ")
01372                      ACE_TEXT("Unable to get_key_value for topic ptr 0x%x handle %d.  ")
01373                      ACE_TEXT("Call returned %d.\n"),
01374                      topic,
01375                      handle,
01376                      retGetKey));
01377         }
01378 
01379         DDS::ReturnCode_t retDispose =
01380           bitTopicDataWriter_->dispose(key_data,
01381                                        handle);
01382 
01383         if (DDS::RETCODE_OK != retDispose) {
01384           ACE_ERROR((LM_ERROR,
01385                      ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::dispose_topic_bit ")
01386                      ACE_TEXT("Unable to dispose for topic ptr 0x%x handle %d.  ")
01387                      ACE_TEXT("Call returned %d.\n"),
01388                      topic,
01389                      handle,
01390                      retDispose));
01391         }
01392 
01393       } catch (const CORBA::Exception& ex) {
01394         ex._tao_print_exception(
01395           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::dispose_topic_bit:");
01396       }
01397     }
01398   }
01399 
01400 #else
01401   ACE_UNUSED_ARG(topic);
01402 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01403 }

std::string DCPS_IR_Domain::dump_to_string ( const std::string &  prefix,
int  depth 
) const

Definition at line 1511 of file DCPS_IR_Domain.cpp.

References deadParticipants_, id_, participants_, topicDescriptions_, and useBIT_.

01512 {
01513   std::string str;
01514 #if !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
01515   for (int i=0; i < depth; i++)
01516     str += prefix;
01517   std::string indent = str + prefix;
01518   std::ostringstream os;
01519   os << "DCPS_IR_Domain[" << id_ << "]";
01520   str += os.str();
01521   if (useBIT_)
01522     str += " BITS";
01523   str += "\n";
01524 
01525   str += indent + "Participants:\n";
01526   for (DCPS_IR_Participant_Map::const_iterator pm = participants_.begin();
01527        pm != participants_.end();
01528        pm++)
01529   {
01530     str += pm->second->dump_to_string(prefix, depth+1);
01531   }
01532 
01533   str += indent + "Dead Participants:\n";
01534   for (DCPS_IR_Participant_Set::const_iterator dp = deadParticipants_.begin();
01535        dp != deadParticipants_.end();
01536        dp++)
01537   {
01538     OpenDDS::DCPS::RepoIdConverter sub_converter((*dp)->get_id());
01539     str += indent + std::string(sub_converter);
01540     str += "\n";
01541   }
01542 
01543   str += indent + "Topic Descriptions:\n";
01544   for (DCPS_IR_Topic_Description_Set::const_iterator tdi = topicDescriptions_.begin();
01545        tdi != topicDescriptions_.end();
01546        tdi++)
01547   {
01548     str += (*tdi)->dump_to_string(prefix, depth+1);
01549   }
01550 #endif // !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
01551   return str;
01552 }

DCPS_IR_Topic * DCPS_IR_Domain::find_topic ( const OpenDDS::DCPS::RepoId id  ) 

Find a topic object reference using the topic Id value.

Definition at line 383 of file DCPS_IR_Domain.cpp.

References idToTopicMap_.

00384 {
00385   IdToTopicMap::const_iterator location = this->idToTopicMap_.find(id);
00386 
00387   if (location == this->idToTopicMap_.end()) {
00388     return 0;
00389   }
00390 
00391   return location->second;
00392 }

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::find_topic ( const char *  topicName,
DCPS_IR_Topic *&  topic 
)

Find the topic with the topic name Does NOT take ownership of any initial memory pointed to by topic Returns OpenDDS::DCPS::FOUND if exists and topic is changed, -1 otherwise

Definition at line 351 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::FOUND, DCPS_IR_Topic::get_id(), id_, OpenDDS::DCPS::NOT_FOUND, and topicDescriptions_.

00352 {
00353   IsTheTopic isTheTopic(topicName);
00354   DCPS_IR_Topic_Description_Set::iterator which
00355   = std::find_if(
00356       this->topicDescriptions_.begin(),
00357       this->topicDescriptions_.end(),
00358       isTheTopic);
00359 
00360   if (which != this->topicDescriptions_.end()) {
00361     // Extract the topic from the description.
00362     topic = (*which)->get_first_topic();
00363 
00364     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00365       OpenDDS::DCPS::RepoId topicId = topic->get_id();
00366       OpenDDS::DCPS::RepoIdConverter converter(topicId);
00367       ACE_DEBUG((LM_DEBUG,
00368                  ACE_TEXT("(%P|%t) DCPS_IR_Domain::find_topic: ")
00369                  ACE_TEXT("located topic %C in domain %d.\n"),
00370                  std::string(converter).c_str(),
00371                  id_));
00372     }
00373 
00374     return OpenDDS::DCPS::FOUND;
00375 
00376   } else {
00377     // topic = 0;
00378     return OpenDDS::DCPS::NOT_FOUND;
00379   }
00380 }

int DCPS_IR_Domain::find_topic_description ( const char *  name,
const char *  dataTypeName,
DCPS_IR_Topic_Description *&  desc 
) [private]

Find the topic description with the name and data type name Does NOT take ownership of any initial memory pointed to by desc Returns 0 if found and desc is changed, -1 if not found and 1 if conflicting dataTypeName

Definition at line 446 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::DCPS_debug_level, id_, and topicDescriptions_.

Referenced by add_topic_i().

00450 {
00451   IsTheTopic isTheTopic(name);
00452   DCPS_IR_Topic_Description_Set::iterator which
00453   = std::find_if(
00454       this->topicDescriptions_.begin(),
00455       this->topicDescriptions_.end(),
00456       isTheTopic);
00457 
00458   if (which != this->topicDescriptions_.end()) {
00459     if (0 == ACE_OS::strcmp(dataTypeName, (*which)->get_dataTypeName())) {
00460       if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00461         ACE_DEBUG((LM_DEBUG,
00462                    ACE_TEXT("(%P|%t) DCPS_IR_Domain::find_topic_description: ")
00463                    ACE_TEXT("located topic description %C/%C in domain %d.\n"),
00464                    name,
00465                    dataTypeName,
00466                    id_));
00467       }
00468 
00469       desc = *which;
00470       return 0;
00471 
00472     } else {
00473       if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00474         ACE_DEBUG((LM_NOTICE,
00475                    ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Domain::find_topic_description: ")
00476                    ACE_TEXT("searching for topic description %C/%C, ")
00477                    ACE_TEXT("located topic description %C/%C instead in domain %d.\n"),
00478                    name,
00479                    dataTypeName,
00480                    (*which)->get_name(),
00481                    (*which)->get_dataTypeName(),
00482                    id_));
00483       }
00484 
00485       // desc = 0;
00486       return 1;
00487     }
00488 
00489   } else {
00490     // desc = 0;
00491     return -1;
00492   }
00493 }

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::force_add_topic ( const OpenDDS::DCPS::RepoId topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
DCPS_IR_Participant participantPtr 
)

Definition at line 194 of file DCPS_IR_Domain.cpp.

References add_topic_i().

00199 {
00200   OpenDDS::DCPS::RepoId topic_id = topicId;
00201   OpenDDS::DCPS::TopicStatus status = add_topic_i(topic_id, topicName
00202                                                   , dataTypeName
00203                                                   , qos, participantPtr);
00204 
00205   return status;
00206 }

DDS::DomainId_t DCPS_IR_Domain::get_id (  ) 

Definition at line 1015 of file DCPS_IR_Domain.cpp.

References id_.

01016 {
01017   return id_;
01018 }

OpenDDS::DCPS::RepoId DCPS_IR_Domain::get_next_participant_id (  ) 

Definition at line 1021 of file DCPS_IR_Domain.cpp.

References RepoIdGenerator::next(), and participantIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

01022 {
01023   return this->participantIdGenerator_.next();
01024 }

int DCPS_IR_Domain::init_built_in_topics ( bool  federated = false  ) 

Initialize the Built-In Topic structures This needs to be called before the run begins Returns 0 (zero) if successful

Definition at line 501 of file DCPS_IR_Domain.cpp.

References bitParticipant_, bitParticipantFactory_, bitParticipantListener_, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::DEFAULT_STATUS_MASK, id_, init_built_in_topics_datawriters(), init_built_in_topics_topics(), init_built_in_topics_transport(), PARTICIPANT_QOS_DEFAULT, TheParticipantFactory, TheTransientKludge, and useBIT_.

00502 {
00503   // Indicates that BIT subscriber and datareaders should not be created.
00504   TheTransientKludge->enable();
00505 
00506   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00507     ACE_DEBUG((LM_DEBUG,
00508                ACE_TEXT("(%P|%t) DCPS_IR_Domain::init_built_in_topics() ")
00509                ACE_TEXT(" Initializing Built In Topics for domain %d\n"),
00510                id_));
00511   }
00512 
00513   try {
00514     bitParticipantFactory_ = TheParticipantFactory;
00515 
00516     bitParticipantListener_ = new OPENDDS_DCPS_DomainParticipantListener_i;
00517 
00518     bitParticipant_ =
00519       bitParticipantFactory_->create_participant(id_,
00520                                                  PARTICIPANT_QOS_DEFAULT,
00521                                                  bitParticipantListener_.in(),
00522                                                  OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00523 
00524     if (CORBA::is_nil(bitParticipant_.in())) {
00525       ACE_ERROR_RETURN((LM_ERROR,
00526                         ACE_TEXT("(%P|%t) ERROR: ")
00527                         ACE_TEXT("Nil DomainParticipant in ")
00528                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
00529                        1);
00530     }
00531 
00532 
00533     int transportResult = init_built_in_topics_transport();
00534 
00535     if (0 != transportResult) {
00536       return transportResult;
00537     }
00538 
00539     int topicsResult = init_built_in_topics_topics();
00540 
00541     if (0 != topicsResult) {
00542       return topicsResult;
00543     }
00544 
00545     int datawritersResult = init_built_in_topics_datawriters(federated);
00546 
00547     if (0 != datawritersResult) {
00548       return datawritersResult;
00549     }
00550 
00551   } catch (const CORBA::Exception& ex) {
00552     ex._tao_print_exception("ERROR: Exception caught in main.cpp:");
00553     return 1;
00554   }
00555 
00556   // enable the Built-In Topics
00557   useBIT_ = true;
00558   return 0;
00559 }

int DCPS_IR_Domain::init_built_in_topics_datawriters ( bool  federated  )  [private]

Definition at line 737 of file DCPS_IR_Domain.cpp.

References bitParticipantDataWriter_, bitParticipantTopic_, bitPublicationDataWriter_, bitPublicationTopic_, bitPublisher_, bitSubscriptionDataWriter_, bitSubscriptionTopic_, bitTopicDataWriter_, bitTopicTopic_, OpenDDS::DCPS::DEFAULT_STATUS_MASK, DDS::DataWriterQos::durability, DDS::DataWriterQos::liveliness, TheServiceParticipant, and DDS::TRANSIENT_LOCAL_DURABILITY_QOS.

Referenced by init_built_in_topics().

00738 {
00739 
00740   try {
00741     DDS::DataWriter_var datawriter;
00742 
00743     DDS::DataWriterQos participantWriterQos;
00744     bitPublisher_->get_default_datawriter_qos(participantWriterQos);
00745     participantWriterQos.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
00746 
00747     if (federated) {
00748       participantWriterQos.liveliness.lease_duration.nanosec = 0;
00749       participantWriterQos.liveliness.lease_duration.sec
00750       = TheServiceParticipant->federation_liveliness();
00751     }
00752 
00753     // Participant DataWriter
00754     datawriter =
00755       bitPublisher_->create_datawriter(bitParticipantTopic_.in(),
00756                                        participantWriterQos,
00757                                        DDS::DataWriterListener::_nil(),
00758                                        OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00759 
00760     bitParticipantDataWriter_ =
00761       DDS::ParticipantBuiltinTopicDataDataWriter::_narrow(datawriter.in());
00762 
00763     if (CORBA::is_nil(bitParticipantDataWriter_.in())) {
00764       ACE_ERROR_RETURN((LM_ERROR,
00765                         ACE_TEXT("(%P|%t) ERROR: ")
00766                         ACE_TEXT("Nil DomainParticipant DataWriter from ")
00767                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
00768                        1);
00769     }
00770 
00771     DDS::DataWriterQos dw_qos;
00772     bitPublisher_->get_default_datawriter_qos(dw_qos);
00773     dw_qos.durability.kind = DDS::TRANSIENT_LOCAL_DURABILITY_QOS;
00774 
00775     // Topic DataWriter
00776     datawriter =
00777       bitPublisher_->create_datawriter(bitTopicTopic_.in(),
00778                                        dw_qos,
00779                                        DDS::DataWriterListener::_nil(),
00780                                        OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00781 
00782     bitTopicDataWriter_ =
00783       DDS::TopicBuiltinTopicDataDataWriter::_narrow(datawriter.in());
00784 
00785     if (CORBA::is_nil(bitTopicDataWriter_.in())) {
00786       ACE_ERROR_RETURN((LM_ERROR,
00787                         ACE_TEXT("(%P|%t) ERROR: ")
00788                         ACE_TEXT("Nil Topic DataWriter from ")
00789                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
00790                        1);
00791     }
00792 
00793     // Subscription DataWriter
00794     datawriter =
00795       bitPublisher_->create_datawriter(bitSubscriptionTopic_.in(),
00796                                        dw_qos,
00797                                        DDS::DataWriterListener::_nil(),
00798                                        OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00799 
00800     bitSubscriptionDataWriter_ =
00801       DDS::SubscriptionBuiltinTopicDataDataWriter::_narrow(
00802         datawriter.in());
00803 
00804     if (CORBA::is_nil(bitSubscriptionDataWriter_.in())) {
00805       ACE_ERROR_RETURN((LM_ERROR,
00806                         ACE_TEXT("(%P|%t) ERROR: ")
00807                         ACE_TEXT("Nil Subscription DataWriter from ")
00808                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
00809                        1);
00810     }
00811 
00812     // Publication DataWriter
00813     datawriter =
00814       bitPublisher_->create_datawriter(bitPublicationTopic_.in(),
00815                                        dw_qos,
00816                                        DDS::DataWriterListener::_nil(),
00817                                        OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00818 
00819     bitPublicationDataWriter_ =
00820       DDS::PublicationBuiltinTopicDataDataWriter::_narrow(datawriter.in());
00821 
00822     if (CORBA::is_nil(bitPublicationDataWriter_.in())) {
00823       ACE_ERROR_RETURN((LM_ERROR,
00824                         ACE_TEXT("(%P|%t) ERROR: ")
00825                         ACE_TEXT("Nil Publication DataWriter from ")
00826                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
00827                        1);
00828     }
00829 
00830   } catch (const CORBA::Exception& ex) {
00831     ex._tao_print_exception(
00832       "ERROR: Exception caught in DCPS_IR_Domain::init_built_in_topics_datawriters:");
00833     return 1;
00834   }
00835   return 0;
00836 }

int DCPS_IR_Domain::init_built_in_topics_topics (  )  [private]

work of initializing the built in topics is done in these private methods. They were broken up for readability.

Definition at line 597 of file DCPS_IR_Domain.cpp.

References bitParticipant_, bitParticipantTopic_, bitPublicationTopic_, bitSubscriptionTopic_, bitTopicTopic_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE, OpenDDS::DCPS::DEFAULT_STATUS_MASK, and DDS::RETCODE_OK.

Referenced by init_built_in_topics().

00598 {
00599 #if !defined (DDS_HAS_MINIMUM_BIT)
00600 
00601   try {
00602     DDS::TopicQos topic_qos;
00603     bitParticipant_->get_default_topic_qos(topic_qos);
00604 
00605     // Participant topic
00606     DDS::ParticipantBuiltinTopicDataTypeSupport_var
00607     participantTypeSupport(new DDS::ParticipantBuiltinTopicDataTypeSupportImpl());
00608 
00609     if (DDS::RETCODE_OK !=
00610         participantTypeSupport->register_type(bitParticipant_.in(),
00611                                               OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE)) {
00612       ACE_ERROR((LM_ERROR,
00613                  ACE_TEXT("(%P|%t) ERROR: Failed to register the ParticipantBuiltinTopicDataTypeSupport.")));
00614       return 1;
00615     }
00616 
00617     bitParticipantTopic_ =
00618       bitParticipant_->create_topic(OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC,
00619                                     OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE,
00620                                     topic_qos,
00621                                     DDS::TopicListener::_nil(),
00622                                     OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00623 
00624     if (CORBA::is_nil(bitParticipantTopic_.in())) {
00625       ACE_ERROR_RETURN((LM_ERROR,
00626                         ACE_TEXT("(%P|%t) ERROR: ")
00627                         ACE_TEXT("Nil %C Topic from ")
00628                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
00629                         OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC),
00630                        1);
00631     }
00632 
00633     // Topic topic
00634     DDS::TopicBuiltinTopicDataTypeSupport_var
00635     topicTypeSupport(new DDS::TopicBuiltinTopicDataTypeSupportImpl());
00636 
00637     if (DDS::RETCODE_OK !=
00638         topicTypeSupport->register_type(bitParticipant_.in(),
00639                                         OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE)) {
00640       ACE_ERROR((LM_ERROR,
00641                  ACE_TEXT("(%P|%t) ERROR: Failed to register the TopicBuiltinTopicDataTypeSupport.")));
00642       return 1;
00643     }
00644 
00645     bitTopicTopic_ =
00646       bitParticipant_->create_topic(OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC,
00647                                     OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE,
00648                                     topic_qos,
00649                                     DDS::TopicListener::_nil(),
00650                                     OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00651 
00652     if (CORBA::is_nil(bitTopicTopic_.in())) {
00653       ACE_ERROR_RETURN((LM_ERROR,
00654                         ACE_TEXT("(%P|%t) ERROR: ")
00655                         ACE_TEXT("Nil %C Topic from ")
00656                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
00657                         OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC),
00658                        1);
00659     }
00660 
00661     // Subscription topic
00662     DDS::SubscriptionBuiltinTopicDataTypeSupport_var
00663     subscriptionTypeSupport(new DDS::SubscriptionBuiltinTopicDataTypeSupportImpl());
00664 
00665     if (DDS::RETCODE_OK !=
00666         subscriptionTypeSupport->register_type(bitParticipant_.in(),
00667                                                OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE)) {
00668       ACE_ERROR((LM_ERROR,
00669                  ACE_TEXT("(%P|%t) ERROR: Failed to register the SubscriptionBuiltinTopicDataTypeSupport.")));
00670       return 1;
00671     }
00672 
00673     bitSubscriptionTopic_ =
00674       bitParticipant_->create_topic(OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC,
00675                                     OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE,
00676                                     topic_qos,
00677                                     DDS::TopicListener::_nil(),
00678                                     OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00679 
00680     if (CORBA::is_nil(bitSubscriptionTopic_.in())) {
00681       ACE_ERROR_RETURN((LM_ERROR,
00682                         ACE_TEXT("(%P|%t) ERROR: ")
00683                         ACE_TEXT("Nil %C Topic from ")
00684                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
00685                         OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC),
00686                        1);
00687     }
00688 
00689     // Publication topic
00690     DDS::PublicationBuiltinTopicDataTypeSupport_var
00691     publicationTypeSupport(new DDS::PublicationBuiltinTopicDataTypeSupportImpl());
00692 
00693     if (DDS::RETCODE_OK !=
00694         publicationTypeSupport->register_type(bitParticipant_.in(),
00695                                               OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE)) {
00696       ACE_ERROR((LM_ERROR,
00697                  ACE_TEXT("(%P|%t) ERROR: Failed to register the PublicationBuiltinTopicDataTypeSupport.")));
00698       return 1;
00699     }
00700 
00701     bitPublicationTopic_ =
00702       bitParticipant_->create_topic(OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC,
00703                                     OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE,
00704                                     topic_qos,
00705                                     DDS::TopicListener::_nil(),
00706                                     OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00707 
00708     if (CORBA::is_nil(bitPublicationTopic_.in())) {
00709       ACE_ERROR_RETURN((LM_ERROR,
00710                         ACE_TEXT("(%P|%t) ERROR: ")
00711                         ACE_TEXT("Nil %C Topic from ")
00712                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n"),
00713                         OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC),
00714                        1);
00715     }
00716 
00717   } catch (const CORBA::Exception& ex) {
00718     ex._tao_print_exception(
00719       "ERROR: Exception caught in DCPS_IR_Domain::init_built_in_topics_topics:");
00720     return 1;
00721   }
00722 
00723   return 0;
00724 
00725 #else
00726 
00727   return 1;
00728 #endif // !defined (DDS_HAS_MINIMUM_BIT)
00729 }

int DCPS_IR_Domain::init_built_in_topics_transport (  )  [private]

Definition at line 839 of file DCPS_IR_Domain.cpp.

References bitParticipant_, bitPublisher_, OpenDDS::DCPS::TransportRegistry::DEFAULT_INST_PREFIX, OpenDDS::DCPS::DEFAULT_STATUS_MASK, OpenDDS::DCPS::TransportRegistry::instance(), PUBLISHER_QOS_DEFAULT, and transportConfig_.

Referenced by init_built_in_topics().

00840 {
00841 #if !defined (DDS_HAS_MINIMUM_BIT)
00842 
00843   try {
00844     std::string config_name =
00845       OpenDDS::DCPS::TransportRegistry::DEFAULT_INST_PREFIX
00846       + std::string("InfoRepoBITTransportConfig");
00847     transportConfig_ =
00848       OpenDDS::DCPS::TransportRegistry::instance()->get_config(config_name);
00849 
00850     // Create the Publisher
00851     bitPublisher_ =
00852       bitParticipant_->create_publisher(PUBLISHER_QOS_DEFAULT,
00853                                         DDS::PublisherListener::_nil(),
00854                                         OpenDDS::DCPS::DEFAULT_STATUS_MASK);
00855 
00856     if (CORBA::is_nil(bitPublisher_.in())) {
00857       ACE_ERROR_RETURN((LM_ERROR,
00858                         ACE_TEXT("(%P|%t) ERROR: ")
00859                         ACE_TEXT("Nil Publisher from ")
00860                         ACE_TEXT("DCPS_IR_Domain::init_built_in_topics.\n")),
00861                        1);
00862     }
00863 
00864     // Attach the Publisher with the TransportImpl.
00865     OpenDDS::DCPS::TransportRegistry::instance()->bind_config(transportConfig_,
00866                                                               bitPublisher_.in());
00867 
00868   } catch (const CORBA::Exception& ex) {
00869     ex._tao_print_exception(
00870       "ERROR: Exception caught in DCPS_IR_Domain::init_built_in_topics_transport:");
00871     return 1;
00872   }
00873 
00874   return 0;
00875 #else
00876 
00877   return 1;
00878 #endif // !defined (DDS_HAS_MINIMUM_BIT)
00879 }

void DCPS_IR_Domain::last_participant_key ( long  key  ) 

Definition at line 1027 of file DCPS_IR_Domain.cpp.

References RepoIdGenerator::last(), and participantIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

01028 {
01029   this->participantIdGenerator_.last(key);
01030 }

DCPS_IR_Participant * DCPS_IR_Domain::participant ( const OpenDDS::DCPS::RepoId id  )  const

Find the participant with the id.

Definition at line 77 of file DCPS_IR_Domain.cpp.

References participants_.

Referenced by add_dead_participant(), TAO_DDS_DCPSInfo_i::add_domain_participant(), add_participant(), TAO_DDS_DCPSInfo_i::add_subscription(), dispose_participant_bit(), publish_participant_bit(), and remove_participant().

00078 {
00079   DCPS_IR_Participant_Map::const_iterator where
00080   = this->participants_.find(id);
00081 
00082   if (where != this->participants_.end()) {
00083     return where->second;
00084 
00085   } else {
00086     return 0;
00087   }
00088 }

const DCPS_IR_Participant_Map & DCPS_IR_Domain::participants (  )  const

Expose a readable reference to the participant map.

Definition at line 71 of file DCPS_IR_Domain.cpp.

References participants_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

00072 {
00073   return this->participants_;
00074 }

void DCPS_IR_Domain::publish_participant_bit ( DCPS_IR_Participant participant  ) 

Publish the Built-In Topic information.

Definition at line 1043 of file DCPS_IR_Domain.cpp.

References bitParticipantDataWriter_, OpenDDS::DCPS::DCPS_debug_level, get_BuiltinTopicKey(), DCPS_IR_Participant::get_id(), DCPS_IR_Participant::get_qos(), DCPS_IR_Participant::is_bit(), DDS::ParticipantBuiltinTopicData::key, participant(), DCPS_IR_Participant::set_bit_status(), DCPS_IR_Participant::set_handle(), useBIT_, and DDS::ParticipantBuiltinTopicData::user_data.

Referenced by add_participant(), and DCPS_IR_Participant::set_qos().

01044 {
01045 #if !defined (DDS_HAS_MINIMUM_BIT)
01046 
01047   if (useBIT_) {
01048     if (!participant->is_bit()) {
01049       try {
01050         const DDS::DomainParticipantQos* participantQos = participant->get_qos();
01051 
01052         DDS::ParticipantBuiltinTopicData data;
01053         get_BuiltinTopicKey(data.key, participant->get_id());
01054         data.user_data = participantQos->user_data;
01055 
01056         DDS::InstanceHandle_t handle
01057         = bitParticipantDataWriter_->register_instance(data);
01058 
01059         participant->set_handle(handle);
01060 
01061         if (OpenDDS::DCPS::DCPS_debug_level > 0) {
01062           ACE_DEBUG((LM_DEBUG,
01063                      "(%P|%t) DCPS_IR_Domain::publish_participant_bit: [ %d, 0x%x, 0x%x], handle %d.\n",
01064                      data.key.value[0], data.key.value[1], data.key.value[2], handle));
01065         }
01066 
01067         bitParticipantDataWriter_->write(data,
01068                                          handle);
01069 
01070       } catch (const CORBA::Exception& ex) {
01071         ex._tao_print_exception(
01072           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_participant_bit:");
01073       }
01074 
01075     } else {
01076       participant->set_bit_status(1);
01077     }
01078 
01079   }
01080 
01081 #else
01082   ACE_UNUSED_ARG(participant);
01083 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01084 }

void DCPS_IR_Domain::publish_publication_bit ( DCPS_IR_Publication publication  ) 

Definition at line 1226 of file DCPS_IR_Domain.cpp.

References bitPublicationDataWriter_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE, OpenDDS::DCPS::DCPS_debug_level, DDS::DataWriterQos::deadline, DDS::PublicationBuiltinTopicData::deadline, DDS::DataWriterQos::destination_order, DDS::PublicationBuiltinTopicData::destination_order, DDS::DataWriterQos::durability, DDS::PublicationBuiltinTopicData::durability, DDS::DataWriterQos::durability_service, DDS::PublicationBuiltinTopicData::durability_service, get_BuiltinTopicKey(), DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Publication::get_datawriter_qos(), DCPS_IR_Publication::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Publication::get_participant_id(), DCPS_IR_Publication::get_publisher_qos(), DCPS_IR_Publication::get_topic(), DCPS_IR_Publication::get_topic_description(), DCPS_IR_Topic::get_topic_qos(), DDS::PublisherQos::group_data, DDS::PublicationBuiltinTopicData::group_data, DDS::PublicationBuiltinTopicData::key, DDS::DataWriterQos::latency_budget, DDS::PublicationBuiltinTopicData::latency_budget, DDS::DataWriterQos::lifespan, DDS::PublicationBuiltinTopicData::lifespan, DDS::DataWriterQos::liveliness, DDS::PublicationBuiltinTopicData::liveliness, DDS::DataWriterQos::ownership, DDS::PublicationBuiltinTopicData::ownership, DDS::DataWriterQos::ownership_strength, DDS::PublicationBuiltinTopicData::ownership_strength, DDS::PublicationBuiltinTopicData::participant_key, DDS::PublisherQos::partition, DDS::PublicationBuiltinTopicData::partition, DDS::PublisherQos::presentation, DDS::PublicationBuiltinTopicData::presentation, DDS::DataWriterQos::reliability, DDS::PublicationBuiltinTopicData::reliability, DDS::RETCODE_OK, DCPS_IR_Publication::set_bit_status(), DCPS_IR_Publication::set_handle(), DDS::TopicQos::topic_data, DDS::PublicationBuiltinTopicData::topic_data, DDS::PublicationBuiltinTopicData::topic_name, DDS::PublicationBuiltinTopicData::type_name, useBIT_, DDS::DataWriterQos::user_data, and DDS::PublicationBuiltinTopicData::user_data.

Referenced by DCPS_IR_Topic::add_publication_reference(), DCPS_IR_Publication::set_qos(), and DCPS_IR_Topic::set_topic_qos().

01227 {
01228 #if !defined (DDS_HAS_MINIMUM_BIT)
01229 
01230   if (useBIT_) {
01231 
01232     DCPS_IR_Topic_Description* desc =
01233       publication->get_topic_description();
01234 
01235     const char* dataTypeName = desc->get_dataTypeName();
01236 
01237     bool isNotBIT =
01238       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE) &&
01239       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE) &&
01240       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE) &&
01241       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE);
01242 
01243     if (isNotBIT) {
01244       try {
01245         const DDS::DataWriterQos* writerQos = publication->get_datawriter_qos();
01246         const DDS::PublisherQos* publisherQos = publication->get_publisher_qos();
01247 
01248         DCPS_IR_Topic* topic = publication->get_topic();
01249         const DDS::TopicQos* topicQos = topic->get_topic_qos();
01250 
01251         DDS::PublicationBuiltinTopicData data;
01252         get_BuiltinTopicKey(data.key, publication->get_id());
01253         get_BuiltinTopicKey(data.participant_key,
01254                             publication->get_participant_id());
01255         data.topic_name = desc->get_name();
01256         data.type_name = desc->get_dataTypeName();
01257         data.durability = writerQos->durability;
01258         data.durability_service = writerQos->durability_service;
01259         data.deadline = writerQos->deadline;
01260         data.latency_budget = writerQos->latency_budget;
01261         data.liveliness = writerQos->liveliness;
01262         data.reliability = writerQos->reliability;
01263         data.lifespan = writerQos->lifespan;
01264         data.user_data = writerQos->user_data;
01265         data.ownership = writerQos->ownership;
01266         data.ownership_strength = writerQos->ownership_strength;
01267         data.destination_order = writerQos->destination_order;
01268         data.presentation = publisherQos->presentation;
01269         data.partition = publisherQos->partition;
01270         data.topic_data = topicQos->topic_data;
01271         data.group_data = publisherQos->group_data;
01272 
01273         DDS::InstanceHandle_t handle
01274         = bitPublicationDataWriter_->register_instance(data);
01275 
01276         publication->set_handle(handle);
01277 
01278         if (OpenDDS::DCPS::DCPS_debug_level > 0) {
01279           ACE_DEBUG((LM_DEBUG,
01280                      "(%P|%t) DCPS_IR_Domain::publish_publication_bit: [ %d, 0x%x, 0x%x], handle %d.\n",
01281                      data.key.value[0], data.key.value[1], data.key.value[2], handle));
01282         }
01283 
01284         DDS::ReturnCode_t status = bitPublicationDataWriter_->write(data, handle);
01285         if (status != DDS::RETCODE_OK) {
01286           ACE_ERROR((LM_ERROR,
01287                        "(%P|%t) DCPS_IR_Domain::publish_publication_bit: write() status of %d\n",
01288                        status));
01289         }
01290 
01291       } catch (const CORBA::Exception& ex) {
01292         ex._tao_print_exception(
01293           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_publication_bit:");
01294       }
01295 
01296     } else {
01297       publication->set_bit_status(1);
01298     }
01299   }
01300 
01301 #else
01302   ACE_UNUSED_ARG(publication);
01303 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01304 
01305 }

void DCPS_IR_Domain::publish_subscription_bit ( DCPS_IR_Subscription subscription  ) 

Definition at line 1151 of file DCPS_IR_Domain.cpp.

References bitSubscriptionDataWriter_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE, OpenDDS::DCPS::DCPS_debug_level, DDS::DataReaderQos::deadline, DDS::SubscriptionBuiltinTopicData::deadline, DDS::DataReaderQos::destination_order, DDS::SubscriptionBuiltinTopicData::destination_order, DDS::DataReaderQos::durability, DDS::SubscriptionBuiltinTopicData::durability, get_BuiltinTopicKey(), DCPS_IR_Subscription::get_datareader_qos(), DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Subscription::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Subscription::get_participant_id(), DCPS_IR_Subscription::get_subscriber_qos(), DCPS_IR_Subscription::get_topic(), DCPS_IR_Subscription::get_topic_description(), DCPS_IR_Topic::get_topic_qos(), DDS::SubscriberQos::group_data, DDS::SubscriptionBuiltinTopicData::group_data, DDS::SubscriptionBuiltinTopicData::key, DDS::DataReaderQos::latency_budget, DDS::SubscriptionBuiltinTopicData::latency_budget, DDS::DataReaderQos::liveliness, DDS::SubscriptionBuiltinTopicData::liveliness, DDS::DataReaderQos::ownership, DDS::SubscriptionBuiltinTopicData::ownership, DDS::SubscriptionBuiltinTopicData::participant_key, DDS::SubscriberQos::partition, DDS::SubscriptionBuiltinTopicData::partition, DDS::SubscriberQos::presentation, DDS::SubscriptionBuiltinTopicData::presentation, DDS::DataReaderQos::reliability, DDS::SubscriptionBuiltinTopicData::reliability, DCPS_IR_Subscription::set_bit_status(), DCPS_IR_Subscription::set_handle(), DDS::DataReaderQos::time_based_filter, DDS::SubscriptionBuiltinTopicData::time_based_filter, DDS::TopicQos::topic_data, DDS::SubscriptionBuiltinTopicData::topic_data, DDS::SubscriptionBuiltinTopicData::topic_name, DDS::SubscriptionBuiltinTopicData::type_name, useBIT_, DDS::DataReaderQos::user_data, and DDS::SubscriptionBuiltinTopicData::user_data.

Referenced by DCPS_IR_Topic_Description::add_subscription_reference(), DCPS_IR_Subscription::set_qos(), and DCPS_IR_Topic::set_topic_qos().

01152 {
01153 
01154 #if !defined (DDS_HAS_MINIMUM_BIT)
01155 
01156   if (useBIT_) {
01157     DCPS_IR_Topic_Description* desc =
01158       subscription->get_topic_description();
01159 
01160     const char* dataTypeName = desc->get_dataTypeName();
01161 
01162     bool isNotBIT =
01163       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE) &&
01164       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE) &&
01165       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE) &&
01166       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE);
01167 
01168     if (isNotBIT) {
01169       try {
01170         const DDS::DataReaderQos* readerQos = subscription->get_datareader_qos();
01171         const DDS::SubscriberQos* publisherQos = subscription->get_subscriber_qos();
01172 
01173         DCPS_IR_Topic* topic = subscription->get_topic();
01174         const DDS::TopicQos* topicQos = topic->get_topic_qos();
01175 
01176         DDS::SubscriptionBuiltinTopicData data;
01177         get_BuiltinTopicKey(data.key, subscription->get_id());
01178         get_BuiltinTopicKey(data.participant_key,
01179                             subscription->get_participant_id());
01180         data.topic_name = desc->get_name();
01181         data.type_name = desc->get_dataTypeName();
01182         data.durability = readerQos->durability;
01183         data.deadline = readerQos->deadline;
01184         data.latency_budget = readerQos->latency_budget;
01185         data.liveliness = readerQos->liveliness;
01186         data.reliability = readerQos->reliability;
01187         data.ownership = readerQos->ownership;
01188         data.destination_order = readerQos->destination_order;
01189         data.user_data = readerQos->user_data;
01190         data.time_based_filter = readerQos->time_based_filter;
01191         data.presentation = publisherQos->presentation;
01192         data.partition = publisherQos->partition;
01193         data.topic_data = topicQos->topic_data;
01194         data.group_data = publisherQos->group_data;
01195 
01196         DDS::InstanceHandle_t handle
01197         = bitSubscriptionDataWriter_->register_instance(data);
01198 
01199         subscription->set_handle(handle);
01200 
01201         if (OpenDDS::DCPS::DCPS_debug_level > 0) {
01202           ACE_DEBUG((LM_DEBUG,
01203                      "(%P|%t) DCPS_IR_Domain::publish_subscription_bit: [ %d, 0x%x, 0x%x], handle %d.\n",
01204                      data.key.value[0], data.key.value[1], data.key.value[2], handle));
01205         }
01206 
01207         bitSubscriptionDataWriter_->write(data,
01208                                           handle);
01209 
01210       } catch (const CORBA::Exception& ex) {
01211         ex._tao_print_exception(
01212           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_subscription_bit:");
01213       }
01214 
01215     } else {
01216       subscription->set_bit_status(1);
01217     }
01218   }
01219 
01220 #else
01221   ACE_UNUSED_ARG(subscription);
01222 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01223 
01224 }

void DCPS_IR_Domain::publish_topic_bit ( DCPS_IR_Topic topic  ) 

Definition at line 1086 of file DCPS_IR_Domain.cpp.

References bitTopicDataWriter_, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE, OpenDDS::DCPS::DCPS_debug_level, DDS::TopicQos::deadline, DDS::TopicBuiltinTopicData::deadline, DDS::TopicQos::destination_order, DDS::TopicBuiltinTopicData::destination_order, DDS::TopicQos::durability, DDS::TopicBuiltinTopicData::durability, DDS::TopicQos::durability_service, DDS::TopicBuiltinTopicData::durability_service, get_BuiltinTopicKey(), DCPS_IR_Topic_Description::get_dataTypeName(), DCPS_IR_Topic::get_id(), DCPS_IR_Topic_Description::get_name(), DCPS_IR_Topic::get_topic_description(), DCPS_IR_Topic::get_topic_qos(), DDS::TopicQos::history, DDS::TopicBuiltinTopicData::history, DDS::TopicBuiltinTopicData::key, DDS::TopicQos::latency_budget, DDS::TopicBuiltinTopicData::latency_budget, DDS::TopicQos::lifespan, DDS::TopicBuiltinTopicData::lifespan, DDS::TopicQos::liveliness, DDS::TopicBuiltinTopicData::liveliness, DDS::TopicBuiltinTopicData::name, DDS::TopicQos::ownership, DDS::TopicBuiltinTopicData::ownership, DDS::TopicQos::reliability, DDS::TopicBuiltinTopicData::reliability, DDS::TopicQos::resource_limits, DDS::TopicBuiltinTopicData::resource_limits, DCPS_IR_Topic::set_bit_status(), DCPS_IR_Topic::set_handle(), DDS::TopicQos::topic_data, DDS::TopicBuiltinTopicData::topic_data, DDS::TopicQos::transport_priority, DDS::TopicBuiltinTopicData::transport_priority, DDS::TopicBuiltinTopicData::type_name, and useBIT_.

Referenced by add_topic_i(), and DCPS_IR_Topic::set_topic_qos().

01087 {
01088 #if !defined (DDS_HAS_MINIMUM_BIT)
01089 
01090   if (useBIT_) {
01091     DCPS_IR_Topic_Description* desc =
01092       topic->get_topic_description();
01093     const char* dataTypeName = desc->get_dataTypeName();
01094 
01095     bool isNotBIT =
01096       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PARTICIPANT_TOPIC_TYPE) &&
01097       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_TOPIC_TOPIC_TYPE) &&
01098       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_SUBSCRIPTION_TOPIC_TYPE) &&
01099       ACE_OS::strcmp(dataTypeName, OpenDDS::DCPS::BUILT_IN_PUBLICATION_TOPIC_TYPE);
01100 
01101     if (isNotBIT) {
01102       try {
01103         const DDS::TopicQos* topicQos = topic->get_topic_qos();
01104 
01105         DDS::TopicBuiltinTopicData data;
01106         get_BuiltinTopicKey(data.key, topic->get_id());
01107         data.name = desc->get_name();
01108         data.type_name = desc->get_dataTypeName();
01109         data.durability = topicQos->durability;
01110         data.durability_service = topicQos->durability_service;
01111         data.deadline = topicQos->deadline;
01112         data.latency_budget = topicQos->latency_budget;
01113         data.liveliness = topicQos->liveliness;
01114         data.reliability = topicQos->reliability;
01115         data.transport_priority = topicQos->transport_priority;
01116         data.lifespan = topicQos->lifespan;
01117         data.destination_order = topicQos->destination_order;
01118         data.history = topicQos->history;
01119         data.resource_limits = topicQos->resource_limits;
01120         data.ownership = topicQos->ownership;
01121         data.topic_data = topicQos->topic_data;
01122 
01123         DDS::InstanceHandle_t handle =
01124           bitTopicDataWriter_->register_instance(data);
01125 
01126         topic->set_handle(handle);
01127 
01128         if (OpenDDS::DCPS::DCPS_debug_level > 0) {
01129           ACE_DEBUG((LM_DEBUG,
01130                      "(%P|%t) DCPS_IR_Domain::publish_topic_bit: [ %d, 0x%x, 0x%x], handle %d.\n",
01131                      data.key.value[0], data.key.value[1], data.key.value[2], handle));
01132         }
01133 
01134         bitTopicDataWriter_->write(data, handle);
01135 
01136       } catch (const CORBA::Exception& ex) {
01137         ex._tao_print_exception(
01138           "(%P|%t) ERROR: Exception caught in DCPS_IR_Domain::publish_topic_bit:");
01139       }
01140 
01141     } else {
01142       topic->set_bit_status(1);
01143     }
01144   }
01145 
01146 #else
01147   ACE_UNUSED_ARG(topic);
01148 #endif // !defined (DDS_HAS_MINIMUM_BIT)
01149 }

int DCPS_IR_Domain::reassociate_built_in_topic_pubs (  ) 

Reassociate the Built-In Topic datawriters This needs to be called after reincarnating from persistence and before the run begins Returns 0 (zero) if successful

Definition at line 568 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::DCPS_debug_level, id_, and participants_.

00569 {
00570   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00571     ACE_DEBUG((LM_DEBUG,
00572                ACE_TEXT("(%P|%t) DCPS_IR_Domain::reassociate_built_in_topic_pubs() ")
00573                ACE_TEXT(" Re-associating Built In Topics for domain %d\n"),
00574                id_));
00575   }
00576 
00577   DCPS_IR_Participant_Map::iterator participantIter = participants_.begin();
00578   DCPS_IR_Participant_Map::iterator end = participants_.end();
00579   while (participantIter != end
00580          && !participantIter->second->isBitPublisher() ) {
00581     participantIter++;
00582   }
00583 
00584   if (participantIter != end) {
00585     for (DCPS_IR_Topic_Map::const_iterator topicIter
00586            = participantIter->second->topics().begin();
00587            topicIter != participantIter->second->topics().end();
00588            ++topicIter) {
00589       topicIter->second->reassociate_all_publications();
00590     }
00591   }
00592 
00593   return 0;
00594 }

void DCPS_IR_Domain::remove_dead_participants (  ) 

Remove any participants currently marked as dead.

Definition at line 987 of file DCPS_IR_Domain.cpp.

References deadParticipants_, and remove_participant().

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

00988 {
00989   if (0 < deadParticipants_.size()) {
00990     DCPS_IR_Participant* dead = 0;
00991     DCPS_IR_Participant_Set::ITERATOR iter = deadParticipants_.begin();
00992 
00993     // repeat end() due to the value possibly changing from additional dead
00994     // participants during notifications
00995     while (iter != deadParticipants_.end()) {
00996       dead = *iter;
00997       ++iter;
00998 
00999       OpenDDS::DCPS::RepoIdConverter converter(dead->get_id());
01000       ACE_ERROR((LM_ERROR,
01001                  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::remove_dead_participants () ")
01002                  ACE_TEXT("Removing dead participant 0x%x id %C\n"),
01003                  dead,
01004                  std::string(converter).c_str()));
01005       deadParticipants_.remove(dead);
01006 
01007       dead->set_alive(0);
01008 
01009       CORBA::Boolean notify_lost = 1;
01010       remove_participant(dead->get_id(), notify_lost);
01011     }
01012   }
01013 }

int DCPS_IR_Domain::remove_participant ( const OpenDDS::DCPS::RepoId particpantId,
CORBA::Boolean  notify_lost 
)

Remove the particpant The participant has been deleted if returns successful. Returns 0 if successful. The notify_lost parameter is passed to the remove_associations() See the comments of remove_associations() in DataWriterRemote.idl or DataReaderRemote.idl.

Definition at line 130 of file DCPS_IR_Domain.cpp.

References OpenDDS::DCPS::DCPS_debug_level, dispose_participant_bit(), id_, participant(), participants_, and DCPS_IR_Participant::remove_all_dependents().

Referenced by remove_dead_participants().

00132 {
00133   DCPS_IR_Participant_Map::iterator where
00134   = this->participants_.find(participantId);
00135 
00136   if (where != this->participants_.end()) {
00137     // Extract the participant from the map.
00138     DCPS_IR_Participant* participant = where->second;
00139 
00140     // make sure the participant has cleaned up all publications,
00141     // subscriptions, and any topic references
00142     participant->remove_all_dependents(notify_lost);
00143 
00144     // Then remove it from the map.
00145     this->participants_.erase(where);
00146 
00147     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00148       OpenDDS::DCPS::RepoIdConverter converter(participantId);
00149       ACE_DEBUG((LM_DEBUG,
00150                  ACE_TEXT("(%P|%t) DCPS_IR_Domain::remove_participant: ")
00151                  ACE_TEXT("removed participant %C at 0x%x from domain %d.\n"),
00152                  std::string(converter).c_str(),
00153                  participant,
00154                  id_));
00155     }
00156 
00157     dispose_participant_bit(participant);
00158     delete participant;
00159     return 0;
00160 
00161   } else {
00162     OpenDDS::DCPS::RepoIdConverter converter(participantId);
00163     ACE_ERROR((LM_ERROR,
00164                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::remove_participant: ")
00165                ACE_TEXT("unable to find participant %C in domain %d.\n"),
00166                std::string(converter).c_str(),
00167                id_));
00168     return 1;
00169   }
00170 }

OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::remove_topic ( DCPS_IR_Participant part,
DCPS_IR_Topic *&  topic 
)

Remove the topic The topic has been deleted if returns successful Returns OpenDDS::DCPS::REMOVED if successful

Definition at line 394 of file DCPS_IR_Domain.cpp.

References dispose_topic_bit(), DCPS_IR_Participant::get_id(), DCPS_IR_Topic::get_id(), DCPS_IR_Topic_Description::get_number_topics(), DCPS_IR_Topic::get_topic_description(), id_, DCPS_IR_Topic::release(), DCPS_IR_Topic_Description::remove_topic(), remove_topic_description(), DCPS_IR_Participant::remove_topic_reference(), and OpenDDS::DCPS::REMOVED.

Referenced by DCPS_IR_Participant::remove_all_dependents().

00396 {
00397   DCPS_IR_Topic_Description* description = topic->get_topic_description();
00398 
00399   if (description->remove_topic(topic) != 0) {
00400     // An unknown error means that the description may still
00401     // have the topic in its topic set.  We can't remove it.
00402     // The system is an inconsistent state!
00403     throw OpenDDS::DCPS::Invalid_Topic();
00404   }
00405 
00406   if (description->get_number_topics() == 0) {
00407     // Remove the topic description
00408     if (remove_topic_description(description) != 0) {
00409       // An unknown error means that the description may still
00410       // have the topic in its topic set.
00411       ACE_ERROR((LM_ERROR,
00412                  ACE_TEXT("(%P|%t) ERROR: Topic Description %C %C  ")
00413                  ACE_TEXT("was not correctly removed from Domain %d"),
00414                  description->get_name(),
00415                  description->get_dataTypeName(),
00416                  id_));
00417 
00418     } else {
00419       delete description;
00420       description = 0;
00421     }
00422   }
00423 
00424   // description variable is invalid after this point
00425 
00426   if (part->remove_topic_reference(topic->get_id(), topic) != 0) {
00427     OpenDDS::DCPS::RepoIdConverter part_converter(part->get_id());
00428     OpenDDS::DCPS::RepoIdConverter topic_converter(topic->get_id());
00429     ACE_ERROR((LM_ERROR,
00430                ACE_TEXT("(%P|%t) ERROR: Domain %d Topic %C ")
00431                ACE_TEXT("was not correctly removed from Participant %C"),
00432                id_,
00433                std::string(topic_converter).c_str(),
00434                std::string(part_converter).c_str()));
00435   }
00436 
00437   // Dispose the BIT information
00438   dispose_topic_bit(topic);
00439 
00440   topic->release(true);
00441   topic = 0;
00442   return OpenDDS::DCPS::REMOVED;
00443 }

int DCPS_IR_Domain::remove_topic_description ( DCPS_IR_Topic_Description *&  desc  )  [private]

Caller is given ownership of the topic description and any memory that it has ownership of if returns successful

: Is this a leak? Who owns the contained description?

Definition at line 961 of file DCPS_IR_Domain.cpp.

References id_, and topicDescriptions_.

Referenced by remove_topic().

00962 {
00963   DCPS_IR_Topic_Description_Set::iterator where
00964   = this->topicDescriptions_.find(desc);
00965 
00966   if (where != this->topicDescriptions_.end()) {
00967     /// @TODO: Is this a leak?  Who owns the contained description?
00968     // delete where->second;
00969     this->topicDescriptions_.erase(where);
00970     return 0;
00971 
00972   } else {
00973     ACE_ERROR((LM_ERROR,
00974                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Domain::remove_topic_description: ")
00975                ACE_TEXT("unable to remove Topic Description 0x%x from domain %d.\n"),
00976                desc,
00977                id_));
00978     return -1;
00979   }
00980 }

void DCPS_IR_Domain::remove_topic_id_mapping ( const OpenDDS::DCPS::RepoId topicId  ) 

Remove the topic from the id to topic map. This method should only be called by the DCPS_IR_Topic when deleting the topic.

Definition at line 1504 of file DCPS_IR_Domain.cpp.

References idToTopicMap_.

01505 {
01506   IdToTopicMap::iterator map_entry = this->idToTopicMap_.find(topicId);
01507   if (map_entry != this->idToTopicMap_.end())
01508     idToTopicMap_.erase(map_entry);
01509 }


Member Data Documentation

DDS::DomainParticipant_var DCPS_IR_Domain::bitParticipant_ [private]

Definition at line 225 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics(), init_built_in_topics_topics(), and init_built_in_topics_transport().

DDS::ParticipantBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitParticipantDataWriter_ [private]

Definition at line 233 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), dispose_participant_bit(), init_built_in_topics_datawriters(), and publish_participant_bit().

DDS::DomainParticipantFactory_var DCPS_IR_Domain::bitParticipantFactory_ [private]

Built-in Topic variables.

Definition at line 224 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), and init_built_in_topics().

DDS::DomainParticipantListener_var DCPS_IR_Domain::bitParticipantListener_ [private]

Definition at line 226 of file DCPS_IR_Domain.h.

Referenced by init_built_in_topics().

DDS::Topic_var DCPS_IR_Domain::bitParticipantTopic_ [private]

Definition at line 232 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

DDS::PublicationBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitPublicationDataWriter_ [private]

Definition at line 242 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), dispose_publication_bit(), init_built_in_topics_datawriters(), and publish_publication_bit().

DDS::Topic_var DCPS_IR_Domain::bitPublicationTopic_ [private]

Definition at line 241 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

DDS::Publisher_var DCPS_IR_Domain::bitPublisher_ [private]

Definition at line 227 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_transport().

DDS::SubscriptionBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitSubscriptionDataWriter_ [private]

Definition at line 239 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), dispose_subscription_bit(), init_built_in_topics_datawriters(), and publish_subscription_bit().

DDS::Topic_var DCPS_IR_Domain::bitSubscriptionTopic_ [private]

Definition at line 238 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

DDS::TopicBuiltinTopicDataDataWriter_var DCPS_IR_Domain::bitTopicDataWriter_ [private]

Definition at line 236 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), dispose_topic_bit(), init_built_in_topics_datawriters(), and publish_topic_bit().

DDS::Topic_var DCPS_IR_Domain::bitTopicTopic_ [private]

Definition at line 235 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), init_built_in_topics_datawriters(), and init_built_in_topics_topics().

DCPS_IR_Participant_Set DCPS_IR_Domain::deadParticipants_ [private]

the dead participants dead participants exist in both this and participants_

Definition at line 208 of file DCPS_IR_Domain.h.

Referenced by add_dead_participant(), dump_to_string(), and remove_dead_participants().

DDS::DomainId_t DCPS_IR_Domain::id_ [private]

Definition at line 197 of file DCPS_IR_Domain.h.

Referenced by add_participant(), add_topic_description(), dump_to_string(), find_topic(), find_topic_description(), get_id(), init_built_in_topics(), reassociate_built_in_topic_pubs(), remove_participant(), remove_topic(), and remove_topic_description().

IdToTopicMap DCPS_IR_Domain::idToTopicMap_ [private]

Actual mapping of Id values to Topic object references.

Definition at line 218 of file DCPS_IR_Domain.h.

Referenced by add_topic_i(), find_topic(), and remove_topic_id_mapping().

RepoIdGenerator& DCPS_IR_Domain::participantIdGenerator_ [private]

Definition at line 201 of file DCPS_IR_Domain.h.

Referenced by get_next_participant_id(), and last_participant_key().

DCPS_IR_Participant_Map DCPS_IR_Domain::participants_ [private]

all the participants

Definition at line 204 of file DCPS_IR_Domain.h.

Referenced by add_participant(), dump_to_string(), participant(), participants(), reassociate_built_in_topic_pubs(), and remove_participant().

DCPS_IR_Topic_Description_Set DCPS_IR_Domain::topicDescriptions_ [private]

all the topics

Definition at line 211 of file DCPS_IR_Domain.h.

Referenced by add_topic_description(), dump_to_string(), find_topic(), find_topic_description(), and remove_topic_description().

OpenDDS::DCPS::TransportConfig_rch DCPS_IR_Domain::transportConfig_ [private]

Definition at line 230 of file DCPS_IR_Domain.h.

Referenced by init_built_in_topics_transport().

bool DCPS_IR_Domain::useBIT_ [private]

indicates if the BuiltIn Topics are enabled

Definition at line 221 of file DCPS_IR_Domain.h.

Referenced by cleanup_built_in_topics(), dispose_participant_bit(), dispose_publication_bit(), dispose_subscription_bit(), dispose_topic_bit(), dump_to_string(), init_built_in_topics(), publish_participant_bit(), publish_publication_bit(), publish_subscription_bit(), and publish_topic_bit().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:05:55 2016 for OpenDDS by  doxygen 1.4.7