diff options
| author | Neo2003 <none@none> | 2008-10-04 06:17:19 -0500 |
|---|---|---|
| committer | Neo2003 <none@none> | 2008-10-04 06:17:19 -0500 |
| commit | 5651828bf74edb760d67700942fc65d51c816e0a (patch) | |
| tree | 1631f319bbc293794109f990beaccfd5b6cee8fe /dep/ACE_wrappers/ace/Dynamic.h | |
| parent | ca7a4bf1a78a1ddc6eb21238cc2a1633194a11cc (diff) | |
[svn] * Added ACE for Linux and Windows (Thanks Derex for Linux part and partial Windows part)
* Updated to 6721 and 676
* Fixed TrinityScript logo
* Version updated to 0.2.6721.676
--HG--
branch : trunk
rename : 6700-670 => 6721-676
Diffstat (limited to 'dep/ACE_wrappers/ace/Dynamic.h')
| -rw-r--r-- | dep/ACE_wrappers/ace/Dynamic.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/dep/ACE_wrappers/ace/Dynamic.h b/dep/ACE_wrappers/ace/Dynamic.h new file mode 100644 index 00000000000..70dfcd8d90a --- /dev/null +++ b/dep/ACE_wrappers/ace/Dynamic.h @@ -0,0 +1,75 @@ +// -*- C++ -*- + +//========================================================================== +/** + * @file Dynamic.h + * + * $Id: Dynamic.h 80826 2008-03-04 14:51:23Z wotte $ + * + * @author Doug Schmidt + * @author Irfan Pyarali. + */ +//========================================================================== + +#ifndef ACE_DYNAMIC_H +#define ACE_DYNAMIC_H +#include /**/ "ace/pre.h" + +#include /**/ "ace/ACE_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_Dynamic + * + * @brief Checks to see if an object was dynamically allocated. + * + * This class holds the pointer in a thread-safe manner between + * the call to operator new and the call to the constructor. + */ +class ACE_Export ACE_Dynamic +{ +public: + // = Initialization and termination method. + /// Constructor. + ACE_Dynamic (void); + + /// Destructor. + ~ACE_Dynamic (void); + + /** + * Sets a flag that indicates that the object was dynamically + * created. This method is usually called in operator new and then + * checked and reset in the constructor. + */ + void set (void); + + /// @c true if we were allocated dynamically, else @c false. + bool is_dynamic (void); + + /// Resets state flag. + void reset (void); + + static ACE_Dynamic *instance (void); + +private: + /** + * Flag that indicates that the object was dynamically created. This + * method is usually called in operator new and then checked and + * reset in the constructor. + */ + bool is_dynamic_; +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#if defined (__ACE_INLINE__) +#include "ace/Dynamic.inl" +#endif /* __ACE_INLINE__ */ + +#include /**/ "ace/post.h" +#endif /* ACE_DYNAMIC_H */ |
