DCPS_IR_Participant Class Reference

Representative of the Domain Participant. More...

#include <DCPS_IR_Participant.h>

Collaboration diagram for DCPS_IR_Participant:

Collaboration graph
[legend]
List of all members.

Public Types

 OWNER_NONE
enum  { OWNER_NONE }
 Special owner to enforce no callbacks. More...

Public Member Functions

 DCPS_IR_Participant (const TAO_DDS_DCPSFederationId &federationId, OpenDDS::DCPS::RepoId id, DCPS_IR_Domain *domain, DDS::DomainParticipantQos qos, Update::Manager *um)
virtual ~DCPS_IR_Participant ()
void takeOwnership ()
 Take local ownership of this participant and publish an update.
void changeOwner (long sender, long owner)
 Process an incoming update that changes ownership.
long owner () const
 Value of the owner for this participant.
bool isOwner () const
 Indication of whether the current repository is the owner of this participant.
bool & isBitPublisher ()
 Flag to discriminate the built-in topic publishing participant within a domain.
bool isBitPublisher () const
int add_publication (DCPS_IR_Publication *pub)
int find_publication_reference (OpenDDS::DCPS::RepoId pubId, DCPS_IR_Publication *&pub)
 Return the publication object.
int remove_publication (OpenDDS::DCPS::RepoId pubId)
int add_subscription (DCPS_IR_Subscription *sub)
int find_subscription_reference (OpenDDS::DCPS::RepoId subId, DCPS_IR_Subscription *&sub)
 Return the subscription object.
int remove_subscription (OpenDDS::DCPS::RepoId subId)
int add_topic_reference (DCPS_IR_Topic *topic)
int remove_topic_reference (OpenDDS::DCPS::RepoId topicId, DCPS_IR_Topic *&topic)
int find_topic_reference (OpenDDS::DCPS::RepoId topicId, DCPS_IR_Topic *&topic)
void remove_all_dependents (CORBA::Boolean notify_lost)
 Removes all topics, publications and.
void mark_dead ()
OpenDDS::DCPS::RepoId get_id ()
CORBA::Boolean is_alive ()
void set_alive (CORBA::Boolean alive)
void ignore_participant (OpenDDS::DCPS::RepoId id)
 Ignore the participant with the id.
void ignore_topic (OpenDDS::DCPS::RepoId id)
 Ignore the topic with the id.
void ignore_publication (OpenDDS::DCPS::RepoId id)
 Ignore the publication with the id.
void ignore_subscription (OpenDDS::DCPS::RepoId id)
 Ignore the subscription with the id.
const DDS::DomainParticipantQosget_qos ()
bool set_qos (const DDS::DomainParticipantQos &qos)
CORBA::Boolean is_participant_ignored (OpenDDS::DCPS::RepoId id)
CORBA::Boolean is_topic_ignored (OpenDDS::DCPS::RepoId id)
CORBA::Boolean is_publication_ignored (OpenDDS::DCPS::RepoId id)
CORBA::Boolean is_subscription_ignored (OpenDDS::DCPS::RepoId id)
DDS::InstanceHandle_t get_handle ()
void set_handle (DDS::InstanceHandle_t handle)
CORBA::Boolean is_bit ()
void set_bit_status (CORBA::Boolean isBIT)
DCPS_IR_Domainget_domain_reference () const
OpenDDS::DCPS::RepoId get_next_topic_id ()
OpenDDS::DCPS::RepoId get_next_publication_id ()
OpenDDS::DCPS::RepoId get_next_subscription_id ()
void last_topic_key (long key)
void last_publication_key (long key)
void last_subscription_key (long key)
const DCPS_IR_Publication_Mappublications () const
 Expose a readable reference to the publication map.
const DCPS_IR_Subscription_Mapsubscriptions () const
 Expose a readable reference to the subscription map.
const DCPS_IR_Topic_Maptopics () const
 Expose a readable reference to the topic map.
std::string dump_to_string (const std::string &prefix, int depth) const

Private Attributes

OpenDDS::DCPS::RepoId id_
DCPS_IR_Domaindomain_
DDS::DomainParticipantQos qos_
CORBA::Boolean aliveStatus_
DDS::InstanceHandle_t handle_
CORBA::Boolean isBIT_
const TAO_DDS_DCPSFederationIdfederationId_
long owner_
ACE_SYNCH_MUTEX ownerLock_
 Lock portions ownership processing.
RepoIdGenerator topicIdGenerator_
RepoIdGenerator publicationIdGenerator_
RepoIdGenerator subscriptionIdGenerator_
DCPS_IR_Subscription_Map subscriptions_
DCPS_IR_Publication_Map publications_
DCPS_IR_Topic_Map topicRefs_
TAO_DDS_RepoId_Set ignoredParticipants_
TAO_DDS_RepoId_Set ignoredTopics_
TAO_DDS_RepoId_Set ignoredPublications_
TAO_DDS_RepoId_Set ignoredSubscriptions_
Update::Managerum_
bool isBitPublisher_
 Flag indicating this participant publishes built-in topics.

Detailed Description

Representative of the Domain Participant.

Definition at line 56 of file DCPS_IR_Participant.h.


Member Enumeration Documentation

anonymous enum

Special owner to enforce no callbacks.

Enumerator:
OWNER_NONE 

Definition at line 59 of file DCPS_IR_Participant.h.

00059 { OWNER_NONE};


Constructor & Destructor Documentation

DCPS_IR_Participant::DCPS_IR_Participant ( const TAO_DDS_DCPSFederationId federationId,
OpenDDS::DCPS::RepoId  id,
DCPS_IR_Domain domain,
DDS::DomainParticipantQos  qos,
Update::Manager um 
)

Definition at line 24 of file DCPS_IR_Participant.cpp.

00029   : id_(id),
00030     domain_(domain),
00031     qos_(qos),
00032     aliveStatus_(1),
00033     handle_(0),
00034     isBIT_(0),
00035     federationId_(federationId),
00036     owner_(federationId.overridden() ? OWNER_NONE : federationId.id()),
00037     topicIdGenerator_(
00038       federationId.id(),
00039       OpenDDS::DCPS::RepoIdConverter(id).participantId(),
00040       OpenDDS::DCPS::KIND_TOPIC),
00041     publicationIdGenerator_(
00042       federationId.id(),
00043       OpenDDS::DCPS::RepoIdConverter(id).participantId(),
00044       OpenDDS::DCPS::KIND_WRITER),
00045     subscriptionIdGenerator_(
00046       federationId.id(),
00047       OpenDDS::DCPS::RepoIdConverter(id).participantId(),
00048       OpenDDS::DCPS::KIND_READER),
00049     um_(um),
00050     isBitPublisher_(false)
00051 {
00052 }

DCPS_IR_Participant::~DCPS_IR_Participant (  )  [virtual]

Definition at line 54 of file DCPS_IR_Participant.cpp.

References id_, publications_, remove_publication(), remove_subscription(), subscriptions_, and topicRefs_.

00055 {
00056   for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
00057        current != this->subscriptions_.end();
00058        ++current) {
00059     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00060     OpenDDS::DCPS::RepoIdConverter sub_converter(current->first);
00061     ACE_ERROR((LM_ERROR,
00062                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::~DCPS_IR_Participant: ")
00063                ACE_TEXT("domain %d participant %C removing subscription %C.\n"),
00064                this->domain_->get_id(),
00065                std::string(part_converter).c_str(),
00066                std::string(sub_converter).c_str()));
00067     remove_subscription(current->first);
00068   }
00069 
00070   for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
00071        current != this->publications_.end();
00072        ++current) {
00073     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00074     OpenDDS::DCPS::RepoIdConverter pub_converter(current->first);
00075     ACE_ERROR((LM_ERROR,
00076                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::~DCPS_IR_Participant: ")
00077                ACE_TEXT("domain %d participant %C removing publication %C.\n"),
00078                this->domain_->get_id(),
00079                std::string(part_converter).c_str(),
00080                std::string(pub_converter).c_str()));
00081     remove_publication(current->first);
00082   }
00083 
00084   for (DCPS_IR_Topic_Map::const_iterator current = this->topicRefs_.begin();
00085        current != this->topicRefs_.end();
00086        ++current) {
00087     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00088     OpenDDS::DCPS::RepoIdConverter topic_converter(current->first);
00089     ACE_ERROR((LM_ERROR,
00090                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::~DCPS_IR_Participant: ")
00091                ACE_TEXT("domain %d participant %C retained topic %C.\n"),
00092                this->domain_->get_id(),
00093                std::string(part_converter).c_str(),
00094                std::string(topic_converter).c_str()));
00095   }
00096 }


Member Function Documentation

int DCPS_IR_Participant::add_publication ( DCPS_IR_Publication pub  ) 

Add a publication This takes ownership of the memory pointed to by pub Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 188 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Publication::get_id(), id_, isBitPublisher_, publications_, and DCPS_IR_Publication::set_bit_status().

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

00189 {
00190   OpenDDS::DCPS::RepoId pubId = pub->get_id();
00191   DCPS_IR_Publication_Map::iterator where = this->publications_.find(pubId);
00192 
00193   if (where == this->publications_.end()) {
00194     this->publications_.insert(
00195       where, DCPS_IR_Publication_Map::value_type(pubId, pub));
00196 
00197     if (isBitPublisher_) {
00198       pub->set_bit_status(isBitPublisher_);
00199     }
00200 
00201     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00202       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00203       OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00204       ACE_DEBUG((LM_DEBUG,
00205                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::add_publication: ")
00206                  ACE_TEXT("participant %C successfully added publication %C at 0x%x.\n"),
00207                  std::string(part_converter).c_str(),
00208                  std::string(pub_converter).c_str(),
00209                  pub));
00210     }
00211 
00212     return 0;
00213 
00214   } else {
00215     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00216       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00217       OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00218       ACE_ERROR((LM_NOTICE,
00219                  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Participant::add_publication: ")
00220                  ACE_TEXT("participant %C attempted to add existing publication %C.\n"),
00221                  std::string(part_converter).c_str(),
00222                  std::string(pub_converter).c_str()));
00223     }
00224 
00225     return 1;
00226   }
00227 }

int DCPS_IR_Participant::add_subscription ( DCPS_IR_Subscription sub  ) 

Add a subscription This takes ownership of the memory pointed to by aub Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 314 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Subscription::get_id(), id_, isBitPublisher_, DCPS_IR_Subscription::set_bit_status(), and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

00315 {
00316   OpenDDS::DCPS::RepoId subId = sub->get_id();
00317   DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
00318 
00319   if (where == this->subscriptions_.end()) {
00320     this->subscriptions_.insert(
00321       where, DCPS_IR_Subscription_Map::value_type(subId, sub));
00322 
00323     if (isBitPublisher_) {
00324       sub->set_bit_status(isBitPublisher_);
00325     }
00326 
00327     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00328       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00329       OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00330       ACE_DEBUG((LM_DEBUG,
00331                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::add_subscription: ")
00332                  ACE_TEXT("participant %C successfully added subscription %C at 0x%x.\n"),
00333                  std::string(part_converter).c_str(),
00334                  std::string(sub_converter).c_str(),
00335                  sub));
00336     }
00337 
00338     return 0;
00339 
00340   } else {
00341     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00342       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00343       OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00344       ACE_ERROR((LM_NOTICE,
00345                  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Participant::add_subscription: ")
00346                  ACE_TEXT("participant %C attempted to add existing subscription %C.\n"),
00347                  std::string(part_converter).c_str(),
00348                  std::string(sub_converter).c_str()));
00349     }
00350 
00351     return 1;
00352   }
00353 }

int DCPS_IR_Participant::add_topic_reference ( DCPS_IR_Topic topic  ) 

Add a topic Returns 0 if added, 1 if already exists, -1 other failure

Definition at line 440 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Topic::get_id(), id_, isBitPublisher_, DCPS_IR_Topic::set_bit_status(), and topicRefs_.

Referenced by DCPS_IR_Domain::add_topic_i().

00441 {
00442   OpenDDS::DCPS::RepoId topicId = topic->get_id();
00443   DCPS_IR_Topic_Map::iterator where = this->topicRefs_.find(topicId);
00444 
00445   if (where == this->topicRefs_.end()) {
00446     this->topicRefs_.insert(
00447       where, DCPS_IR_Topic_Map::value_type(topicId, topic));
00448 
00449     if (isBitPublisher_) {
00450       topic->set_bit_status(isBitPublisher_);
00451     }
00452 
00453     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00454       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00455       OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
00456       ACE_DEBUG((LM_DEBUG,
00457                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::add_topic_reference: ")
00458                  ACE_TEXT("participant %C successfully added topic %C at 0x%x.\n"),
00459                  std::string(part_converter).c_str(),
00460                  std::string(topic_converter).c_str(),
00461                  topic));
00462     }
00463 
00464     return 0;
00465 
00466   } else {
00467     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00468       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00469       OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
00470       ACE_DEBUG((LM_NOTICE,
00471                  ACE_TEXT("(%P|%t) NOTICE: DCPS_IR_Participant::add_topic_reference: ")
00472                  ACE_TEXT("participant %C attempted to add existing topic %C.\n"),
00473                  std::string(part_converter).c_str(),
00474                  std::string(topic_converter).c_str()));
00475     }
00476 
00477     return 1;
00478   }
00479 }

void DCPS_IR_Participant::changeOwner ( long  sender,
long  owner 
)

Process an incoming update that changes ownership.

: Ensure that any stalled callbacks are made.

Definition at line 142 of file DCPS_IR_Participant.cpp.

References owner_, and OWNER_NONE.

Referenced by TAO_DDS_DCPSInfo_i::changeOwnership(), and takeOwnership().

00143 {
00144   {
00145     ACE_GUARD(ACE_SYNCH_MUTEX, guard, this->ownerLock_);
00146 
00147     if ((owner == OWNER_NONE)
00148         && (this->isOwner() || (this->owner_ != sender))) {
00149       // Do not eliminate ownership if we are the owner or if the update
00150       // does not come from the current owner.
00151       return;
00152     }
00153 
00154     // Finally.  Change the value.
00155     this->owner_ = owner;
00156 
00157   } // End of lock scope.
00158 
00159   if (this->isOwner()) {
00160     /// @TODO: Ensure that any stalled callbacks are made.
00161   }
00162 }

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

Definition at line 931 of file DCPS_IR_Participant.cpp.

References aliveStatus_, federationId_, TAO_DDS_DCPSFederationId::id(), id_, ignoredParticipants_, ignoredPublications_, ignoredSubscriptions_, ignoredTopics_, isBIT_, TAO_DDS_DCPSFederationId::overridden(), owner_, publications_, subscriptions_, and topicRefs_.

00932 {
00933   std::string str;
00934 #if !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
00935   OpenDDS::DCPS::RepoIdConverter local_converter(id_);
00936 
00937   for (int i=0; i < depth; i++)
00938     str += prefix;
00939   std::string indent = str + prefix;
00940   str += "DCPS_IR_Participant[";
00941   str += std::string(local_converter);
00942   str += "]";
00943   if (isBIT_)
00944     str += " (BIT)";
00945   std::ostringstream os;
00946   os << "federation id[" << federationId_.id();
00947   if (federationId_.overridden())
00948     os << "(federated)";
00949 
00950   os << "]  owner[" << owner_ << "]";
00951   str += os.str();
00952   str += aliveStatus_ ? " (alive)" : " (not alive)";
00953   str += "\n";
00954 
00955   str += indent + "Topics:\n";
00956   for (DCPS_IR_Topic_Map::const_iterator tm = topicRefs_.begin();
00957        tm != topicRefs_.end();
00958        tm++)
00959   {
00960     str += tm->second->dump_to_string(prefix, depth+1);
00961   }
00962 
00963   str += indent + "Publications:\n";
00964   for (DCPS_IR_Publication_Map::const_iterator pm = publications_.begin();
00965        pm != publications_.end();
00966        pm++)
00967   {
00968     str += pm->second->dump_to_string(prefix, depth+1);
00969   }
00970 
00971   str += indent + "Subscriptions:\n";
00972   for (DCPS_IR_Subscription_Map::const_iterator sm = subscriptions_.begin();
00973        sm != subscriptions_.end();
00974        sm++)
00975   {
00976     str += sm->second->dump_to_string(prefix, depth+1);
00977   }
00978 
00979   str += indent + "ignored Participants [ ";
00980   for (TAO_DDS_RepoId_Set::const_iterator ipart = ignoredParticipants_.begin();
00981        ipart != ignoredParticipants_.end();
00982        ipart++)
00983   {
00984     OpenDDS::DCPS::RepoIdConverter ipart_converter(*ipart);
00985     str += std::string(ipart_converter);
00986     str += " ";
00987   }
00988   str += "]\n";
00989   str += indent + "ignored Topics [ ";
00990 
00991   for (TAO_DDS_RepoId_Set::const_iterator itop = ignoredTopics_.begin();
00992        itop != ignoredTopics_.end();
00993        itop++)
00994   {
00995     OpenDDS::DCPS::RepoIdConverter itop_converter(*itop);
00996     str += std::string(itop_converter);
00997     str += " ";
00998   }
00999   str += "]\n";
01000   str += indent + "ignored Publications [ ";
01001 
01002   for (TAO_DDS_RepoId_Set::const_iterator ipub = ignoredPublications_.begin();
01003        ipub != ignoredPublications_.end();
01004        ipub++)
01005   {
01006     OpenDDS::DCPS::RepoIdConverter ipub_converter(*ipub);
01007     str += std::string(ipub_converter);
01008     str += " ";
01009   }
01010   str += "]\n";
01011   str += indent + "ignored Subscriptions [ ";
01012 
01013   for (TAO_DDS_RepoId_Set::const_iterator isub = ignoredSubscriptions_.begin();
01014        isub != ignoredSubscriptions_.end();
01015        isub++)
01016   {
01017     OpenDDS::DCPS::RepoIdConverter isub_converter(*isub);
01018     str += std::string(isub_converter);
01019     str += " ";
01020   }
01021   str += "]\n";
01022 
01023 #endif // !defined (OPENDDS_INFOREPO_REDUCED_FOOTPRINT)
01024   return str;
01025 }

int DCPS_IR_Participant::find_publication_reference ( OpenDDS::DCPS::RepoId  pubId,
DCPS_IR_Publication *&  pub 
)

Return the publication object.

Definition at line 229 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::association_complete(), TAO_DDS_DCPSInfo_i::disassociate_publication(), and TAO_DDS_DCPSInfo_i::update_publication_qos().

00231 {
00232   DCPS_IR_Publication_Map::iterator where = this->publications_.find(pubId);
00233 
00234   if (where != this->publications_.end()) {
00235     pub = where->second;
00236 
00237     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00238       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00239       OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00240       ACE_DEBUG((LM_DEBUG,
00241                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_publication_reference: ")
00242                  ACE_TEXT("participant %C found publication %C at 0x%x.\n"),
00243                  std::string(part_converter).c_str(),
00244                  std::string(pub_converter).c_str(),
00245                  pub));
00246     }
00247 
00248     return 0;
00249 
00250   } else {
00251     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00252       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00253       OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00254       ACE_DEBUG((LM_DEBUG,
00255                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_publication_reference: ")
00256                  ACE_TEXT("participant %C could not find publication %C.\n"),
00257                  std::string(part_converter).c_str(),
00258                  std::string(pub_converter).c_str()));
00259     }
00260     pub = 0;
00261     return -1;
00262   }
00263 }

int DCPS_IR_Participant::find_subscription_reference ( OpenDDS::DCPS::RepoId  subId,
DCPS_IR_Subscription *&  sub 
)

Return the subscription object.

Definition at line 355 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::association_complete(), TAO_DDS_DCPSInfo_i::disassociate_subscription(), TAO_DDS_DCPSInfo_i::update_subscription_params(), and TAO_DDS_DCPSInfo_i::update_subscription_qos().

00357 {
00358   DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
00359 
00360   if (where != this->subscriptions_.end()) {
00361     sub = where->second;
00362 
00363     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00364       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00365       OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00366       ACE_DEBUG((LM_DEBUG,
00367                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_subscription_reference: ")
00368                  ACE_TEXT("participant %C found subscription %C at 0x%x.\n"),
00369                  std::string(part_converter).c_str(),
00370                  std::string(sub_converter).c_str(),
00371                  sub));
00372     }
00373 
00374     return 0;
00375 
00376   } else {
00377     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00378       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00379       OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00380       ACE_DEBUG((LM_DEBUG,
00381                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_subscription_reference: ")
00382                  ACE_TEXT("participant %C could not find subscription %C.\n"),
00383                  std::string(part_converter).c_str(),
00384                  std::string(sub_converter).c_str()));
00385     }
00386     sub = 0;
00387     return -1;
00388   }
00389 }

int DCPS_IR_Participant::find_topic_reference ( OpenDDS::DCPS::RepoId  topicId,
DCPS_IR_Topic *&  topic 
)

Find topic reference with id Does NOT give ownership of memory Returns 0 if successful

Definition at line 518 of file DCPS_IR_Participant.cpp.

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

Referenced by TAO_DDS_DCPSInfo_i::remove_topic(), and TAO_DDS_DCPSInfo_i::update_topic_qos().

00520 {
00521   DCPS_IR_Topic_Map::iterator where = this->topicRefs_.find(topicId);
00522 
00523   if (where != this->topicRefs_.end()) {
00524     topic = where->second;
00525 
00526     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00527       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00528       OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
00529       ACE_DEBUG((LM_DEBUG,
00530                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::find_topic_reference: ")
00531                  ACE_TEXT("participant %C found topic %C at %x.\n"),
00532                  std::string(part_converter).c_str(),
00533                  std::string(topic_converter).c_str(),
00534                  topic));
00535     }
00536 
00537     return 0;
00538 
00539   } else {
00540     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00541     OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
00542     ACE_ERROR((LM_ERROR,
00543                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::find_topic_reference: ")
00544                ACE_TEXT("participant %C unable to find topic %C.\n"),
00545                std::string(part_converter).c_str(),
00546                std::string(topic_converter).c_str()));
00547     topic = 0;
00548     return -1;
00549   }
00550 }

DCPS_IR_Domain * DCPS_IR_Participant::get_domain_reference (  )  const

Definition at line 889 of file DCPS_IR_Participant.cpp.

References domain_.

Referenced by DCPS_IR_Subscription::set_qos(), and DCPS_IR_Publication::set_qos().

00890 {
00891   return domain_;
00892 }

DDS::InstanceHandle_t DCPS_IR_Participant::get_handle (  ) 

Definition at line 850 of file DCPS_IR_Participant.cpp.

References handle_.

Referenced by DCPS_IR_Domain::dispose_participant_bit().

00851 {
00852   return handle_;
00853 }

OpenDDS::DCPS::RepoId DCPS_IR_Participant::get_id (  ) 

Definition at line 713 of file DCPS_IR_Participant.cpp.

References id_.

Referenced by DCPS_IR_Domain::add_participant(), DCPS_IR_Domain::dispose_participant_bit(), DCPS_IR_Topic::get_participant_id(), DCPS_IR_Subscription::get_participant_id(), DCPS_IR_Publication::get_participant_id(), DCPS_IR_Domain::publish_participant_bit(), remove_all_dependents(), and DCPS_IR_Domain::remove_topic().

00714 {
00715   return id_;
00716 }

OpenDDS::DCPS::RepoId DCPS_IR_Participant::get_next_publication_id (  ) 

Definition at line 901 of file DCPS_IR_Participant.cpp.

References RepoIdGenerator::next(), and publicationIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

00902 {
00903   return this->publicationIdGenerator_.next();
00904 }

OpenDDS::DCPS::RepoId DCPS_IR_Participant::get_next_subscription_id (  ) 

Definition at line 907 of file DCPS_IR_Participant.cpp.

References RepoIdGenerator::next(), and subscriptionIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

00908 {
00909   return this->subscriptionIdGenerator_.next();
00910 }

OpenDDS::DCPS::RepoId DCPS_IR_Participant::get_next_topic_id (  ) 

Definition at line 895 of file DCPS_IR_Participant.cpp.

References RepoIdGenerator::next(), and topicIdGenerator_.

Referenced by DCPS_IR_Domain::add_topic().

00896 {
00897   return this->topicIdGenerator_.next();
00898 }

const DDS::DomainParticipantQos * DCPS_IR_Participant::get_qos (  ) 

Return pointer to the participant qos Participant retains ownership

Definition at line 860 of file DCPS_IR_Participant.cpp.

References qos_.

Referenced by DCPS_IR_Domain::publish_participant_bit().

00861 {
00862   return &qos_;
00863 }

void DCPS_IR_Participant::ignore_participant ( OpenDDS::DCPS::RepoId  id  ) 

Ignore the participant with the id.

Definition at line 728 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, id_, ignoredParticipants_, publications_, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_domain_participant().

00729 {
00730   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00731     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00732     OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
00733     ACE_DEBUG((LM_DEBUG,
00734                ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_participant: ")
00735                ACE_TEXT("participant %C now ignoring participant %C.\n"),
00736                std::string(part_converter).c_str(),
00737                std::string(ignore_converter).c_str()));
00738   }
00739 
00740   ignoredParticipants_.insert(id);
00741 
00742   // disassociate any publications
00743   for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
00744        current != this->publications_.end();
00745        ++current) {
00746     current->second->disassociate_participant(id);
00747   }
00748 
00749   // disassociate any subscriptions
00750   for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
00751        current != this->subscriptions_.end();
00752        ++current) {
00753     current->second->disassociate_participant(id);
00754   }
00755 }

void DCPS_IR_Participant::ignore_publication ( OpenDDS::DCPS::RepoId  id  ) 

Ignore the publication with the id.

Definition at line 786 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, id_, ignoredPublications_, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_publication().

00787 {
00788   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00789     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00790     OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
00791     ACE_DEBUG((LM_DEBUG,
00792                ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_publication: ")
00793                ACE_TEXT("participant %C now ignoring publication %C.\n"),
00794                std::string(part_converter).c_str(),
00795                std::string(ignore_converter).c_str()));
00796   }
00797 
00798   ignoredPublications_.insert(id);
00799 
00800   // disassociate any subscriptions
00801   for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
00802        current != this->subscriptions_.end();
00803        ++current) {
00804     current->second->disassociate_publication(id);
00805   }
00806 }

void DCPS_IR_Participant::ignore_subscription ( OpenDDS::DCPS::RepoId  id  ) 

Ignore the subscription with the id.

Definition at line 808 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, id_, ignoredSubscriptions_, and publications_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_subscription().

00809 {
00810   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00811     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00812     OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
00813     ACE_DEBUG((LM_DEBUG,
00814                ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_subscription: ")
00815                ACE_TEXT("participant %C now ignoring subscription %C.\n"),
00816                std::string(part_converter).c_str(),
00817                std::string(ignore_converter).c_str()));
00818   }
00819 
00820   ignoredSubscriptions_.insert(id);
00821 
00822   // disassociate any publications
00823   for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
00824        current != this->publications_.end();
00825        ++current) {
00826     current->second->disassociate_subscription(id);
00827   }
00828 }

void DCPS_IR_Participant::ignore_topic ( OpenDDS::DCPS::RepoId  id  ) 

Ignore the topic with the id.

Definition at line 757 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, id_, ignoredTopics_, publications_, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::ignore_topic().

00758 {
00759   if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00760     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00761     OpenDDS::DCPS::RepoIdConverter ignore_converter(id);
00762     ACE_DEBUG((LM_DEBUG,
00763                ACE_TEXT("(%P|%t) DCPS_IR_Participant::ignore_topic: ")
00764                ACE_TEXT("participant %C now ignoring topic %C.\n"),
00765                std::string(part_converter).c_str(),
00766                std::string(ignore_converter).c_str()));
00767   }
00768 
00769   ignoredTopics_.insert(id);
00770 
00771   // disassociate any publications
00772   for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
00773        current != this->publications_.end();
00774        ++current) {
00775     current->second->disassociate_topic(id);
00776   }
00777 
00778   // disassociate any subscriptions
00779   for (DCPS_IR_Subscription_Map::const_iterator current = this->subscriptions_.begin();
00780        current != this->subscriptions_.end();
00781        ++current) {
00782     current->second->disassociate_topic(id);
00783   }
00784 }

CORBA::Boolean DCPS_IR_Participant::is_alive (  ) 

Definition at line 718 of file DCPS_IR_Participant.cpp.

References aliveStatus_.

Referenced by DCPS_IR_Subscription::add_associated_publication(), DCPS_IR_Publication::add_associated_subscription(), DCPS_IR_Subscription::disassociate_participant(), DCPS_IR_Publication::disassociate_participant(), DCPS_IR_Subscription::disassociate_publication(), DCPS_IR_Publication::disassociate_subscription(), DCPS_IR_Subscription::disassociate_topic(), DCPS_IR_Publication::disassociate_topic(), DCPS_IR_Subscription::remove_associated_publication(), DCPS_IR_Publication::remove_associated_subscription(), DCPS_IR_Subscription::update_incompatible_qos(), and DCPS_IR_Publication::update_incompatible_qos().

00719 {
00720   return aliveStatus_;
00721 }

CORBA::Boolean DCPS_IR_Participant::is_bit (  ) 

Definition at line 879 of file DCPS_IR_Participant.cpp.

References isBIT_.

Referenced by DCPS_IR_Domain::dispose_participant_bit(), and DCPS_IR_Domain::publish_participant_bit().

00880 {
00881   return isBIT_;
00882 }

CORBA::Boolean DCPS_IR_Participant::is_participant_ignored ( OpenDDS::DCPS::RepoId  id  ) 

Definition at line 830 of file DCPS_IR_Participant.cpp.

References ignoredParticipants_.

Referenced by DCPS_IR_Subscription::is_publication_ignored(), DCPS_IR_Publication::is_subscription_ignored(), and DCPS_IR_Topic::try_associate().

00831 {
00832   return (0 == ignoredParticipants_.find(id));
00833 }

CORBA::Boolean DCPS_IR_Participant::is_publication_ignored ( OpenDDS::DCPS::RepoId  id  ) 

Definition at line 840 of file DCPS_IR_Participant.cpp.

References ignoredPublications_.

Referenced by DCPS_IR_Subscription::is_publication_ignored().

00841 {
00842   return (0 == ignoredPublications_.find(id));
00843 }

CORBA::Boolean DCPS_IR_Participant::is_subscription_ignored ( OpenDDS::DCPS::RepoId  id  ) 

Definition at line 845 of file DCPS_IR_Participant.cpp.

References ignoredSubscriptions_.

Referenced by DCPS_IR_Publication::is_subscription_ignored(), and DCPS_IR_Topic::try_associate().

00846 {
00847   return (0 == ignoredSubscriptions_.find(id));
00848 }

CORBA::Boolean DCPS_IR_Participant::is_topic_ignored ( OpenDDS::DCPS::RepoId  id  ) 

Definition at line 835 of file DCPS_IR_Participant.cpp.

References ignoredTopics_.

Referenced by DCPS_IR_Subscription::is_publication_ignored(), DCPS_IR_Publication::is_subscription_ignored(), and DCPS_IR_Topic::try_associate().

00836 {
00837   return (0 == ignoredTopics_.find(id));
00838 }

bool DCPS_IR_Participant::isBitPublisher (  )  const

Definition at line 183 of file DCPS_IR_Participant.cpp.

References isBitPublisher_.

00184 {
00185   return this->isBitPublisher_;
00186 }

bool & DCPS_IR_Participant::isBitPublisher (  ) 

Flag to discriminate the built-in topic publishing participant within a domain.

Definition at line 177 of file DCPS_IR_Participant.cpp.

References isBitPublisher_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant(), TAO_DDS_DCPSInfo_i::add_publication(), TAO_DDS_DCPSInfo_i::add_subscription(), TAO_DDS_DCPSInfo_i::assert_topic(), TAO_DDS_DCPSInfo_i::remove_domain_participant(), TAO_DDS_DCPSInfo_i::remove_publication(), TAO_DDS_DCPSInfo_i::remove_subscription(), TAO_DDS_DCPSInfo_i::remove_topic(), TAO_DDS_DCPSInfo_i::update_domain_participant_qos(), TAO_DDS_DCPSInfo_i::update_publication_qos(), TAO_DDS_DCPSInfo_i::update_subscription_params(), TAO_DDS_DCPSInfo_i::update_subscription_qos(), and TAO_DDS_DCPSInfo_i::update_topic_qos().

00178 {
00179   return this->isBitPublisher_;
00180 }

bool DCPS_IR_Participant::isOwner (  )  const

Indication of whether the current repository is the owner of this participant.

Definition at line 171 of file DCPS_IR_Participant.cpp.

References federationId_, TAO_DDS_DCPSFederationId::id(), and owner_.

Referenced by DCPS_IR_Subscription::add_associated_publication(), DCPS_IR_Publication::add_associated_subscription(), DCPS_IR_Subscription::disassociate_participant(), DCPS_IR_Publication::disassociate_participant(), DCPS_IR_Subscription::disassociate_publication(), DCPS_IR_Publication::disassociate_subscription(), DCPS_IR_Subscription::disassociate_topic(), DCPS_IR_Publication::disassociate_topic(), DCPS_IR_Subscription::remove_associated_publication(), DCPS_IR_Publication::remove_associated_subscription(), TAO_DDS_DCPSInfo_i::remove_domain_participant(), TAO_DDS_DCPSInfo_i::remove_publication(), TAO_DDS_DCPSInfo_i::remove_subscription(), TAO_DDS_DCPSInfo_i::remove_topic(), TAO_DDS_DCPSInfo_i::update_domain_participant_qos(), DCPS_IR_Subscription::update_incompatible_qos(), DCPS_IR_Publication::update_incompatible_qos(), and TAO_DDS_DCPSInfo_i::update_topic_qos().

00172 {
00173   return this->owner_ == this->federationId_.id();
00174 }

void DCPS_IR_Participant::last_publication_key ( long  key  ) 

Definition at line 919 of file DCPS_IR_Participant.cpp.

References RepoIdGenerator::last(), and publicationIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_publication().

00920 {
00921   return this->publicationIdGenerator_.last(key);
00922 }

void DCPS_IR_Participant::last_subscription_key ( long  key  ) 

Definition at line 925 of file DCPS_IR_Participant.cpp.

References RepoIdGenerator::last(), and subscriptionIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription().

00926 {
00927   return this->subscriptionIdGenerator_.last(key);
00928 }

void DCPS_IR_Participant::last_topic_key ( long  key  ) 

Definition at line 913 of file DCPS_IR_Participant.cpp.

References RepoIdGenerator::last(), and topicIdGenerator_.

Referenced by TAO_DDS_DCPSInfo_i::add_topic().

00914 {
00915   return this->topicIdGenerator_.last(key);
00916 }

void DCPS_IR_Participant::mark_dead (  ) 

Changes aliveStatus to false then adds itself to the domain's list of dead participants for removal

Definition at line 707 of file DCPS_IR_Participant.cpp.

References DCPS_IR_Domain::add_dead_participant(), aliveStatus_, and domain_.

Referenced by DCPS_IR_Subscription::add_associated_publication(), DCPS_IR_Publication::add_associated_subscription(), DCPS_IR_Subscription::call_association_complete(), DCPS_IR_Publication::call_association_complete(), DCPS_IR_Subscription::disassociate_participant(), DCPS_IR_Publication::disassociate_participant(), DCPS_IR_Subscription::disassociate_publication(), DCPS_IR_Publication::disassociate_subscription(), DCPS_IR_Subscription::disassociate_topic(), DCPS_IR_Publication::disassociate_topic(), DCPS_IR_Subscription::remove_associated_publication(), DCPS_IR_Publication::remove_associated_subscription(), DCPS_IR_Publication::update_expr_params(), DCPS_IR_Subscription::update_incompatible_qos(), and DCPS_IR_Publication::update_incompatible_qos().

00708 {
00709   aliveStatus_ = 0;
00710   domain_->add_dead_participant(this);
00711 }

long DCPS_IR_Participant::owner (  )  const

Value of the owner for this participant.

Definition at line 165 of file DCPS_IR_Participant.cpp.

References owner_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant().

00166 {
00167   return this->owner_;
00168 }

const DCPS_IR_Publication_Map & DCPS_IR_Participant::publications (  )  const

Expose a readable reference to the publication map.

Definition at line 99 of file DCPS_IR_Participant.cpp.

References publications_.

Referenced by TAO_DDS_DCPSInfo_i::disassociate_participant().

00100 {
00101   return this->publications_;
00102 }

void DCPS_IR_Participant::remove_all_dependents ( CORBA::Boolean  notify_lost  ) 

Removes all topics, publications and.

Definition at line 552 of file DCPS_IR_Participant.cpp.

References Update::Actor, Update::DataReader, Update::DataWriter, OpenDDS::DCPS::DCPS_debug_level, Update::Manager::destroy(), domain_, get_id(), id_, publications_, DCPS_IR_Topic::release(), DCPS_IR_Topic::remove_publication_reference(), DCPS_IR_Topic::remove_subscription_reference(), DCPS_IR_Domain::remove_topic(), subscriptions_, Update::Topic, topicRefs_, and um_.

Referenced by DCPS_IR_Domain::remove_participant().

00553 {
00554   // remove all the publications associations
00555   {
00556     DCPS_IR_Publication_Map::const_iterator next = this->publications_.begin();
00557 
00558     while (next != this->publications_.end()) {
00559       DCPS_IR_Publication_Map::const_iterator current = next;
00560       ++ next;
00561       DCPS_IR_Topic* topic = current->second->get_topic();
00562       topic->remove_publication_reference(current->second);
00563 
00564       if (0 != current->second->remove_associations(notify_lost)) {
00565         return;
00566       }
00567 
00568       topic->release(false);
00569     }
00570   }
00571 
00572   {
00573     DCPS_IR_Subscription_Map::const_iterator next = this->subscriptions_.begin();
00574 
00575     while (next != this->subscriptions_.end()) {
00576       DCPS_IR_Subscription_Map::const_iterator current = next;
00577       ++ next;
00578       DCPS_IR_Topic* topic = current->second->get_topic();
00579       topic->remove_subscription_reference(current->second);
00580 
00581       if (0 != current->second->remove_associations(notify_lost)) {
00582         return;
00583       }
00584 
00585       topic->release(false);
00586     }
00587   }
00588 
00589   {
00590     DCPS_IR_Topic_Map::const_iterator next = this->topicRefs_.begin();
00591 
00592     while (next != this->topicRefs_.end()) {
00593       DCPS_IR_Topic_Map::const_iterator current = next;
00594       ++ next;
00595 
00596       // Notify the federation to remove the topic.
00597       if (this->um_ && (this->isBitPublisher() == false)) {
00598         Update::IdPath path(
00599           this->domain_->get_id(),
00600           this->get_id(),
00601           current->second->get_id());
00602         this->um_->destroy(path, Update::Topic);
00603 
00604         if (OpenDDS::DCPS::DCPS_debug_level > 4) {
00605           OpenDDS::DCPS::RepoId id = current->second->get_id();
00606           OpenDDS::DCPS::RepoIdConverter converter(id);
00607           ACE_DEBUG((LM_DEBUG,
00608                      ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
00609                      ACE_TEXT("pushing deletion of topic %C in domain %d.\n"),
00610                      std::string(converter).c_str(),
00611                      this->domain_->get_id()));
00612         }
00613 
00614         // Remove the topic ourselves.
00615         // N.B. This call sets the second (reference) argument to 0, so when
00616         //      clear() is called below, no destructor is (re)called.
00617 
00618         // Get the topic id and topic point before remove_topic since it
00619         // invalidates the iterator. Accessing after removal got SEGV.
00620         OpenDDS::DCPS::RepoId id = current->first;
00621         DCPS_IR_Topic* topic = current->second;
00622 
00623         this->domain_->remove_topic(this, topic);
00624 
00625         if (OpenDDS::DCPS::DCPS_debug_level > 9) {
00626           OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00627           OpenDDS::DCPS::RepoIdConverter topic_converter(id);
00628           ACE_DEBUG((LM_DEBUG,
00629                      ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
00630                      ACE_TEXT("domain %d participant %C removed topic %C.\n"),
00631                      this->domain_->get_id(),
00632                      std::string(part_converter).c_str(),
00633                      std::string(topic_converter).c_str()));
00634         }
00635       }
00636     }
00637   }
00638 
00639   // Clear the Topic container of null pointers.
00640   this->topicRefs_.clear();
00641 
00642   // The publications and subscriptions can NOT be deleted until after all
00643   // the associations have been removed.  Otherwise an access violation
00644   // can occur because a publication and subscription of this participant
00645   // could be associated.
00646 
00647   // delete all the publications
00648   for (DCPS_IR_Publication_Map::const_iterator current = this->publications_.begin();
00649        current != this->publications_.end();
00650        ++current) {
00651     // Notify the federation to destroy the publication.
00652     if (this->um_ && (this->isBitPublisher() == false)) {
00653       Update::IdPath path(
00654         this->domain_->get_id(),
00655         this->get_id(),
00656         current->second->get_id());
00657       this->um_->destroy(path, Update::Actor, Update::DataWriter);
00658 
00659       if (OpenDDS::DCPS::DCPS_debug_level > 4) {
00660         OpenDDS::DCPS::RepoId id = current->second->get_id();
00661         OpenDDS::DCPS::RepoIdConverter converter(id);
00662         ACE_DEBUG((LM_DEBUG,
00663                    ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
00664                    ACE_TEXT("pushing deletion of publication %C in domain %d.\n"),
00665                    std::string(converter).c_str(),
00666                    this->domain_->get_id()));
00667       }
00668     }
00669     // delete the publication
00670     delete current->second;
00671   }
00672 
00673   // Clear the container.
00674   this->publications_.clear();
00675 
00676   // delete all the subscriptions
00677   for (DCPS_IR_Subscription_Map::const_iterator current
00678        = this->subscriptions_.begin();
00679        current != this->subscriptions_.end();
00680        ++current) {
00681     // Notify the federation to destroy the subscription.
00682     if (this->um_ && (this->isBitPublisher() == false)) {
00683       Update::IdPath path(
00684         this->domain_->get_id(),
00685         this->get_id(),
00686         current->second->get_id());
00687       this->um_->destroy(path, Update::Actor, Update::DataReader);
00688 
00689       if (OpenDDS::DCPS::DCPS_debug_level > 4) {
00690         OpenDDS::DCPS::RepoId id = current->second->get_id();
00691         OpenDDS::DCPS::RepoIdConverter converter(id);
00692         ACE_DEBUG((LM_DEBUG,
00693                    ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_all_dependents: ")
00694                    ACE_TEXT("pushing deletion of subscription %C in domain %d.\n"),
00695                    std::string(converter).c_str(),
00696                    this->domain_->get_id()));
00697       }
00698     }
00699     // delete the subscription
00700     delete current->second;
00701   }
00702 
00703   // Clear the container.
00704   this->subscriptions_.clear();
00705 }

int DCPS_IR_Participant::remove_publication ( OpenDDS::DCPS::RepoId  pubId  ) 

Removes the publication with the id Deletes the publication object if returns successful Returns 0 if successful

Definition at line 265 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Domain::dispose_publication_bit(), domain_, id_, and publications_.

Referenced by TAO_DDS_DCPSInfo_i::add_publication(), TAO_DDS_DCPSInfo_i::remove_publication(), and ~DCPS_IR_Participant().

00266 {
00267   DCPS_IR_Publication_Map::iterator where = this->publications_.find(pubId);
00268 
00269   if (where != this->publications_.end()) {
00270     DCPS_IR_Topic* topic = where->second->get_topic();
00271     topic->remove_publication_reference(where->second);
00272 
00273     if (0 != where->second->remove_associations(false)) {
00274       // N.B. As written today, this branch will never be taken.
00275       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00276       OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00277       ACE_ERROR((LM_ERROR,
00278                  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_publication: ")
00279                  ACE_TEXT("participant %C unable to remove associations from publication %C\n"),
00280                  std::string(part_converter).c_str(),
00281                  std::string(pub_converter).c_str()));
00282       return -1;
00283     }
00284 
00285     this->domain_->dispose_publication_bit(where->second);
00286     delete where->second;
00287     topic->release(false);
00288     this->publications_.erase(where);
00289 
00290     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00291       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00292       OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00293       ACE_DEBUG((LM_DEBUG,
00294                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_publication: ")
00295                  ACE_TEXT("participant %C removed publication %C.\n"),
00296                  std::string(part_converter).c_str(),
00297                  std::string(pub_converter).c_str()));
00298     }
00299 
00300     return 0;
00301 
00302   } else {
00303     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00304     OpenDDS::DCPS::RepoIdConverter pub_converter(pubId);
00305     ACE_ERROR((LM_ERROR,
00306                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_publication: ")
00307                ACE_TEXT("participant %C unable to remove publication %C.\n"),
00308                std::string(part_converter).c_str(),
00309                std::string(pub_converter).c_str()));
00310     return -1;
00311   }
00312 }

int DCPS_IR_Participant::remove_subscription ( OpenDDS::DCPS::RepoId  subId  ) 

Removes the subscription with the id Deletes the subscription object if returns successful Returns 0 if successful

Definition at line 391 of file DCPS_IR_Participant.cpp.

References OpenDDS::DCPS::DCPS_debug_level, DCPS_IR_Domain::dispose_subscription_bit(), domain_, id_, and subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::add_subscription(), TAO_DDS_DCPSInfo_i::remove_subscription(), and ~DCPS_IR_Participant().

00392 {
00393   DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
00394 
00395   if (where != this->subscriptions_.end()) {
00396     DCPS_IR_Topic* topic = where->second->get_topic();
00397     topic->remove_subscription_reference(where->second);
00398 
00399     if (0 != where->second->remove_associations(false)) {
00400       // N.B. As written today, this branch will never be taken.
00401       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00402       OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00403       ACE_ERROR((LM_ERROR,
00404                  ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_subscription: ")
00405                  ACE_TEXT("participant %C unable to remove associations from subscription %C\n"),
00406                  std::string(part_converter).c_str(),
00407                  std::string(sub_converter).c_str()));
00408       return -1;
00409     }
00410 
00411     this->domain_->dispose_subscription_bit(where->second);
00412     delete where->second;
00413     topic->release(false);
00414     this->subscriptions_.erase(where);
00415 
00416     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00417       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00418       OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00419       ACE_DEBUG((LM_DEBUG,
00420                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_subscription: ")
00421                  ACE_TEXT("participant %C removed subscription %C.\n"),
00422                  std::string(part_converter).c_str(),
00423                  std::string(sub_converter).c_str()));
00424     }
00425 
00426     return 0;
00427 
00428   } else {
00429     OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00430     OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
00431     ACE_ERROR((LM_ERROR,
00432                ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_subscription: ")
00433                ACE_TEXT("participant %C unable to remove subscription %C.\n"),
00434                std::string(part_converter).c_str(),
00435                std::string(sub_converter).c_str()));
00436     return -1;
00437   }
00438 }

int DCPS_IR_Participant::remove_topic_reference ( OpenDDS::DCPS::RepoId  topicId,
DCPS_IR_Topic *&  topic 
)

Remove a topic reference Does not change or take ownership of topic Returns 0 if successful

Definition at line 481 of file DCPS_IR_Participant.cpp.

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

Referenced by DCPS_IR_Domain::remove_topic().

00483 {
00484   DCPS_IR_Topic_Map::iterator where = this->topicRefs_.find(topicId);
00485 
00486   if (where != this->topicRefs_.end()) {
00487     topic = where->second;
00488     this->topicRefs_.erase(where);
00489 
00490     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00491       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00492       OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
00493       ACE_DEBUG((LM_DEBUG,
00494                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_topic_reference: ")
00495                  ACE_TEXT("participant %C removed topic %C at 0x%x.\n"),
00496                  std::string(part_converter).c_str(),
00497                  std::string(topic_converter).c_str(),
00498                  topic));
00499     }
00500 
00501     return 0;
00502 
00503   } else {
00504     if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00505       OpenDDS::DCPS::RepoIdConverter part_converter(id_);
00506       OpenDDS::DCPS::RepoIdConverter topic_converter(topicId);
00507       ACE_ERROR((LM_WARNING,
00508                  ACE_TEXT("(%P|%t) WARNING: DCPS_IR_Participant::remove_topic_reference: ")
00509                  ACE_TEXT("participant %C unable to find topic %C for removal.\n"),
00510                  std::string(part_converter).c_str(),
00511                  std::string(topic_converter).c_str()));
00512     }
00513 
00514     return -1;
00515   }
00516 }

void DCPS_IR_Participant::set_alive ( CORBA::Boolean  alive  ) 

Definition at line 723 of file DCPS_IR_Participant.cpp.

References aliveStatus_.

00724 {
00725   aliveStatus_ = alive;
00726 }

void DCPS_IR_Participant::set_bit_status ( CORBA::Boolean  isBIT  ) 

Definition at line 884 of file DCPS_IR_Participant.cpp.

References isBIT_.

Referenced by DCPS_IR_Domain::publish_participant_bit().

00885 {
00886   isBIT_ = isBIT;
00887 }

void DCPS_IR_Participant::set_handle ( DDS::InstanceHandle_t  handle  ) 

Definition at line 855 of file DCPS_IR_Participant.cpp.

References handle_.

Referenced by DCPS_IR_Domain::publish_participant_bit().

00856 {
00857   handle_ = handle;
00858 }

bool DCPS_IR_Participant::set_qos ( const DDS::DomainParticipantQos qos  ) 

Update qos and also propogate the qos change to related BITs that has the qos copy. Return false if the provided QoS makes the DataWriter and DataReader QoS incompatible. Currently supported changeable QoS in DomainParticipantQos do not affect.

Definition at line 865 of file DCPS_IR_Participant.cpp.

References domain_, DCPS_IR_Domain::publish_participant_bit(), and qos_.

Referenced by TAO_DDS_DCPSInfo_i::update_domain_participant_qos().

00866 {
00867   // Do not need re-evaluate compatibility and associations when
00868   // DomainParticipantQos changes since only datareader and datawriter
00869   // QoS are evaludated during normal associations establishment.
00870 
00871   // Do not need publish the QoS change to topics or datareader or
00872   // datawriter BIT as they are independent.
00873   qos_ = qos;
00874   this->domain_->publish_participant_bit(this);
00875 
00876   return true;
00877 }

const DCPS_IR_Subscription_Map & DCPS_IR_Participant::subscriptions (  )  const

Expose a readable reference to the subscription map.

Definition at line 105 of file DCPS_IR_Participant.cpp.

References subscriptions_.

Referenced by TAO_DDS_DCPSInfo_i::disassociate_participant().

00106 {
00107   return this->subscriptions_;
00108 }

void DCPS_IR_Participant::takeOwnership (  ) 

Take local ownership of this participant and publish an update.

Publish an update with our ownership.

Definition at line 117 of file DCPS_IR_Participant.cpp.

References changeOwner(), Update::Manager::create(), OpenDDS::DCPS::DCPS_debug_level, federationId_, TAO_DDS_DCPSFederationId::id(), id_, and um_.

Referenced by TAO_DDS_DCPSInfo_i::add_domain_participant(), and TAO_DDS_DCPSInfo_i::attach_participant().

00118 {
00119   /// Publish an update with our ownership.
00120   if (this->um_ && (this->isBitPublisher() == false)) {
00121     this->um_->create(
00122       Update::OwnershipData(
00123         this->domain_->get_id(),
00124         this->id_,
00125         this->federationId_.id()));
00126 
00127     if (OpenDDS::DCPS::DCPS_debug_level > 4) {
00128       OpenDDS::DCPS::RepoIdConverter converter(id_);
00129       ACE_DEBUG((LM_DEBUG,
00130                  ACE_TEXT("(%P|%t) DCPS_IR_Participant::take_ownership: ")
00131                  ACE_TEXT("pushing ownership %C in domain %d.\n"),
00132                  std::string(converter).c_str(),
00133                  this->domain_->get_id()));
00134     }
00135   }
00136 
00137   // And now handle our internal ownership processing.
00138   this->changeOwner(this->federationId_.id(), this->federationId_.id());
00139 }

const DCPS_IR_Topic_Map & DCPS_IR_Participant::topics (  )  const

Expose a readable reference to the topic map.

Definition at line 111 of file DCPS_IR_Participant.cpp.

References topicRefs_.

00112 {
00113   return this->topicRefs_;
00114 }


Member Data Documentation

CORBA::Boolean DCPS_IR_Participant::aliveStatus_ [private]

Definition at line 203 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), is_alive(), mark_dead(), and set_alive().

DCPS_IR_Domain* DCPS_IR_Participant::domain_ [private]

Definition at line 201 of file DCPS_IR_Participant.h.

Referenced by get_domain_reference(), mark_dead(), remove_all_dependents(), remove_publication(), remove_subscription(), and set_qos().

const TAO_DDS_DCPSFederationId& DCPS_IR_Participant::federationId_ [private]

Definition at line 207 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), isOwner(), and takeOwnership().

DDS::InstanceHandle_t DCPS_IR_Participant::handle_ [private]

Definition at line 204 of file DCPS_IR_Participant.h.

Referenced by get_handle(), and set_handle().

OpenDDS::DCPS::RepoId DCPS_IR_Participant::id_ [private]

Definition at line 200 of file DCPS_IR_Participant.h.

Referenced by add_publication(), add_subscription(), add_topic_reference(), dump_to_string(), find_publication_reference(), find_subscription_reference(), find_topic_reference(), get_id(), ignore_participant(), ignore_publication(), ignore_subscription(), ignore_topic(), remove_all_dependents(), remove_publication(), remove_subscription(), remove_topic_reference(), takeOwnership(), and ~DCPS_IR_Participant().

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredParticipants_ [private]

Definition at line 223 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_participant(), and is_participant_ignored().

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredPublications_ [private]

Definition at line 225 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_publication(), and is_publication_ignored().

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredSubscriptions_ [private]

Definition at line 226 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_subscription(), and is_subscription_ignored().

TAO_DDS_RepoId_Set DCPS_IR_Participant::ignoredTopics_ [private]

Definition at line 224 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), ignore_topic(), and is_topic_ignored().

CORBA::Boolean DCPS_IR_Participant::isBIT_ [private]

Definition at line 205 of file DCPS_IR_Participant.h.

Referenced by dump_to_string(), is_bit(), and set_bit_status().

bool DCPS_IR_Participant::isBitPublisher_ [private]

Flag indicating this participant publishes built-in topics.

Definition at line 236 of file DCPS_IR_Participant.h.

Referenced by add_publication(), add_subscription(), add_topic_reference(), and isBitPublisher().

long DCPS_IR_Participant::owner_ [private]

Definition at line 208 of file DCPS_IR_Participant.h.

Referenced by changeOwner(), dump_to_string(), isOwner(), and owner().

ACE_SYNCH_MUTEX DCPS_IR_Participant::ownerLock_ [private]

Lock portions ownership processing.

Definition at line 211 of file DCPS_IR_Participant.h.

RepoIdGenerator DCPS_IR_Participant::publicationIdGenerator_ [private]

Definition at line 215 of file DCPS_IR_Participant.h.

Referenced by get_next_publication_id(), and last_publication_key().

DCPS_IR_Publication_Map DCPS_IR_Participant::publications_ [private]

Definition at line 219 of file DCPS_IR_Participant.h.

Referenced by add_publication(), dump_to_string(), find_publication_reference(), ignore_participant(), ignore_subscription(), ignore_topic(), publications(), remove_all_dependents(), remove_publication(), and ~DCPS_IR_Participant().

DDS::DomainParticipantQos DCPS_IR_Participant::qos_ [private]

Definition at line 202 of file DCPS_IR_Participant.h.

Referenced by get_qos(), and set_qos().

RepoIdGenerator DCPS_IR_Participant::subscriptionIdGenerator_ [private]

Definition at line 216 of file DCPS_IR_Participant.h.

Referenced by get_next_subscription_id(), and last_subscription_key().

DCPS_IR_Subscription_Map DCPS_IR_Participant::subscriptions_ [private]

Definition at line 218 of file DCPS_IR_Participant.h.

Referenced by add_subscription(), dump_to_string(), find_subscription_reference(), ignore_participant(), ignore_publication(), ignore_topic(), remove_all_dependents(), remove_subscription(), subscriptions(), and ~DCPS_IR_Participant().

RepoIdGenerator DCPS_IR_Participant::topicIdGenerator_ [private]

Definition at line 214 of file DCPS_IR_Participant.h.

Referenced by get_next_topic_id(), and last_topic_key().

DCPS_IR_Topic_Map DCPS_IR_Participant::topicRefs_ [private]

Definition at line 220 of file DCPS_IR_Participant.h.

Referenced by add_topic_reference(), dump_to_string(), find_topic_reference(), remove_all_dependents(), remove_topic_reference(), topics(), and ~DCPS_IR_Participant().

Update::Manager* DCPS_IR_Participant::um_ [private]

Definition at line 233 of file DCPS_IR_Participant.h.

Referenced by remove_all_dependents(), and takeOwnership().


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