Skip to content

Commit

Permalink
Move CORBA ORB in the constructor to prevent a copy
Browse files Browse the repository at this point in the history
  • Loading branch information
jwillemsen committed Mar 26, 2022
1 parent f5581d7 commit 5248ec0
Show file tree
Hide file tree
Showing 42 changed files with 55 additions and 57 deletions.
14 changes: 7 additions & 7 deletions tests/ami_test/ami/ami_test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
#include "ami_test_i.h"

AMI_Test_i::AMI_Test_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb),
yadda_ ((int32_t) 140474),
in_l_ ((int32_t) 931247),
in_l_last_ ((int32_t) 931235),
attr_bool_(true),
in_str_("Let's talk AMI."),
in_str_last_("Let's talk AMI the last time.")
: orb_ (std::move(orb)),
yadda_ ((int32_t) 140474),
in_l_ ((int32_t) 931247),
in_l_last_ ((int32_t) 931235),
attr_bool_(true),
in_str_("Let's talk AMI."),
in_str_last_("Let's talk AMI the last time.")
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ami_test/ami_in_out_inout/ami_test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <cmath>

AMI_Test_i::AMI_Test_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ami_test/annotations/ami_test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "ami_test_i.h"

AMI_Test_i::AMI_Test_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ami_test/exceptions/collocation/ami_coll_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Foo::Foo (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<Test::Bar>::ref_type bar,
CORBA::amic_traits<Test::Bar>::replyhandler_ref_type bar_handler,
CORBA::amic_traits<Test::Bar>::ref_type ami_bar_client)
: orb_ (orb)
: orb_ (std::move(orb))
, bar_ (bar)
, bar_handler_ (bar_handler)
, ami_bar_client_ (ami_bar_client)
Expand Down
2 changes: 1 addition & 1 deletion tests/ami_test/ostream/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "test_i.h"

Test_i::Test_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ami_test/replyhandler/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "test_i.h"

Test_i::Test_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
yadda_ = 0;
}
Expand Down
13 changes: 6 additions & 7 deletions tests/ami_test/use_of_gca/ami_test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@

#include "ami_test_i.h"

AMI_Test_i::AMI_Test_i (IDL::traits<CORBA::ORB>::ref_type orb
)
: orb_ (orb),
yadda_ ((int32_t) 0),
in_l_ ((int32_t) 931247),
inout_l_ ((int32_t) 300),
in_l_last_ ((int32_t) 931235)
AMI_Test_i::AMI_Test_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (std::move(orb)),
yadda_ ((int32_t) 0),
in_l_ ((int32_t) 931247),
inout_l_ ((int32_t) 300),
in_l_last_ ((int32_t) 931235)
{
}
int32_t
Expand Down
3 changes: 1 addition & 2 deletions tests/ami_test/weak_ref/ami_test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#include "ami_test_i.h"

AMI_Test_i::AMI_Test_i (IDL::traits<CORBA::ORB>::ref_type orb)

: orb_ (orb)
: orb_ (std::move(orb))
{
}
int32_t
Expand Down
2 changes: 1 addition & 1 deletion tests/any/anynonstandardtc/foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "testlib/taox11_testlog.h"

Foo::Foo (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/any/corbaseq/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "testlib/taox11_testlog.h"

Hello::Hello (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/custom_format/custom_format_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Test
// your constructor(s)
Foo_impl::Foo_impl (IDL::traits<CORBA::ORB>::ref_type orb)
: CORBA::servant_traits< ::Test::Foo>::base_type (),
orb_ (orb)
orb_ (std::move(orb))
{
// your constructor body
}
Expand Down
4 changes: 2 additions & 2 deletions tests/factory/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "hello.h"

Hello::Hello (IDL::traits<CORBA::ORB>::ref_type orb, IDL::traits<Test::Hello_Factory>::ref_type factory)
: orb_ (orb), factory_(factory)
: orb_ (std::move(orb)), factory_(factory)
{
}

Expand Down Expand Up @@ -41,7 +41,7 @@ Hello::shutdown ()

Hello_Factory::Hello_Factory (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa)
: orb_ (orb),
: orb_ (std::move(orb)),
poa_ (poa)
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/hello_regen/test_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Test
//@@{__RIDL_REGEN_MARKER__} - BEGIN : Test::Hello[Constructors]
Hello::Hello (IDL::traits<CORBA::ORB>::ref_type orb)
: CORBA::servant_traits< ::Test::Hello>::base_type ()
, orb_ (orb)
, orb_ (std::move(orb))
{
}
//@@{__RIDL_REGEN_MARKER__} - END : Test::Hello[Constructors]
Expand Down
2 changes: 1 addition & 1 deletion tests/interface/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ iF_impl::_cxx_do()
iFactory_impl::iFactory_impl (
IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa)
: orb_ (orb), poa_ (poa)
: orb_ (std::move(orb)), poa_ (poa)
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ior_table/forwarding/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "test_i.h"

Simple_Server_i::Simple_Server_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ior_table/ior_table/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

Hello::Hello (IDL::traits<CORBA::ORB>::ref_type orb,
bool rebinded)
: orb_ (orb)
: orb_ (std::move(orb))
, rebinded_ (rebinded)
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/ior_table/locator/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class Task final

Task::Task (IDL::traits<CORBA::ORB>::ref_type orb,
bool test_not_found)
: orb_ (orb)
: orb_ (std::move(orb))
, test_not_found_ (test_not_found)
{
}
Expand Down
4 changes: 2 additions & 2 deletions tests/is_equivalent/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "testlib/taox11_testlog.h"

Hello::Hello (IDL::traits<CORBA::ORB>::ref_type orb, IDL::traits<Test::Hello_Factory>::ref_type factory)
: orb_ (orb), factory_(factory)
: orb_ (std::move(orb)), factory_(factory)
{
}

Expand Down Expand Up @@ -88,7 +88,7 @@ Hello::equivalent_hello (IDL::traits<Test::Hello>::ref_type h)

Hello_Factory::Hello_Factory (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa)
: orb_ (orb),
: orb_ (std::move(orb)),
poa_ (poa)
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/mt/mt_bidir/server_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Server_Task::Server_Task (CORBA::servant_reference<Sender_i> sender,
, sender_ (sender)
, event_ (event)
, no_iterations_ (no_iterations)
, orb_ (orb)
, orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/mt/mt_client/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "test_i.h"

Simple_Server_i::Simple_Server_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/mt/mt_server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ main(int argc, char *argv[])
// ****************************************************************

Worker::Worker (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/mt/mt_server/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "testlib/taox11_testlog.h"

Simple_Server_i::Simple_Server_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/obv/any/anys_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define MAGIC 3145

Test_impl::Test_impl (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/obv/forward/test_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "treebaseC.h"

Test_impl::Test_impl (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/obv/supports/supports_test_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ vt_graph_init_impl::create_for_unmarshal ()

/* test_impl */

test_impl::test_impl (CORBA::ORB::_ref_type orb) : orb_ (orb)
test_impl::test_impl (CORBA::ORB::_ref_type orb) : orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/ostreamnamespace/foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "foo.h"

Foo::Foo (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/poa/adapter_activator/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MyAdapter_Activator::MyAdapter_Activator (IDL::traits<PortableServer::POAManager
CORBA::PolicyList& first_policies,
CORBA::PolicyList& second_policies)
: poa_manager_ (poa_manager)
, orb_ (orb)
, orb_ (std::move(orb))
, first_poa_policies_(first_policies)
, second_poa_policies_(second_policies)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/poa/currentservant/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "hello.h"

Hello::Hello(IDL::traits<CORBA::ORB>::ref_type orb) :
orb_ (orb)
orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/poa/forwarding/servant_activator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
ServantActivator::ServantActivator (
IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<CORBA::Object>::ref_type forward_to)
: orb_ (orb)
: orb_ (std::move(orb))
, forward_to_ (forward_to)
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/poa/forwarding/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_i::test_i (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa,
IDL::traits<PortableServer::ServantActivator>::weak_ref_type activator,
int32_t value)
: orb_ (orb),
: orb_ (std::move(orb)),
poa_ (poa),
activator_ (activator),
value_ (value)
Expand Down
2 changes: 1 addition & 1 deletion tests/poa/generic_servant/test_i.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// Constructor
test_i::test_i (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa)
: orb_ (orb),
: orb_ (std::move(orb)),
poa_ (poa)
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/poa/loader/servant_activator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
ServantActivator::ServantActivator (IDL::traits<CORBA::ORB>::ref_type orb,
const std::string& dllname,
const std::string& factory_function)
: orb_ (orb), result_(0)
: orb_ (std::move(orb)), result_(0)
{
// The dll is opened using the dllname passed.
if (this->dll_.open (dllname.c_str()) == -1)
Expand Down
2 changes: 1 addition & 1 deletion tests/poa/loader/servant_locator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
ServantLocator::ServantLocator (IDL::traits<CORBA::ORB>::ref_type orb,
const std::string& dllname,
const std::string& factory_function)
: orb_ (orb), result_(0)
: orb_ (std::move(orb)), result_(0)
{
// The dll is opened using the dllname passed.
if (this->dll_.open (dllname.c_str()) == -1)
Expand Down
2 changes: 1 addition & 1 deletion tests/poa/this/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "testlib/taox11_testlog.h"

Hello::Hello(IDL::traits<CORBA::ORB>::ref_type orb) :
orb_ (orb)
orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/policies/oneway_timeouts/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Tester_i final
};

Tester_i::Tester_i (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
, id1_ (0)
, id2_ (0)
, count_ (0)
Expand Down
2 changes: 1 addition & 1 deletion tests/policies/reliable_oneways/oneway_receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

Oneway_Receiver::Oneway_Receiver (
IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/policies/reliable_oneways/shutdown_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "shutdown_helper.h"

Shutdown_Helper::Shutdown_Helper (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
2 changes: 1 addition & 1 deletion tests/sequence/foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ TestBounded<BASE, SEQ>::test_bounded_ret ()

Foo::Foo (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa)
: orb_ (orb)
: orb_ (std::move(orb))
, poa_ (poa)
{
}
Expand Down
2 changes: 1 addition & 1 deletion tests/struct/foo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "foo.h"

Foo::Foo (IDL::traits<CORBA::ORB>::ref_type orb)
: orb_ (orb)
: orb_ (std::move(orb))
{
}

Expand Down
Loading

0 comments on commit 5248ec0

Please sign in to comment.