summaryrefslogtreecommitdiff
path: root/TAO/tao/Thread_Lane_Resources.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Thread_Lane_Resources.cpp')
-rw-r--r--TAO/tao/Thread_Lane_Resources.cpp190
1 files changed, 95 insertions, 95 deletions
diff --git a/TAO/tao/Thread_Lane_Resources.cpp b/TAO/tao/Thread_Lane_Resources.cpp
index edd83b85c5f..32bc8c072df 100644
--- a/TAO/tao/Thread_Lane_Resources.cpp
+++ b/TAO/tao/Thread_Lane_Resources.cpp
@@ -18,20 +18,20 @@ TAO_Thread_Lane_Resources::TAO_Thread_Lane_Resources (
TAO_ORB_Core &orb_core,
TAO_New_Leader_Generator *new_leader_generator)
: orb_core_ (orb_core),
- acceptor_registry_ (0),
- connector_registry_ (0),
- transport_cache_ (0),
- leader_follower_ (0),
+ acceptor_registry_ (nullptr),
+ connector_registry_ (nullptr),
+ transport_cache_ (nullptr),
+ leader_follower_ (nullptr),
new_leader_generator_ (new_leader_generator),
- input_cdr_dblock_allocator_ (0),
- input_cdr_buffer_allocator_ (0),
- input_cdr_msgblock_allocator_ (0),
- transport_message_buffer_allocator_ (0),
- output_cdr_dblock_allocator_ (0),
- output_cdr_buffer_allocator_ (0),
- output_cdr_msgblock_allocator_ (0),
- amh_response_handler_allocator_ (0),
- ami_response_handler_allocator_ (0)
+ input_cdr_dblock_allocator_ (nullptr),
+ input_cdr_buffer_allocator_ (nullptr),
+ input_cdr_msgblock_allocator_ (nullptr),
+ transport_message_buffer_allocator_ (nullptr),
+ output_cdr_dblock_allocator_ (nullptr),
+ output_cdr_buffer_allocator_ (nullptr),
+ output_cdr_msgblock_allocator_ (nullptr),
+ amh_response_handler_allocator_ (nullptr),
+ ami_response_handler_allocator_ (nullptr)
{
// Create the transport cache.
ACE_NEW (this->transport_cache_,
@@ -43,20 +43,20 @@ TAO_Thread_Lane_Resources::TAO_Thread_Lane_Resources (
orb_core.orbid ()));
}
-TAO_Thread_Lane_Resources::~TAO_Thread_Lane_Resources (void)
+TAO_Thread_Lane_Resources::~TAO_Thread_Lane_Resources ()
{
}
TAO::Transport_Cache_Manager &
-TAO_Thread_Lane_Resources::transport_cache (void)
+TAO_Thread_Lane_Resources::transport_cache ()
{
return *this->transport_cache_;
}
int
-TAO_Thread_Lane_Resources::has_acceptor_registry_been_created (void) const
+TAO_Thread_Lane_Resources::has_acceptor_registry_been_created () const
{
- return this->acceptor_registry_ != 0;
+ return this->acceptor_registry_ != nullptr;
}
int
@@ -71,10 +71,10 @@ TAO_Thread_Lane_Resources::is_collocated (const TAO_MProfile& mprofile)
}
TAO_Acceptor_Registry &
-TAO_Thread_Lane_Resources::acceptor_registry (void)
+TAO_Thread_Lane_Resources::acceptor_registry ()
{
// Double check.
- if (this->acceptor_registry_ == 0)
+ if (this->acceptor_registry_ == nullptr)
{
// @todo: Wouldnt this crash big time if you happen to
// dereference a null-pointer? Needs fixing.
@@ -83,7 +83,7 @@ TAO_Thread_Lane_Resources::acceptor_registry (void)
this->lock_,
*this->acceptor_registry_);
- if (this->acceptor_registry_ == 0)
+ if (this->acceptor_registry_ == nullptr)
{
// @@ Not exception safe code
// Get the resource factory.
@@ -100,23 +100,23 @@ TAO_Thread_Lane_Resources::acceptor_registry (void)
}
TAO_Connector_Registry *
-TAO_Thread_Lane_Resources::connector_registry (void)
+TAO_Thread_Lane_Resources::connector_registry ()
{
// Double check.
- if (this->connector_registry_ == 0)
+ if (this->connector_registry_ == nullptr)
{
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
ace_mon,
this->lock_,
- 0);
+ nullptr);
- if (this->connector_registry_ == 0)
+ if (this->connector_registry_ == nullptr)
{
// Ask it to create a new acceptor registry.
TAO_Connector_Registry *connector_registry =
this->orb_core_.resource_factory ()->get_connector_registry ();
- if (connector_registry == 0)
+ if (connector_registry == nullptr)
{
throw ::CORBA::INITIALIZE (
CORBA::SystemException::_tao_minor_code (
@@ -146,17 +146,17 @@ TAO_Thread_Lane_Resources::connector_registry (void)
TAO_Leader_Follower &
-TAO_Thread_Lane_Resources::leader_follower (void)
+TAO_Thread_Lane_Resources::leader_follower ()
{
// Double check.
- if (this->leader_follower_ == 0)
+ if (this->leader_follower_ == nullptr)
{
ACE_GUARD_RETURN (TAO_SYNCH_MUTEX,
ace_mon,
this->lock_,
*this->leader_follower_);
- if (this->leader_follower_ == 0)
+ if (this->leader_follower_ == nullptr)
{
// Create a new Leader Follower object.
ACE_NEW_RETURN (this->leader_follower_,
@@ -171,14 +171,14 @@ TAO_Thread_Lane_Resources::leader_follower (void)
ACE_Allocator*
-TAO_Thread_Lane_Resources::input_cdr_dblock_allocator (void)
+TAO_Thread_Lane_Resources::input_cdr_dblock_allocator ()
{
- if (this->input_cdr_dblock_allocator_ == 0)
+ if (this->input_cdr_dblock_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->input_cdr_dblock_allocator_ == 0)
+ if (this->input_cdr_dblock_allocator_ == nullptr)
{
this->input_cdr_dblock_allocator_ =
this->resource_factory ()->input_cdr_dblock_allocator ();
@@ -190,14 +190,14 @@ TAO_Thread_Lane_Resources::input_cdr_dblock_allocator (void)
ACE_Allocator*
-TAO_Thread_Lane_Resources::input_cdr_buffer_allocator (void)
+TAO_Thread_Lane_Resources::input_cdr_buffer_allocator ()
{
- if (this->input_cdr_buffer_allocator_ == 0)
+ if (this->input_cdr_buffer_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->input_cdr_buffer_allocator_ == 0)
+ if (this->input_cdr_buffer_allocator_ == nullptr)
{
this->input_cdr_buffer_allocator_ =
this->resource_factory ()->input_cdr_buffer_allocator ();
@@ -209,14 +209,14 @@ TAO_Thread_Lane_Resources::input_cdr_buffer_allocator (void)
ACE_Allocator*
-TAO_Thread_Lane_Resources::input_cdr_msgblock_allocator (void)
+TAO_Thread_Lane_Resources::input_cdr_msgblock_allocator ()
{
- if (this->input_cdr_msgblock_allocator_ == 0)
+ if (this->input_cdr_msgblock_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->input_cdr_msgblock_allocator_ == 0)
+ if (this->input_cdr_msgblock_allocator_ == nullptr)
{
this->input_cdr_msgblock_allocator_ =
this->resource_factory ()->input_cdr_msgblock_allocator ();
@@ -227,14 +227,14 @@ TAO_Thread_Lane_Resources::input_cdr_msgblock_allocator (void)
}
ACE_Allocator*
-TAO_Thread_Lane_Resources::transport_message_buffer_allocator (void)
+TAO_Thread_Lane_Resources::transport_message_buffer_allocator ()
{
- if (this->transport_message_buffer_allocator_ == 0)
+ if (this->transport_message_buffer_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->transport_message_buffer_allocator_ == 0)
+ if (this->transport_message_buffer_allocator_ == nullptr)
{
this->transport_message_buffer_allocator_ =
this->resource_factory ()->input_cdr_dblock_allocator ();
@@ -246,14 +246,14 @@ TAO_Thread_Lane_Resources::transport_message_buffer_allocator (void)
ACE_Allocator*
-TAO_Thread_Lane_Resources::output_cdr_dblock_allocator (void)
+TAO_Thread_Lane_Resources::output_cdr_dblock_allocator ()
{
- if (this->output_cdr_dblock_allocator_ == 0)
+ if (this->output_cdr_dblock_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->output_cdr_dblock_allocator_ == 0)
+ if (this->output_cdr_dblock_allocator_ == nullptr)
{
this->output_cdr_dblock_allocator_ =
this->resource_factory ()->output_cdr_dblock_allocator ();
@@ -265,14 +265,14 @@ TAO_Thread_Lane_Resources::output_cdr_dblock_allocator (void)
ACE_Allocator*
-TAO_Thread_Lane_Resources::output_cdr_buffer_allocator (void)
+TAO_Thread_Lane_Resources::output_cdr_buffer_allocator ()
{
- if (this->output_cdr_buffer_allocator_ == 0)
+ if (this->output_cdr_buffer_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->output_cdr_buffer_allocator_ == 0)
+ if (this->output_cdr_buffer_allocator_ == nullptr)
{
this->output_cdr_buffer_allocator_ =
this->resource_factory ()->output_cdr_buffer_allocator ();
@@ -284,14 +284,14 @@ TAO_Thread_Lane_Resources::output_cdr_buffer_allocator (void)
ACE_Allocator*
-TAO_Thread_Lane_Resources::output_cdr_msgblock_allocator (void)
+TAO_Thread_Lane_Resources::output_cdr_msgblock_allocator ()
{
- if (this->output_cdr_msgblock_allocator_ == 0)
+ if (this->output_cdr_msgblock_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->output_cdr_msgblock_allocator_ == 0)
+ if (this->output_cdr_msgblock_allocator_ == nullptr)
{
this->output_cdr_msgblock_allocator_ =
this->resource_factory ()->output_cdr_msgblock_allocator ();
@@ -302,14 +302,14 @@ TAO_Thread_Lane_Resources::output_cdr_msgblock_allocator (void)
}
ACE_Allocator*
-TAO_Thread_Lane_Resources::amh_response_handler_allocator (void)
+TAO_Thread_Lane_Resources::amh_response_handler_allocator ()
{
- if (this->amh_response_handler_allocator_ == 0)
+ if (this->amh_response_handler_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->amh_response_handler_allocator_ == 0)
+ if (this->amh_response_handler_allocator_ == nullptr)
{
this->amh_response_handler_allocator_ =
this->resource_factory ()->amh_response_handler_allocator ();
@@ -320,14 +320,14 @@ TAO_Thread_Lane_Resources::amh_response_handler_allocator (void)
}
ACE_Allocator*
-TAO_Thread_Lane_Resources::ami_response_handler_allocator (void)
+TAO_Thread_Lane_Resources::ami_response_handler_allocator ()
{
- if (this->ami_response_handler_allocator_ == 0)
+ if (this->ami_response_handler_allocator_ == nullptr)
{
// Double checked locking
- ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, 0);
+ ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, nullptr);
- if (this->ami_response_handler_allocator_ == 0)
+ if (this->ami_response_handler_allocator_ == nullptr)
{
this->ami_response_handler_allocator_ =
this->resource_factory ()->ami_response_handler_allocator ();
@@ -352,29 +352,29 @@ TAO_Thread_Lane_Resources::open_acceptor_registry (const TAO_EndpointSet &endpoi
}
TAO_Resource_Factory *
-TAO_Thread_Lane_Resources::resource_factory (void)
+TAO_Thread_Lane_Resources::resource_factory ()
{
return this->orb_core_.resource_factory ();
}
void
-TAO_Thread_Lane_Resources::finalize (void)
+TAO_Thread_Lane_Resources::finalize ()
{
// Close connectors before acceptors!
// Ask the registry to close all registered connectors.
- if (this->connector_registry_ != 0)
+ if (this->connector_registry_ != nullptr)
{
this->connector_registry_->close_all ();
delete this->connector_registry_;
- this->connector_registry_ = 0;
+ this->connector_registry_ = nullptr;
}
// Ask the registry to close all registered acceptors.
- if (this->acceptor_registry_ != 0)
+ if (this->acceptor_registry_ != nullptr)
{
this->acceptor_registry_->close_all ();
delete this->acceptor_registry_;
- this->acceptor_registry_ = 0;
+ this->acceptor_registry_ = nullptr;
}
// Set of handlers still in the connection cache.
@@ -389,7 +389,7 @@ TAO_Thread_Lane_Resources::finalize (void)
// Go through the handler set, closing the connections and removing
// the references.
- TAO_Connection_Handler **handler = 0;
+ TAO_Connection_Handler **handler = nullptr;
for (TAO::Connection_Handler_Set::iterator iter (handlers);
iter.next (handler);
@@ -403,80 +403,80 @@ TAO_Thread_Lane_Resources::finalize (void)
}
delete this->transport_cache_;
- this->transport_cache_ = 0;
+ this->transport_cache_ = nullptr;
delete this->leader_follower_;
- this->leader_follower_ = 0;
+ this->leader_follower_ = nullptr;
// Delete all the allocators here.. They shouldnt be done earlier,
// lest some of the contents in the above, say reactor or acceptor
// may use memory from the pool..
- if (this->input_cdr_dblock_allocator_ != 0)
+ if (this->input_cdr_dblock_allocator_ != nullptr)
{
this->input_cdr_dblock_allocator_->remove ();
delete this->input_cdr_dblock_allocator_;
- this->input_cdr_dblock_allocator_ = 0;
+ this->input_cdr_dblock_allocator_ = nullptr;
}
- if (this->input_cdr_buffer_allocator_ != 0)
+ if (this->input_cdr_buffer_allocator_ != nullptr)
{
this->input_cdr_buffer_allocator_->remove ();
delete this->input_cdr_buffer_allocator_;
- this->input_cdr_buffer_allocator_ = 0;
+ this->input_cdr_buffer_allocator_ = nullptr;
}
- if (this->input_cdr_msgblock_allocator_ != 0)
+ if (this->input_cdr_msgblock_allocator_ != nullptr)
{
this->input_cdr_msgblock_allocator_->remove ();
delete this->input_cdr_msgblock_allocator_;
- this->input_cdr_msgblock_allocator_ = 0;
+ this->input_cdr_msgblock_allocator_ = nullptr;
}
- if (this->transport_message_buffer_allocator_ != 0)
+ if (this->transport_message_buffer_allocator_ != nullptr)
{
this->transport_message_buffer_allocator_->remove ();
delete this->transport_message_buffer_allocator_;
- this->transport_message_buffer_allocator_ = 0;
+ this->transport_message_buffer_allocator_ = nullptr;
}
- if (this->output_cdr_dblock_allocator_ != 0)
+ if (this->output_cdr_dblock_allocator_ != nullptr)
{
this->output_cdr_dblock_allocator_->remove ();
delete this->output_cdr_dblock_allocator_;
- this->output_cdr_dblock_allocator_ = 0;
+ this->output_cdr_dblock_allocator_ = nullptr;
}
- if (this->output_cdr_buffer_allocator_ != 0)
+ if (this->output_cdr_buffer_allocator_ != nullptr)
{
this->output_cdr_buffer_allocator_->remove ();
delete this->output_cdr_buffer_allocator_;
- this->output_cdr_buffer_allocator_ = 0;
+ this->output_cdr_buffer_allocator_ = nullptr;
}
- if (this->output_cdr_msgblock_allocator_ != 0)
+ if (this->output_cdr_msgblock_allocator_ != nullptr)
{
this->output_cdr_msgblock_allocator_->remove ();
delete this->output_cdr_msgblock_allocator_;
- this->output_cdr_msgblock_allocator_ = 0;
+ this->output_cdr_msgblock_allocator_ = nullptr;
}
- if (this->amh_response_handler_allocator_ != 0)
+ if (this->amh_response_handler_allocator_ != nullptr)
{
this->amh_response_handler_allocator_->remove ();
delete this->amh_response_handler_allocator_;
- this->amh_response_handler_allocator_ = 0;
+ this->amh_response_handler_allocator_ = nullptr;
}
- if (this->ami_response_handler_allocator_ != 0)
+ if (this->ami_response_handler_allocator_ != nullptr)
{
this->ami_response_handler_allocator_->remove ();
delete this->ami_response_handler_allocator_;
- this->ami_response_handler_allocator_ = 0;
+ this->ami_response_handler_allocator_ = nullptr;
}
}
void
-TAO_Thread_Lane_Resources::shutdown_reactor (void)
+TAO_Thread_Lane_Resources::shutdown_reactor ()
{
TAO_Leader_Follower &leader_follower = this->leader_follower ();
@@ -508,11 +508,11 @@ TAO_Thread_Lane_Resources::shutdown_reactor (void)
}
void
-TAO_Thread_Lane_Resources::close_all_transports (void)
+TAO_Thread_Lane_Resources::close_all_transports ()
{
// If we have no-drop-reply strategy or already fininalized simply return.
if (!this->orb_core_.resource_factory ()->drop_replies_during_shutdown () ||
- this->transport_cache_ == 0)
+ this->transport_cache_ == nullptr)
return;
// Set of handlers still in the connection cache.
@@ -527,7 +527,7 @@ TAO_Thread_Lane_Resources::close_all_transports (void)
// Go through the handler set, closing the connections and removing
// the references.
- TAO_Connection_Handler **handler = 0;
+ TAO_Connection_Handler **handler = nullptr;
for (TAO::Connection_Handler_Set::iterator iter (handlers);
iter.next (handler);