Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::move, nullptr, const, layout changes #2325

Merged
merged 11 commits into from
Feb 7, 2025
Merged
5 changes: 0 additions & 5 deletions TAO/tao/DiffServPolicy/DiffServ_Network_Priority_Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

TAO_BEGIN_VERSIONED_NAMESPACE_DECL


TAO_DiffServ_Network_Priority_Hook::~TAO_DiffServ_Network_Priority_Hook()
{
}

void
TAO_DiffServ_Network_Priority_Hook::update_network_priority (
TAO_Root_POA &poa, TAO_POA_Policy_Set &policy_set)
Expand Down
6 changes: 3 additions & 3 deletions TAO/tao/DiffServPolicy/DiffServ_Network_Priority_Hook.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ class TAO_DiffServPolicy_Export TAO_DiffServ_Network_Priority_Hook
: public TAO_Network_Priority_Hook
{
public:
virtual ~TAO_DiffServ_Network_Priority_Hook();
~TAO_DiffServ_Network_Priority_Hook() override = default;

/// This function is a hook, that is called from the Root_POA's
/// constructor. It allows the POA to cache the server side network
/// priority policy, so that it can be used for sending replies with the
/// policy-specified DiffServ codepoint.
///
void update_network_priority (TAO_Root_POA &poa,
TAO_POA_Policy_Set &poa_policy_set);
TAO_POA_Policy_Set &poa_policy_set) override;

/// This function is a hook, that is used by the POA's servant dispatcher
/// when it tries to assign DiffServ codepoints on the replies.
///
void set_dscp_codepoint (TAO_ServerRequest &req,
TAO_Root_POA &poa);
TAO_Root_POA &poa) override;
};


Expand Down
12 changes: 0 additions & 12 deletions TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

TAO_DS_Network_Priority_Protocols_Hooks::
TAO_DS_Network_Priority_Protocols_Hooks ()
: orb_core_ (0)
{
}


TAO_DS_Network_Priority_Protocols_Hooks::
~TAO_DS_Network_Priority_Protocols_Hooks ()
{
}

void
TAO_DS_Network_Priority_Protocols_Hooks::init_hooks (TAO_ORB_Core *orb_core)
{
Expand Down
6 changes: 3 additions & 3 deletions TAO/tao/DiffServPolicy/DiffServ_Protocols_Hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class TAO_DiffServPolicy_Export TAO_DS_Network_Priority_Protocols_Hooks
{
public:
/// Constructor
TAO_DS_Network_Priority_Protocols_Hooks ();
TAO_DS_Network_Priority_Protocols_Hooks () = default;

/// Destructor
virtual ~TAO_DS_Network_Priority_Protocols_Hooks ();
virtual ~TAO_DS_Network_Priority_Protocols_Hooks () = default;

/// Initialize the network priority protocols hooks instance.
void init_hooks (TAO_ORB_Core *orb_core);
Expand All @@ -56,7 +56,7 @@ class TAO_DiffServPolicy_Export TAO_DS_Network_Priority_Protocols_Hooks
CORBA::Long get_dscp_codepoint (TAO_Service_Context &sc);

protected:
TAO_ORB_Core *orb_core_;
TAO_ORB_Core *orb_core_ {};
};


Expand Down
15 changes: 5 additions & 10 deletions TAO/tao/EndpointPolicy/EndpointPolicy_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ TAO_EndpointPolicy_i::TAO_EndpointPolicy_i (const TAO_EndpointPolicy_i &rhs)
{
}

TAO_EndpointPolicy_i::~TAO_EndpointPolicy_i ()
{
}


CORBA::PolicyType
TAO_EndpointPolicy_i::policy_type ()
{
Expand All @@ -31,28 +26,28 @@ TAO_EndpointPolicy_i::policy_type ()
TAO_EndpointPolicy_i *
TAO_EndpointPolicy_i::clone () const
{
TAO_EndpointPolicy_i *copy = 0;
TAO_EndpointPolicy_i *copy {};
ACE_NEW_RETURN (copy,
TAO_EndpointPolicy_i (*this),
0);
nullptr);
return copy;
}

EndpointPolicy::EndpointList *
TAO_EndpointPolicy_i::value ()
{
EndpointPolicy::EndpointList* list = 0;
EndpointPolicy::EndpointList* list {};
ACE_NEW_RETURN (list,
EndpointPolicy::EndpointList (this->value_),
0);
nullptr);

return list;
}

CORBA::Policy_ptr
TAO_EndpointPolicy_i::copy ()
{
TAO_EndpointPolicy_i* servant = 0;
TAO_EndpointPolicy_i* servant {};
ACE_NEW_THROW_EX (servant,
TAO_EndpointPolicy_i (*this),
CORBA::NO_MEMORY ());
Expand Down
2 changes: 1 addition & 1 deletion TAO/tao/EndpointPolicy/EndpointPolicy_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TAO_EndpointPolicy_Export TAO_EndpointPolicy_i
/// Copy constructor.
TAO_EndpointPolicy_i (const TAO_EndpointPolicy_i &rhs);

virtual ~TAO_EndpointPolicy_i ();
virtual ~TAO_EndpointPolicy_i () = default;

/// Returns a copy of this>
virtual TAO_EndpointPolicy_i *clone () const;
Expand Down
9 changes: 2 additions & 7 deletions TAO/tao/EndpointPolicy/Endpoint_Acceptor_Filter_Factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@

TAO_BEGIN_VERSIONED_NAMESPACE_DECL


TAO_Endpoint_Acceptor_Filter_Factory::~TAO_Endpoint_Acceptor_Filter_Factory()
{
}

TAO_Acceptor_Filter*
TAO_Endpoint_Acceptor_Filter_Factory::create_object (TAO_POA_Manager& poamanager)
TAO_Acceptor_Filter*
TAO_Endpoint_Acceptor_Filter_Factory::create_object (TAO_POA_Manager& poamanager)
{
CORBA::PolicyList& policies = poamanager.get_policies ();

Expand Down
2 changes: 1 addition & 1 deletion TAO/tao/EndpointPolicy/Endpoint_Acceptor_Filter_Factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class TAO_EndpointPolicy_Export TAO_Endpoint_Acceptor_Filter_Factory
: public TAO_Acceptor_Filter_Factory
{
public:
virtual ~TAO_Endpoint_Acceptor_Filter_Factory();
virtual ~TAO_Endpoint_Acceptor_Filter_Factory() = default;

/// Create a new TAO_Endpoint_Acceptor_Filter object.
TAO_Acceptor_Filter* create_object (TAO_POA_Manager& poamanager);
Expand Down
10 changes: 3 additions & 7 deletions TAO/tao/EndpointPolicy/IIOPEndpointValue_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@ IIOPEndpointValue_i::IIOPEndpointValue_i (const char *host, CORBA::UShort port)
this->addr_.set_type (-1);
}

IIOPEndpointValue_i::~IIOPEndpointValue_i ()
{
}

CORBA::Boolean
IIOPEndpointValue_i::is_equivalent (const TAO_Endpoint * endpoint) const
{
const TAO_IIOP_Endpoint *iep =
dynamic_cast<const TAO_IIOP_Endpoint *>(endpoint);
if (iep == 0)
return 0;
if (iep == nullptr)
return false;
return this->addr_.get_type() != -1 ? this->addr_ == iep->object_addr() :
this->is_equivalent_i (iep->port(), iep->host());
}
Expand All @@ -54,7 +50,7 @@ IIOPEndpointValue_i::validate_acceptor(TAO_Acceptor * acceptor,
bool is_multi_prot) const
{
TAO_IIOP_Acceptor *iacc = dynamic_cast<TAO_IIOP_Acceptor *>(acceptor);
if (iacc == 0)
if (iacc == nullptr)
return false;

#if 0
Expand Down
2 changes: 1 addition & 1 deletion TAO/tao/EndpointPolicy/IIOPEndpointValue_i.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class TAO_EndpointPolicy_Export IIOPEndpointValue_i :
/// of one-off values.
IIOPEndpointValue_i (const char *host, CORBA::UShort port);

virtual ~IIOPEndpointValue_i ();
virtual ~IIOPEndpointValue_i () = default;

/// The is_equivalent test is used by the endpoint policy framework
/// for testing if a target endpoint is the same as the endpoint
Expand Down
56 changes: 24 additions & 32 deletions TAO/tao/PortableServer/Active_Object_Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
{
TAO_Active_Object_Map::set_system_id_size (creation_parameters);

TAO_Id_Uniqueness_Strategy *id_uniqueness_strategy = 0;
TAO_Id_Uniqueness_Strategy *id_uniqueness_strategy {};

if (unique_id_policy)
{
Expand All @@ -118,7 +118,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
// Give ownership to the unique pointer.
std::unique_ptr<TAO_Id_Uniqueness_Strategy> new_id_uniqueness_strategy (id_uniqueness_strategy);

TAO_Lifespan_Strategy *lifespan_strategy = 0;
TAO_Lifespan_Strategy *lifespan_strategy {};

if (persistent_id_policy)
{
Expand All @@ -142,7 +142,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
// Give ownership to the unique pointer.
std::unique_ptr<TAO_Lifespan_Strategy> new_lifespan_strategy (lifespan_strategy);

TAO_Id_Assignment_Strategy *id_assignment_strategy = 0;
TAO_Id_Assignment_Strategy *id_assignment_strategy {};

if (user_id_policy)
{
Expand Down Expand Up @@ -177,7 +177,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
// Give ownership to the unique pointer.
std::unique_ptr<TAO_Id_Assignment_Strategy> new_id_assignment_strategy (id_assignment_strategy);

TAO_Id_Hint_Strategy *id_hint_strategy = 0;
TAO_Id_Hint_Strategy *id_hint_strategy {};
if ((user_id_policy
|| creation_parameters.allow_reactivation_of_system_ids_)
&& creation_parameters.use_active_hint_in_ids_)
Expand All @@ -199,7 +199,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
// Give ownership to the unique pointer.
std::unique_ptr<TAO_Id_Hint_Strategy> new_id_hint_strategy (id_hint_strategy);

servant_map *sm = 0;
servant_map *sm {};
if (unique_id_policy)
{
switch (creation_parameters.reverse_object_lookup_strategy_for_unique_id_policy_)
Expand Down Expand Up @@ -233,7 +233,7 @@ TAO_Active_Object_Map::TAO_Active_Object_Map (
// Give ownership to the unique pointer.
std::unique_ptr<servant_map> new_servant_map (sm);

user_id_map *uim = 0;
user_id_map *uim {};
if (user_id_policy
|| creation_parameters.allow_reactivation_of_system_ids_)
{
Expand Down Expand Up @@ -348,13 +348,13 @@ TAO_Active_Object_Map::is_user_id_in_map (
bool &priorities_match,
bool &deactivated)
{
TAO_Active_Object_Map_Entry *entry = 0;
TAO_Active_Object_Map_Entry *entry {};
bool result = false;
int const find_result = this->user_id_map_->find (user_id, entry);

if (find_result == 0)
{
if (entry->servant_ == 0)
if (entry->servant_ == nullptr)
{
if (entry->priority_ != priority)
{
Expand Down Expand Up @@ -388,9 +388,8 @@ int
TAO_Unique_Id_Strategy::is_servant_in_map (PortableServer::Servant servant,
bool &deactivated)
{
TAO_Active_Object_Map_Entry *entry = 0;
int result = this->active_object_map_->servant_map_->find (servant,
entry);
TAO_Active_Object_Map_Entry *entry{};
int result = this->active_object_map_->servant_map_->find (servant, entry);
if (result == 0)
{
result = 1;
Expand Down Expand Up @@ -420,7 +419,7 @@ TAO_Unique_Id_Strategy::bind_using_user_id (

if (result == 0)
{
if (servant != 0)
if (servant != nullptr)
{
entry->servant_ = servant;

Expand Down Expand Up @@ -451,24 +450,19 @@ TAO_Unique_Id_Strategy::bind_using_user_id (
if (result == 0)
{
result =
this->active_object_map_->user_id_map_->bind (entry->user_id_,
entry);
this->active_object_map_->user_id_map_->bind (entry->user_id_, entry);
if (result == 0)
{
if (servant != 0)
if (servant != nullptr)
{
result =
this->active_object_map_->servant_map_->bind (
entry->servant_,
entry);
this->active_object_map_->servant_map_->bind (entry->servant_, entry);
}

if (result != 0)
{
this->active_object_map_->user_id_map_->unbind (
entry->user_id_);
this->active_object_map_->id_hint_strategy_->unbind (
*entry);
this->active_object_map_->user_id_map_->unbind (entry->user_id_);
this->active_object_map_->id_hint_strategy_->unbind (*entry);
delete entry;
}
else
Expand Down Expand Up @@ -515,9 +509,8 @@ int
TAO_Unique_Id_Strategy::unbind_using_user_id (
const PortableServer::ObjectId &user_id)
{
TAO_Active_Object_Map_Entry *entry = 0;
int result = this->active_object_map_->user_id_map_->unbind (user_id,
entry);
TAO_Active_Object_Map_Entry *entry {};
int result = this->active_object_map_->user_id_map_->unbind (user_id, entry);
if (result == 0)
{
if (TAO_debug_level > 7)
Expand Down Expand Up @@ -563,7 +556,7 @@ TAO_Unique_Id_Strategy::find_user_id_using_servant (
PortableServer::Servant servant,
PortableServer::ObjectId_out user_id)
{
TAO_Active_Object_Map_Entry *entry = 0;
TAO_Active_Object_Map_Entry *entry {};
int result = this->active_object_map_->servant_map_->find (servant, entry);

if (result == 0)
Expand All @@ -589,7 +582,7 @@ TAO_Unique_Id_Strategy::find_system_id_using_servant (
PortableServer::ObjectId_out system_id,
CORBA::Short &priority)
{
TAO_Active_Object_Map_Entry *entry = 0;
TAO_Active_Object_Map_Entry *entry {};
int result = this->active_object_map_->servant_map_->find (servant,
entry);
if (result == 0)
Expand Down Expand Up @@ -640,12 +633,11 @@ TAO_Multiple_Id_Strategy::bind_using_user_id (
CORBA::Short priority,
TAO_Active_Object_Map_Entry *&entry)
{
int result =
this->active_object_map_->user_id_map_->find (user_id, entry);
int result = this->active_object_map_->user_id_map_->find (user_id, entry);

if (result == 0)
{
if (servant != 0)
if (servant != nullptr)
{
entry->servant_ = servant;
}
Expand Down Expand Up @@ -711,7 +703,7 @@ int
TAO_Multiple_Id_Strategy::unbind_using_user_id (
const PortableServer::ObjectId &user_id)
{
TAO_Active_Object_Map_Entry *entry = 0;
TAO_Active_Object_Map_Entry *entry {};
int result = this->active_object_map_->user_id_map_->unbind (user_id,
entry);
if (result == 0)
Expand Down Expand Up @@ -944,7 +936,7 @@ TAO_System_Id_With_Unique_Id_Strategy::bind_using_system_id (

if (result == 0)
{
if (servant != 0)
if (servant != nullptr)
{
result =
this->active_object_map_->servant_map_->bind (entry->servant_,
Expand Down
Loading