diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-08-11 09:03:40 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2008-08-11 09:03:40 +0000 |
commit | 54dbd349b517687ee2464cf1363d7689fb312c49 (patch) | |
tree | e9c22e6c3b86f0d4d20eaec8c31f27b079c74d1d | |
parent | 1db0cc7f95d65b4eebe28efab88a8a5d6c923512 (diff) | |
download | ATCD-54dbd349b517687ee2464cf1363d7689fb312c49.tar.gz |
Mon Aug 11 09:02:15 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | TAO/ChangeLog | 9 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp | 32 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h | 12 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.inl | 4 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp | 49 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h | 4 |
6 files changed, 58 insertions, 52 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 821af36da14..ac3587cf5c0 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,12 @@ +Mon Aug 11 09:02:15 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> + + * orbsvcs/orbsvcs/Event/EC_ProxyConsumer.{h,cpp,inl}: + * orbsvcs/orbsvcs/Event/EC_ProxySupplier.{h,cpp}: + Initialise the is_gateway member to false, use bool and some + minor code improvements. Thanks to Joe Seward + <joseph dot f dot seward at saic dot com> for reporting this. This + fixes bugzilla 3392 + Fri Aug 8 16:30:11 UTC 2008 Johnny Willemsen <jwillemsen@remedy.nl> * orbsvcs/examples/Notify/Federation/Agent/Agent.cpp: diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp index c68688c480b..c05b97b6cc5 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.cpp @@ -23,7 +23,7 @@ TAO_EC_ProxyPushConsumer:: TAO_EC_ProxyPushConsumer (TAO_EC_Event_Channel_Base* ec) : event_channel_ (ec), refcount_ (1), - connected_ (0), + connected_ (false), filter_ (0) { this->lock_ = @@ -32,7 +32,7 @@ TAO_EC_ProxyPushConsumer:: this->default_POA_ = this->event_channel_->consumer_poa (); - this->qos_.is_gateway = 0; + this->qos_.is_gateway = false; } TAO_EC_ProxyPushConsumer::~TAO_EC_ProxyPushConsumer (void) @@ -53,14 +53,14 @@ TAO_EC_ProxyPushConsumer::supplier_non_existent ( CORBA::INTERNAL ()); disconnected = 0; - if (this->is_connected_i () == 0) + if (!this->is_connected_i ()) { - disconnected = 1; - return 0; + disconnected = true; + return false; } if (CORBA::is_nil (this->supplier_.in ())) { - return 0; + return false; } supplier = CORBA::Object::_duplicate (this->supplier_.in ()); } @@ -142,7 +142,7 @@ TAO_EC_ProxyPushConsumer::shutdown (void) RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); supplier = this->supplier_._retn (); - this->connected_ = 0; + this->connected_ = false; this->shutdown_hook (); @@ -175,7 +175,7 @@ TAO_EC_ProxyPushConsumer::cleanup_i (void) { this->supplier_ = RtecEventComm::PushSupplier::_nil (); - this->connected_ = 0; + this->connected_ = false; if (this->filter_ != 0) { @@ -243,7 +243,7 @@ TAO_EC_ProxyPushConsumer_Guard:: refcount_ (refcount), event_channel_ (ec), proxy_ (proxy), - locked_ (0) + locked_ (false) { ACE_Guard<ACE_Lock> ace_mon (*this->lock_); // If the guard fails there is not much we can do, raising an @@ -253,14 +253,14 @@ TAO_EC_ProxyPushConsumer_Guard:: // @@ Returning something won't work either, the error should be // logged though! - if (proxy->is_connected_i () == 0) - return; - - this->filter = this->proxy_->filter_i (); - this->filter->_incr_refcnt (); + if (proxy->is_connected_i ()) + { + this->filter = this->proxy_->filter_i (); + this->filter->_incr_refcnt (); - this->locked_ = 1; - this->refcount_++; + this->locked_ = true; + ++this->refcount_; + } } TAO_EC_ProxyPushConsumer_Guard:: diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h index 16f9e6056f6..2e9857cc19a 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.h @@ -77,7 +77,7 @@ public: /// Disconnect this from virtual void disconnect_push_consumer () = 0; - /// Return 0 if no supplier is connected... + /// Return false if no supplier is connected... CORBA::Boolean is_connected (void) const; /// Return the consumer object reference. It returns nil() if it has @@ -150,7 +150,7 @@ protected: /// If the flag is not zero then we are connected, notice that the /// supplier can be nil. - int connected_; + bool connected_; /// The publication and QoS information... RtecEventChannelAdmin::SupplierQOS qos_; @@ -166,9 +166,7 @@ private: virtual void shutdown_hook (void); virtual void refcount_zero_hook (void); - virtual PortableServer::ObjectId - object_id (void) - = 0; + virtual PortableServer::ObjectId object_id (void) = 0; }; // **************************************************************** @@ -213,9 +211,9 @@ private: /// The proxy whose lifetime is controlled by the reference count TAO_EC_ProxyPushConsumer *proxy_; - /// This flag is set to 1 if the reference count was successfully + /// This flag is set to true if the reference count was successfully /// acquired. - int locked_; + bool locked_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.inl b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.inl index 44ef91ef2e7..6eada65b541 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.inl +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxyConsumer.inl @@ -13,7 +13,7 @@ TAO_EC_ProxyPushConsumer::is_connected_i (void) const ACE_INLINE CORBA::Boolean TAO_EC_ProxyPushConsumer::is_connected (void) const { - ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); + ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, false); return this->is_connected_i (); } @@ -62,7 +62,7 @@ TAO_EC_ProxyPushConsumer::filter_i (void) const // **************************************************************** -ACE_INLINE int +ACE_INLINE bool TAO_EC_ProxyPushConsumer_Guard::locked (void) const { return this->locked_; diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp index fe70c2cf0fa..49052cc2ec7 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.cpp @@ -28,7 +28,7 @@ typedef ACE_Reverse_Lock<ACE_Lock> TAO_EC_Unlock; TAO_EC_ProxyPushSupplier::TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* ec, int validate_connection) : event_channel_ (ec), refcount_ (1), - suspended_ (0), + suspended_ (false), child_ (0), consumer_validate_connection_(validate_connection) { @@ -37,6 +37,8 @@ TAO_EC_ProxyPushSupplier::TAO_EC_ProxyPushSupplier (TAO_EC_Event_Channel_Base* e this->default_POA_ = this->event_channel_->supplier_poa (); + + this->qos_.is_gateway = false; } TAO_EC_ProxyPushSupplier::~TAO_EC_ProxyPushSupplier (void) @@ -97,7 +99,7 @@ TAO_EC_ProxyPushSupplier::shutdown (void) ACE_Lock, ace_mon, *this->lock_, RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); - int connected = this->is_connected_i (); + bool const connected = this->is_connected_i (); consumer = this->consumer_._retn (); @@ -194,10 +196,10 @@ TAO_EC_ProxyPushSupplier::filter (const RtecEventComm::EventSet& event, ACE_Lock, ace_mon, *this->lock_, RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); - if (this->is_connected_i () == 0) - return 0; - - result = this->child_->filter (event, qos_info); + if (this->is_connected_i ()) + { + result = this->child_->filter (event, qos_info); + } } return result; } @@ -216,10 +218,10 @@ TAO_EC_ProxyPushSupplier::filter_nocopy (RtecEventComm::EventSet& event, ACE_Lock, ace_mon, *this->lock_, RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); - if (this->is_connected_i () == 0) - return 0; - - result = this->child_->filter_nocopy (event, qos_info); + if (this->is_connected_i ()) + { + result = this->child_->filter_nocopy (event, qos_info); + } } return result; } @@ -230,10 +232,10 @@ TAO_EC_ProxyPushSupplier::push (const RtecEventComm::EventSet& event, { // The mutex is already held by the caller (usually the filter() // method) - if (this->is_connected_i () == 0) + if (!this->is_connected_i ()) return; // TAO_THROW (RtecEventComm::Disconnected ());???? - if (this->suspended_ != 0) + if (this->suspended_) return; TAO_ESF_RefCount_Guard<CORBA::ULong> ace_mon (this->refcount_); @@ -280,10 +282,10 @@ TAO_EC_ProxyPushSupplier::push_nocopy (RtecEventComm::EventSet& event, { // The mutex is already held by the caller (usually the filter() // method) - if (this->is_connected_i () == 0) + if (!this->is_connected_i ()) return; // TAO_THROW (RtecEventComm::Disconnected ());???? - if (this->suspended_ != 0) + if (this->suspended_) return; TAO_ESF_RefCount_Guard<CORBA::ULong> ace_mon (this->refcount_); @@ -328,10 +330,10 @@ TAO_EC_ProxyPushSupplier::push_to_consumer ( ACE_Lock, ace_mon, *this->lock_, RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); - if (this->is_connected_i () == 0) + if (!this->is_connected_i ()) return; // ACE_THROW (RtecEventComm::Disconnected ());???? - if (this->suspended_ != 0) + if (this->suspended_) return; } @@ -420,11 +422,11 @@ TAO_EC_ProxyPushSupplier::consumer_non_existent ( ACE_Lock, ace_mon, *this->lock_, CORBA::INTERNAL ()); - disconnected = 0; - if (this->is_connected_i () == 0) + disconnected = false; + if (!this->is_connected_i ()) { - disconnected = 1; - return 0; + disconnected = true; + return false; } consumer = CORBA::Object::_duplicate (this->consumer_.in ()); @@ -433,7 +435,7 @@ TAO_EC_ProxyPushSupplier::consumer_non_existent ( #if (TAO_HAS_MINIMUM_CORBA == 0) return consumer->_non_existent (); #else - return 0; + return false; #endif /* TAO_HAS_MINIMUM_CORBA */ } @@ -459,7 +461,7 @@ TAO_EC_ProxyPushSupplier::can_match ( { ACE_GUARD_RETURN (ACE_Lock, ace_mon, *this->lock_, 0); - if (this->is_connected_i () == 0) + if (!this->is_connected_i ()) return 0; return this->child_->can_match (header); @@ -474,8 +476,7 @@ TAO_EC_ProxyPushSupplier::add_dependencies ( ACE_Lock, ace_mon, *this->lock_, RtecEventChannelAdmin::EventChannel::SYNCHRONIZATION_ERROR ()); - return this->child_->add_dependencies (header, - qos_info); + return this->child_->add_dependencies (header, qos_info); } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h index 82dbfc8e7f9..cfe6e95cfc2 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h @@ -192,9 +192,7 @@ private: /// Template method hooks. virtual void refcount_zero_hook (void); virtual void pre_dispatch_hook (RtecEventComm::EventSet&); - virtual PortableServer::ObjectId - object_id (void) - = 0; + virtual PortableServer::ObjectId object_id (void) = 0; }; TAO_END_VERSIONED_NAMESPACE_DECL |