MineLink
 All Data Structures Functions Variables Pages
ccols.h
1 #ifndef __DELPHOS_CCOLS_H__
2 #define __DELPHOS_CCOLS_H__
3 
4 #include <stdlib.h>
5 #include <string>
6 #include <vector>
7 
8 #include "named.h"
9 #include "exprtk.hpp"
10 
11 using namespace std;
12 
13 namespace delphos{
14 
15 #ifdef ARCH32
16 typedef unsigned long BlockIndexType;
17 #else
18 typedef unsigned int BlockIndexType;
19 #endif
20 
21 class BlockModel;
22 
23 
27 class Ccol: public Named
28 {
29 private:
30  exprtk::expression<double> _vexpr;
31  vector<unsigned int> _vars_column_index;
32  vector<double> _values;
33  bool _coord_use;
34  double _xvar;
35  double _yvar;
36  double _zvar;
37  string _formula;
38  const BlockModel& _bm;
39 
40  void ReplaceStringInPlace(std::string& subject, const std::string& search, const std::string& replace);
41 
42 public:
51  Ccol(const string& name,const delphos::BlockModel& bm);
55  ~Ccol();
61  void SetFormula(const string& formula);
65  string GetFormula() const;
70  vector<unsigned int> GetSubCols() const;
74  void CompileFormula();
80  double EvalFormula(const delphos::BlockIndexType& index);
81 
82 };
83 }
84 #endif
Abstracts a container of blocks as a table with arbitrary number of attributes that can be accessed b...
Definition: blockmodel.h:62
Abstracts a container of computed column.
Definition: ccols.h:27