C++ mpi module for stochmagnet_main Package
EXPR_TranslationFunction.h
1 #ifndef EXPR_TranslationFunction_H
2 #define EXPR_TranslationFunction_H
3 
4 #include "EXPR_Function.h"
5 
6 //numerics functions headers
7 #include "core_numeric.h"
8 
17 
18 
19 private:
20 
21 
22 private:
23  //associations
24 protected:
25  //builders
26 
30  setName("TRANSLATION");
31  }
32 
33  //deleters
37  }
38 
39 public:
40  //methods
41 
45  static inline CORE_UniquePointer<EXPR_TranslationFunction> New() {
46  CORE_UniquePointer<EXPR_TranslationFunction> p(new EXPR_TranslationFunction(),
48 
49  return p;
50  }
51 
52  //MEMORY
53  //======
61  virtual tMemSize getMemorySize() const override {
62  return sizeof(*this)+getContentsMemorySize();
63  }
64 
73  virtual tMemSize getContentsMemorySize() const override {
75  return mem;
76  }
77 
78 
83  virtual void apply(const std::vector<tString>& args,
84  EXPR_Node& node) const final {
85  std::array<tReal,3> x;
86  tReal *iX=x.data();
87  for(auto& arg:args) {
88  core_numeric::parse(arg,*iX);
89  iX++;
90  }
91 
92  node.translate(x);
93  }
94 
95 };
96 
97 #endif
98 
99 
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class described a function.
Definition: EXPR_Function.h:15
void setName(const tString &name)
set the name of the function
Definition: EXPR_Function.h:44
This class is a base class of the binary tree.
Definition: EXPR_Node.h:16
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_Object.h:70
This class describes.
Definition: EXPR_TranslationFunction.h:16
virtual tMemSize getMemorySize() const override
return the memory size of the class
Definition: EXPR_TranslationFunction.h:61
virtual ~EXPR_TranslationFunction()
delete the class
Definition: EXPR_TranslationFunction.h:36
static CORE_UniquePointer< EXPR_TranslationFunction > New()
return an unique instance of this class
Definition: EXPR_TranslationFunction.h:45
virtual void apply(const std::vector< tString > &args, EXPR_Node &node) const final
apply the function to the environment
Definition: EXPR_TranslationFunction.h:83
EXPR_TranslationFunction()
create the class
Definition: EXPR_TranslationFunction.h:29
virtual tMemSize getContentsMemorySize() const override
return nthe memory size of the included associations
Definition: EXPR_TranslationFunction.h:73