/usr/include/falcon/refcount.h is in falconpl-dev 0.9.6.9-git20120606-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | /*
FALCON - The Falcon Programming Language.
FILE: flc_refcount.h
Reference count system.
This is not intendended for VM or API usage, but only for
internal FALCON compiler(s) usage.
VM has special handling of refcounting when needed.
-------------------------------------------------------------------
Author: Giancarlo Niccolai
Begin: mer giu 9 2004
-------------------------------------------------------------------
(C) Copyright 2004: the FALCON developers (see list in AUTHORS file)
See LICENSE file for licensing details.
*/
/** \file
Reference count system.
This is not intendended for VM or API usage, but only for
internal FALCON compiler(s) usage.
VM has special handling of refcounting when needed.
*/
#ifndef FALCON_REFCOUNTER_H
#define FALCON_REFCOUNTER_H
namespace Falcon
{
template<class T>
class Refcounter
{
T m_item;
int m_count;
public:
Refcounter():
m_count(0)
{}
virtual ~Refcounter() {}
/** Creator.
Sets the count to zero. The creator must incref, it it wishes.
*/
Refcounter( const T &val ):
m_item( val ),
m_count(0)
{}
Refcounter( const Refcounter &source ):
m_item( source.m_item ),
m_count( 0 )
{}
void incref() { m_count++; }
void decref() { m_count--; if ( m_count <= 0 ) delete this ; }
T &access() { return m_item; }
T &operator *() { return m_item; }
};
}
#endif
/* end of flc_refcount.h */
|