Skip to content

Commit 591e906

Browse files
author
mikejiang
committed
Revert "#3"
This reverts commit c0a713e.
1 parent c0a713e commit 591e906

File tree

3 files changed

+18
-26
lines changed

3 files changed

+18
-26
lines changed

inst/include/cytolib/GatingHierarchy.hpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,6 @@ struct OurVertexPropertyWriterR {
8989

9090
class GatingHierarchy{
9191
private:
92-
unsigned short g_loglevel;// debug print is turned off by default
93-
9492
compensation comp; /*< compensation object */
9593

9694
/* compensation is currently done in R due to the linear Algebra
@@ -106,7 +104,7 @@ class GatingHierarchy{
106104

107105
public:
108106

109-
void set_loglevel(unsigned short _g_loglevel){g_loglevel = _g_loglevel;};
107+
110108

111109
/**
112110
* load the in-memory copy of frm
@@ -340,7 +338,7 @@ class GatingHierarchy{
340338
* , customized copy and assignment constructor is required
341339
*
342340
*/
343-
GatingHierarchy(const GatingHierarchy & _gh):g_loglevel(NO_LOG)
341+
GatingHierarchy(const GatingHierarchy & _gh)
344342
{
345343
comp = _gh.comp;
346344

@@ -367,8 +365,8 @@ class GatingHierarchy{
367365
* GatingHierarchy *curGh=new GatingHierarchy();
368366
* \endcode
369367
*/
370-
GatingHierarchy():g_loglevel(NO_LOG){}
371-
GatingHierarchy(compensation _comp, PARAM_VEC _transFlag, trans_local _trans):g_loglevel(NO_LOG),comp(_comp), transFlag(_transFlag),trans(_trans) {};
368+
GatingHierarchy(){}
369+
GatingHierarchy(compensation _comp, PARAM_VEC _transFlag, trans_local _trans):comp(_comp), transFlag(_transFlag),trans(_trans) {};
372370
void convertToPb(pb::GatingHierarchy & gh_pb){
373371
pb::populationTree * ptree = gh_pb.mutable_tree();
374372
/*
@@ -404,7 +402,7 @@ class GatingHierarchy{
404402

405403
}
406404

407-
GatingHierarchy(pb::GatingHierarchy & pb_gh, map<intptr_t, transformation *> & trans_tbl):g_loglevel(NO_LOG){
405+
GatingHierarchy(pb::GatingHierarchy & pb_gh, map<intptr_t, transformation *> & trans_tbl){
408406
const pb::populationTree & tree_pb = pb_gh.tree();
409407
int nNodes = tree_pb.node_size();
410408

inst/include/cytolib/GatingSet.hpp

+4-12
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ using namespace std;
3131
*
3232
*/
3333
class GatingSet{
34-
unsigned short g_loglevel;// debug print is turned off by default
3534

3635
biexpTrans globalBiExpTrans; //default bi-exponential transformation functions
3736
linTrans globalLinTrans;
@@ -53,13 +52,6 @@ class GatingSet{
5352
return ghs.find(sampleName);
5453
}
5554
size_t erase ( const string& k ){return ghs.erase(k);}
56-
57-
void set_loglevel(unsigned short _g_loglevel){
58-
g_loglevel = _g_loglevel;
59-
for(auto & it :ghs)
60-
it.second.set_loglevel(_g_loglevel);
61-
};
62-
unsigned short get_loglevel(){return g_loglevel;};
6355
/**
6456
* insert
6557
* @param sampleName
@@ -130,7 +122,7 @@ class GatingSet{
130122

131123
}
132124

133-
GatingSet():g_loglevel(NO_LOG){};
125+
GatingSet(){};
134126

135127
/**
136128
* separate filename from dir to avoid to deal with path parsing in c++
@@ -212,7 +204,7 @@ class GatingSet{
212204
* @param format
213205
* @param isPB
214206
*/
215-
GatingSet(string filename):g_loglevel(NO_LOG)
207+
GatingSet(string filename)
216208
{
217209
GOOGLE_PROTOBUF_VERIFY_VERSION;
218210
ifstream input(filename.c_str(), ios::in | ios::binary);
@@ -431,7 +423,7 @@ class GatingSet{
431423
* compensation and transformation,more options can be allowed in future like providing different
432424
* comp and trans
433425
*/
434-
GatingSet(const GatingHierarchy & gh_template,vector<string> sampleNames):g_loglevel(NO_LOG){
426+
GatingSet(const GatingHierarchy & gh_template,vector<string> sampleNames){
435427

436428

437429

@@ -466,7 +458,7 @@ class GatingSet{
466458
}
467459
}
468460

469-
GatingSet(vector<string> sampleNames):g_loglevel(NO_LOG){
461+
GatingSet(vector<string> sampleNames){
470462
vector<string>::iterator it;
471463
for(it=sampleNames.begin();it!=sampleNames.end();it++)
472464
{

inst/include/cytolib/global.hpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
#ifndef GLOBAL_HPP_
99
#define GLOBAL_HPP_
1010

11-
enum loglevel_t{
12-
NO_LOG = 0,
13-
GATING_SET_LEVEL = 1,
14-
GATING_HIERARCHY_LEVEL = 2,
15-
POPULATION_LEVEL = 3,
16-
GATE_LEVEL = 4
17-
};
11+
#define GATING_SET_LEVEL 1
12+
#define GATING_HIERARCHY_LEVEL 2
13+
#define POPULATION_LEVEL 3
14+
#define GATE_LEVEL 4
15+
16+
extern unsigned short g_loglevel;
17+
extern bool my_throw_on_error;
1818

1919
#ifdef ROUT
2020
#include <R_ext/Print.h>
@@ -27,6 +27,8 @@ enum loglevel_t{
2727
#include <vector>
2828
using namespace std;
2929

30+
extern unsigned short g_loglevel;// debug print is turned off by default
31+
extern bool my_throw_on_error;//can be toggle off to get a partially parsed gating tree for debugging purpose
3032

3133
inline void PRINT(string a){
3234
#ifdef ROUT

0 commit comments

Comments
 (0)