Files
TCPlayerbotCore/dep/ACE_wrappers/ace/Dynamic.h
T

77 lines
1.7 KiB
C++
Raw Normal View History

// -*- C++ -*-
2009-10-17 15:51:44 -07:00
//==========================================================================
/**
* @file Dynamic.h
*
* $Id: Dynamic.h 80826 2008-03-04 14:51:23Z wotte $
*
* @author Doug Schmidt
* @author Irfan Pyarali.
*/
//==========================================================================
2009-10-17 15:51:44 -07:00
#ifndef ACE_DYNAMIC_H
#define ACE_DYNAMIC_H
#include /**/ "ace/pre.h"
2009-10-17 15:51:44 -07:00
#include /**/ "ace/ACE_export.h"
2009-10-17 15:51:44 -07:00
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
2009-10-17 15:51:44 -07:00
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
2009-10-17 15:51:44 -07:00
/**
* @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);
2009-10-17 15:51:44 -07:00
/// Destructor.
~ACE_Dynamic (void);
2009-10-17 15:51:44 -07:00
/**
* 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);
2009-10-17 15:51:44 -07:00
/// @c true if we were allocated dynamically, else @c false.
bool is_dynamic (void);
2009-10-17 15:51:44 -07:00
/// Resets state flag.
void reset (void);
2009-10-17 15:51:44 -07:00
static ACE_Dynamic *instance (void);
2009-10-17 15:51:44 -07:00
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_;
};
2009-10-17 15:51:44 -07:00
ACE_END_VERSIONED_NAMESPACE_DECL
2009-10-17 15:51:44 -07:00
#if defined (__ACE_INLINE__)
#include "ace/Dynamic.inl"
#endif /* __ACE_INLINE__ */
2009-10-17 15:51:44 -07:00
#include /**/ "ace/post.h"
#endif /* ACE_DYNAMIC_H */
2009-02-17 20:07:49 -06:00