Skip to content

Commit bb55319

Browse files
author
mikejiang
committed
add CYTOLIB_INIT() macro. #3
1 parent 591e906 commit bb55319

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`cytolib` provides the c++ headers for users to use and interact with the `GatingSet` (the gated cytometry data structure) at c++ level.
44

5-
5+
###Installation
66
The **cytolib** package is installed via `R CMD INSTALL ...`.
77

88
R packages wishing to use the libraries in `cytolib` only need to:
@@ -13,5 +13,7 @@ e.g.
1313
```
1414
LinkingTo: cytolib
1515
```
16+
###Usage
17+
Make sure to call `CYTOLIB_INIT()` in user c code
1618

1719
See **flowWorkspace** package for the example of using `cytolib`.

inst/include/cytolib/global.hpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
#define POPULATION_LEVEL 3
1414
#define GATE_LEVEL 4
1515

16-
extern unsigned short g_loglevel;
17-
extern bool my_throw_on_error;
1816

1917
#ifdef ROUT
2018
#include <R_ext/Print.h>
@@ -29,6 +27,9 @@ using namespace std;
2927

3028
extern unsigned short g_loglevel;// debug print is turned off by default
3129
extern bool my_throw_on_error;//can be toggle off to get a partially parsed gating tree for debugging purpose
30+
#define CYTOLIB_INIT() \
31+
bool my_throw_on_error = true;\
32+
unsigned short g_loglevel = 0;\
3233

3334
inline void PRINT(string a){
3435
#ifdef ROUT

0 commit comments

Comments
 (0)