Skip to content

Commit

Permalink
Use override/default, use operator!, layout changes
Browse files Browse the repository at this point in the history
    * tests/out/client.cpp:
    * tests/out/hello.cpp:
    * tests/out/hello.h:
    * tests/out/server.cpp:
  • Loading branch information
jwillemsen committed Nov 11, 2021
1 parent 9b3e372 commit 4e43b08
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 23 deletions.
6 changes: 3 additions & 3 deletions tests/out/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int main(int argc, char* argv[])
{
IDL::traits<CORBA::ORB>::ref_type _orb = CORBA::ORB_init (argc, argv);

if (_orb == nullptr)
if (!_orb)
{
TAOX11_TEST_ERROR << "ERROR: CORBA::ORB_init (argc, argv) returned null ORB." << std::endl;
return 1;
Expand All @@ -62,7 +62,7 @@ int main(int argc, char* argv[])

IDL::traits<Test::Hello_Factory>::ref_type hello_factory = IDL::traits<Test::Hello_Factory>::narrow (obj);

if (hello_factory == nullptr)
if (!hello_factory)
{
TAOX11_TEST_ERROR << "ERROR: IDL::traits<Test::Hello_Factory>::narrow (obj) returned null object." << std::endl;
return 1;
Expand All @@ -76,7 +76,7 @@ int main(int argc, char* argv[])
hello,
hello2);

if (hello == nullptr)
if (!hello)
{
TAOX11_TEST_ERROR << "ERROR: Test::Hello_Factory::get_hello () returned null object." << std::endl;
return 1;
Expand Down
17 changes: 3 additions & 14 deletions tests/out/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
#include "testlib/taox11_testlog.h"

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

Hello::~Hello()
: orb_ (std::move(orb))
{
}

Expand All @@ -30,9 +26,6 @@ Hello::shutdown ()
this->orb_->shutdown (false);
}




Hello2::Hello2 (IDL::traits<PortableServer::POA>::ref_type poa)
: poa_ (poa)
{
Expand All @@ -51,12 +44,8 @@ Hello2::get_string (IDL::traits<Test::StringInterface>::ref_type& si)

Hello_Factory::Hello_Factory (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa)
: orb_ (orb),
poa_ (poa)
{
}

Hello_Factory::~Hello_Factory()
: orb_ (std::move(orb)),
poa_ (std::move(poa))
{
}

Expand Down
10 changes: 5 additions & 5 deletions tests/out/hello.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Hello_Factory final
/// Constructor
Hello_Factory (IDL::traits<CORBA::ORB>::ref_type orb,
IDL::traits<PortableServer::POA>::ref_type poa);
virtual ~Hello_Factory ();
~Hello_Factory () override = default;

// = The skeleton methods
void get_hello (const std::string& log_string,
Expand All @@ -41,8 +41,8 @@ class StringInterface final
: public virtual CORBA::servant_traits<Test::StringInterface>::base_type
{
public:
StringInterface () {}
~StringInterface () {}
StringInterface () = default;
~StringInterface () override = default;
private:
StringInterface (const StringInterface&) = delete;
StringInterface (StringInterface&&) = delete;
Expand All @@ -56,8 +56,8 @@ class Hello final
{
public:
/// Constructor
Hello (IDL::traits<CORBA::ORB>::ref_type orb);
virtual ~Hello ();
explicit Hello (IDL::traits<CORBA::ORB>::ref_type orb);
~Hello () override = default;

// = The skeleton methods
std::string get_string () override;
Expand Down
2 changes: 1 addition & 1 deletion tests/out/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ main(int argc, ACE_TCHAR *argv[])
{
IDL::traits<CORBA::ORB>::ref_type _orb = CORBA::ORB_init (argc, argv);

if (_orb == nullptr)
if (!_orb)
{
TAOX11_TEST_ERROR << "ERROR: CORBA::ORB_init (argc, argv) returned null ORB." << std::endl;
return 1;
Expand Down

0 comments on commit 4e43b08

Please sign in to comment.