SHOGUN
v3.2.0
Main Page
Modules
Classes
Files
File List
File Members
src
shogun
lib
RefCount.h
Go to the documentation of this file.
1
#ifdef HAVE_CXX11_ATOMIC
2
#include <atomic>
3
#endif
4
5
#include <
shogun/lib/common.h
>
6
#include <
shogun/lib/Lock.h
>
7
8
#ifndef _REFCOUNT__H__
9
#define _REFCOUNT__H__
10
11
namespace
shogun
12
{
16
class
RefCount
17
{
18
public
:
23
RefCount
(int32_t ref_start=0) :
rc
(ref_start) {}
24
29
int32_t
ref
();
30
35
int32_t
unref
();
36
41
int32_t
ref_count
();
42
44
#ifdef HAVE_CXX11_ATOMIC
45
volatile
std::atomic<int>
rc
;
46
#else
47
int32_t
rc
;
48
50
CLock
lock
;
51
#endif
52
};
53
}
54
55
#endif //_REFCOUNT__H__
shogun::RefCount
Definition:
RefCount.h:16
Lock.h
shogun::RefCount::ref_count
int32_t ref_count()
Definition:
RefCount.cpp:31
shogun::RefCount::lock
CLock lock
Definition:
RefCount.h:50
shogun::RefCount::RefCount
RefCount(int32_t ref_start=0)
Definition:
RefCount.h:23
shogun::CLock
Class Lock used for synchronization in concurrent programs.
Definition:
Lock.h:14
shogun::RefCount::unref
int32_t unref()
Definition:
RefCount.cpp:18
shogun::RefCount::ref
int32_t ref()
Definition:
RefCount.cpp:5
shogun
all of classes and functions are contained in the shogun namespace
Definition:
class_list.h:16
shogun::RefCount::rc
int32_t rc
Definition:
RefCount.h:47
common.h
SHOGUN
Machine Learning Toolbox - Documentation