SHOGUN
4.2.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
src
shogun
lib
RefCount.h
Go to the documentation of this file.
1
#include <
shogun/lib/config.h
>
2
3
#ifdef HAVE_CXX11_ATOMIC
4
#include <atomic>
5
#endif
6
7
#include <
shogun/lib/common.h
>
8
#include <
shogun/lib/Lock.h
>
9
10
#ifndef _REFCOUNT__H__
11
#define _REFCOUNT__H__
12
13
namespace
shogun
14
{
18
class
RefCount
19
{
20
public
:
25
RefCount
(int32_t ref_start=0) :
rc
(ref_start) {}
26
31
int32_t
ref
();
32
37
int32_t
unref
();
38
43
int32_t
ref_count
();
44
46
#ifdef HAVE_CXX11_ATOMIC
47
volatile
std::atomic<int>
rc
;
48
#else
49
int32_t
rc
;
50
52
CLock
lock
;
53
#endif
54
};
55
}
56
57
#endif //_REFCOUNT__H__
shogun::RefCount
Definition:
RefCount.h:18
Lock.h
shogun::RefCount::ref_count
int32_t ref_count()
Definition:
RefCount.cpp:31
config.h
shogun::RefCount::lock
CLock lock
Definition:
RefCount.h:52
shogun::RefCount::RefCount
RefCount(int32_t ref_start=0)
Definition:
RefCount.h:25
shogun::CLock
Class Lock used for synchronization in concurrent programs.
Definition:
Lock.h:17
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:18
shogun::RefCount::rc
int32_t rc
Definition:
RefCount.h:49
common.h
SHOGUN
Machine Learning Toolbox - Documentation