Update of /cvsroot/cpptool/rfta/include/xtl
In directory sc8-pr-cvs1:/tmp/cvs-serv28468/include/xtl
Modified Files:
.cvsignore
Added Files:
IntrusiveCount.h
Log Message:
* added working python binding for code model statement
--- NEW FILE: IntrusiveCount.h ---
#ifndef XTL_INTRUSIVECOUNT_H_INCLUDED
#define XTL_INTRUSIVECOUNT_H_INCLUDED
#include <boost/detail/lightweight_mutex.hpp>
namespace boost {
class IntrusiveCount;
void intrusive_ptr_add_ref( IntrusiveCount *count );
void intrusive_ptr_release( IntrusiveCount *count );
class IntrusiveCount
{
public:
friend void ::boost::intrusive_ptr_add_ref( IntrusiveCount *count );
friend void ::boost::intrusive_ptr_release( IntrusiveCount *count );
IntrusiveCount()
: count_( 0 )
{
}
virtual ~IntrusiveCount()
{
}
int intrusiveCount() const
{
MutexType::scoped_lock lockGuard( lock_ );
return count_;
}
//private: // no friend template on VC56
void intrusiveAddRef()
{
MutexType::scoped_lock lockGuard( lock_ );
++count_;
}
void intrusiveRelease()
{
int newCount;
{
MutexType::scoped_lock lockGuard( lock_ );
newCount = --count_;
}
if ( newCount == 0 )
destructThis();
}
private:
virtual void destructThis()
{
delete this;
}
private:
typedef boost::detail::lightweight_mutex MutexType;
mutable MutexType lock_;
int count_;
};
inline void intrusive_ptr_add_ref( IntrusiveCount *count )
{
count->intrusiveAddRef();
}
inline void intrusive_ptr_release( IntrusiveCount *count )
{
count->intrusiveRelease();
}
} // namespace boost
namespace Xtl {
using ::boost::IntrusiveCount;
} // namespace Xtl
#endif // XTL_INTRUSIVECOUNT_H_INCLUDED
Index: .cvsignore
===================================================================
RCS file: /cvsroot/cpptool/rfta/include/xtl/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** .cvsignore 16 Mar 2003 07:36:39 -0000 1.1
--- .cvsignore 5 Apr 2003 18:28:57 -0000 1.2
***************
*** 1 ****
! *.h
--- 1,2 ----
! SequenceMap.h
!
|