SHOGUN
4.1.0
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
lib
RefCount.h
浏览该文件的文档.
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
机器学习工具包 - 项目文档