Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / DLL / Newsweek.cpp
blob52797d8ad4f4f49a4b4d3894eb262833476d1f4f
1 #define ACE_BUILD_SVC_DLL
3 #include "Newsweek.h"
4 #include "ace/Log_Msg.h"
5 #include "ace/svc_export.h"
6 #include "ace/OS_Memory.h"
8 // Implementation of the abstract class method which describes
9 // the magazine.
10 void Newsweek::title ()
12 ACE_DEBUG ((LM_DEBUG,
13 "Newsweek: Vol. 44923 Stardate: 12.3054\n"));
16 void *
17 Newsweek::operator new (size_t bytes)
19 return ::new char[bytes];
21 void *
22 Newsweek::operator new (size_t bytes, const std::nothrow_t&)
24 return ::new (std::nothrow) char[bytes];
26 void
27 Newsweek::operator delete (void *p, const std::nothrow_t&) noexcept
29 delete [] static_cast <char *> (p);
31 void
32 Newsweek::operator delete (void *ptr)
34 delete [] static_cast <char *> (ptr);
37 // Returns the Newsweek class pointer.
38 // The ACE_BUILD_SVC_DLL and ACE_Svc_Export directives are necessary to
39 // take care of exporting the function for Win32 platforms.
40 extern "C" ACE_Svc_Export Magazine *create_magazine ();
42 Magazine *
43 create_magazine ()
45 Magazine *mag = 0;
46 ACE_NEW_RETURN (mag, Newsweek, 0);
47 return mag;