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

69 lines
1.5 KiB
C++
Raw Normal View History

// -*- C++ -*-
2009-10-17 15:51:44 -07:00
//=============================================================================
/**
* @file Refcountable_T.h
*
* $Id: Refcountable_T.h 81409 2008-04-24 08:30:48Z johnnyw $
*
* @author Doug Schmidt
* @author Johnny Willemsen
*/
//=============================================================================
#ifndef ACE_REFCOUNTABLE_T_H
#define ACE_REFCOUNTABLE_T_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
#include "ace/Atomic_Op.h"
#include "ace/Synch_Traits.h"
2009-10-17 15:51:44 -07:00
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
2009-10-17 15:51:44 -07:00
template <class ACE_LOCK>
class ACE_Refcountable_T
{
public:
/// Destructor.
virtual ~ACE_Refcountable_T (void);
2009-10-17 15:51:44 -07:00
// = Increment/Decrement refcount
long increment (void);
long decrement (void);
2009-10-17 15:51:44 -07:00
/// Returns the current refcount.
long refcount (void) const;
2009-10-17 15:51:44 -07:00
protected:
/// Protected constructor.
ACE_Refcountable_T (long refcount);
2009-10-17 15:51:44 -07:00
/// Current refcount.
ACE_Atomic_Op <ACE_LOCK, long> refcount_;
};
2009-10-17 15:51:44 -07:00
typedef ACE_Refcountable_T<ACE_Null_Mutex> ACE_Refcountable;
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/Refcountable_T.inl"
#endif /* __ACE_INLINE__ */
2009-10-17 15:51:44 -07:00
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "ace/Refcountable_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
2009-10-17 15:51:44 -07:00
#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("Refcountable_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
2009-10-17 15:51:44 -07:00
#include /**/ "ace/post.h"
#endif /*ACE_REFCOUNTABLE_T_H*/
2009-02-17 20:07:49 -06:00