Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Dynamic.h
blob17c16e58a90829bcb0d37da15dbfb9cee2c41cbb
1 // -*- C++ -*-
3 //==========================================================================
4 /**
5 * @file Dynamic.h
7 * @author Doug Schmidt
8 * @author Irfan Pyarali.
9 */
10 //==========================================================================
12 #ifndef ACE_DYNAMIC_H
13 #define ACE_DYNAMIC_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "ace/ACE_export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 # pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
24 /**
25 * @class ACE_Dynamic
27 * @brief Checks to see if an object was dynamically allocated.
29 * This class holds the pointer in a thread-safe manner between
30 * the call to operator new and the call to the constructor.
32 class ACE_Export ACE_Dynamic
34 public:
35 /// Constructor.
36 ACE_Dynamic ();
38 /// Destructor.
39 ~ACE_Dynamic ();
41 /**
42 * Sets a flag that indicates that the object was dynamically
43 * created. This method is usually called in operator new and then
44 * checked and reset in the constructor.
46 void set ();
48 /// @c true if we were allocated dynamically, else @c false.
49 bool is_dynamic ();
51 /// Resets state flag.
52 void reset ();
54 static ACE_Dynamic *instance ();
56 ACE_ALLOC_HOOK_DECLARE;
58 private:
59 /**
60 * Flag that indicates that the object was dynamically created. This
61 * method is usually called in operator new and then checked and
62 * reset in the constructor.
64 bool is_dynamic_;
67 ACE_END_VERSIONED_NAMESPACE_DECL
69 #if defined (__ACE_INLINE__)
70 #include "ace/Dynamic.inl"
71 #endif /* __ACE_INLINE__ */
73 #include /**/ "ace/post.h"
74 #endif /* ACE_DYNAMIC_H */