~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to NuxCore/SmartPtr/NRefCount.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-01 19:25:37 UTC
  • Revision ID: neil.patel@canonical.com-20100901192537-mfz7rm6q262pewg6
Import and build NuxCore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef NREFCOUNT_H
 
2
#define NREFCOUNT_H
 
3
 
 
4
NAMESPACE_BEGIN
 
5
 
 
6
class NRefCount
 
7
{
 
8
public:
 
9
    NRefCount();
 
10
    virtual ~NRefCount();
 
11
    void Increment();
 
12
    void Decrement();
 
13
    t_u32 GetRefCount() const;
 
14
private:
 
15
    NThreadSafeCounter m_TSCounter;
 
16
    static NCriticalSection m_CriticalSection;
 
17
    
 
18
    template < class T > 
 
19
    friend class NSmartPtr;
 
20
    // or for gcc ???
 
21
    // template<class> friend class B; 
 
22
    // friend class B <class T>;
 
23
};
 
24
 
 
25
NAMESPACE_END
 
26
 
 
27
#endif // NREFCOUNT_H
 
28