diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-30 09:27:14 +0100 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2020-12-30 09:27:14 +0100 |
commit | 111b03f1c7a7970d0e3b262f475ab63de01d15f5 (patch) | |
tree | 606998eedbc20b51d65ac961bff2a5862f9d94e8 | |
parent | 366bebf1615b2c607d2fa80a44f770889676511e (diff) | |
download | ATCD-111b03f1c7a7970d0e3b262f475ab63de01d15f5.tar.gz |
Replace auto_ptr with unique_ptr, use override, remove redundant void
* ACE/examples/DLL/Magazine.h:
* ACE/examples/DLL/Newsweek.cpp:
* ACE/examples/DLL/Newsweek.h:
* ACE/examples/DLL/README:
* ACE/examples/DLL/Today.cpp:
* ACE/examples/DLL/Today.h:
* ACE/examples/DLL/test_dll.cpp:
-rw-r--r-- | ACE/examples/DLL/Magazine.h | 5 | ||||
-rw-r--r-- | ACE/examples/DLL/Newsweek.cpp | 3 | ||||
-rw-r--r-- | ACE/examples/DLL/Newsweek.h | 3 | ||||
-rw-r--r-- | ACE/examples/DLL/README | 2 | ||||
-rw-r--r-- | ACE/examples/DLL/Today.cpp | 3 | ||||
-rw-r--r-- | ACE/examples/DLL/Today.h | 3 | ||||
-rw-r--r-- | ACE/examples/DLL/test_dll.cpp | 8 |
7 files changed, 9 insertions, 18 deletions
diff --git a/ACE/examples/DLL/Magazine.h b/ACE/examples/DLL/Magazine.h index 85413e98aa4..c21049f38ec 100644 --- a/ACE/examples/DLL/Magazine.h +++ b/ACE/examples/DLL/Magazine.h @@ -26,12 +26,11 @@ class Magazine { public: - /// No-op virtual destructor. - virtual ~Magazine (void) {}; + virtual ~Magazine () {}; /// This method gives the title of the magazine. - virtual void title (void) = 0; + virtual void title () = 0; }; #endif /* MAGAZINE_H */ diff --git a/ACE/examples/DLL/Newsweek.cpp b/ACE/examples/DLL/Newsweek.cpp index e0251b0b906..4de6025b7f0 100644 --- a/ACE/examples/DLL/Newsweek.cpp +++ b/ACE/examples/DLL/Newsweek.cpp @@ -7,8 +7,7 @@ // Implementation of the abstract class method which describes // the magazine. - -void Newsweek::title (void) +void Newsweek::title () { ACE_DEBUG ((LM_DEBUG, "Newsweek: Vol. 44923 Stardate: 12.3054\n")); diff --git a/ACE/examples/DLL/Newsweek.h b/ACE/examples/DLL/Newsweek.h index ddf97a96604..18175311771 100644 --- a/ACE/examples/DLL/Newsweek.h +++ b/ACE/examples/DLL/Newsweek.h @@ -34,9 +34,8 @@ class Newsweek : public Magazine { public: - // This is the abstract class method which describes the magazine. - void title (void); + void title () override; // Overload the new/delete opertors so the object will be // created/deleted using the memory allocator associated with the diff --git a/ACE/examples/DLL/README b/ACE/examples/DLL/README index 0186adfcf95..e22769bf488 100644 --- a/ACE/examples/DLL/README +++ b/ACE/examples/DLL/README @@ -1,5 +1,3 @@ - - DLL Test Example ---------------- diff --git a/ACE/examples/DLL/Today.cpp b/ACE/examples/DLL/Today.cpp index 6427778bd34..522bc6352ec 100644 --- a/ACE/examples/DLL/Today.cpp +++ b/ACE/examples/DLL/Today.cpp @@ -7,9 +7,8 @@ // Implementation of the abstract class method which describes the // magazine. - void -Today::title (void) +Today::title () { ACE_DEBUG ((LM_DEBUG, "Today: XML Special Apr 02\n")); diff --git a/ACE/examples/DLL/Today.h b/ACE/examples/DLL/Today.h index 14fb80459c2..def10393c7f 100644 --- a/ACE/examples/DLL/Today.h +++ b/ACE/examples/DLL/Today.h @@ -34,10 +34,9 @@ class Today : public Magazine { public: - // The virtual abstract class method which returns the title of the // magazine. - void title (void); + void title () override; // Overload the new/delete opertors so the object will be // created/deleted using the memory allocator associated with the diff --git a/ACE/examples/DLL/test_dll.cpp b/ACE/examples/DLL/test_dll.cpp index 74b53aee98e..5eb1276cc80 100644 --- a/ACE/examples/DLL/test_dll.cpp +++ b/ACE/examples/DLL/test_dll.cpp @@ -3,10 +3,8 @@ #include "Magazine.h" #include "ace/DLL.h" -#include "ace/Auto_Ptr.h" #include "ace/Log_Msg.h" - - +#include <memory> typedef Magazine* (*Magazine_Creator) (void); @@ -42,7 +40,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } { - auto_ptr <Magazine> magazine (mc ()); + std::unique_ptr<Magazine> magazine (mc ()); magazine->title (); } @@ -76,7 +74,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } { - auto_ptr <Magazine> magazine (mc ()); + std::unique_ptr<Magazine> magazine (mc ()); magazine->title (); } |