From 111b03f1c7a7970d0e3b262f475ab63de01d15f5 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Wed, 30 Dec 2020 09:27:14 +0100 Subject: 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: --- ACE/examples/DLL/Magazine.h | 5 ++--- ACE/examples/DLL/Newsweek.cpp | 3 +-- ACE/examples/DLL/Newsweek.h | 3 +-- ACE/examples/DLL/README | 2 -- ACE/examples/DLL/Today.cpp | 3 +-- ACE/examples/DLL/Today.h | 3 +-- ACE/examples/DLL/test_dll.cpp | 8 +++----- 7 files changed, 9 insertions(+), 18 deletions(-) (limited to 'ACE/examples') 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 typedef Magazine* (*Magazine_Creator) (void); @@ -42,7 +40,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } { - auto_ptr magazine (mc ()); + std::unique_ptr magazine (mc ()); magazine->title (); } @@ -76,7 +74,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) } { - auto_ptr magazine (mc ()); + std::unique_ptr magazine (mc ()); magazine->title (); } -- cgit v1.2.1