CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AlgoPos.h
Go to the documentation of this file.
1 #ifndef ExprAlgo_AlgoPos_h
2 #define ExprAlgo_AlgoPos_h
3 
4 #include <iostream>
5 #include <vector>
6 #include <string>
7 
11 //#include "DetectorDescription/Core/src/DDNamedObject.h"
12 
13 
14 class AlgoImpl;
15 class AlgoCheck;
16 
18 
27 class AlgoPos
28 {
29  friend class AlgoImpl;
30 public:
32  AlgoPos(AlgoCheck * check=0);
33  //AlgoPos();
34 
36  ~AlgoPos();
37 
39  void setParameters(int start, int end, int incr,
40  const parS_type &, const parE_type &);
41 
43  bool go() const;
44 
46  void next();
47 
49 
54 
56 
61 
63  int copyno() const;
64 
66  void stream(std::ostream & os) const;
67 
69 
78  void registerAlgo(AlgoImpl *);
79 
81  size_t numRegistered();
82 
83  int start() const { return start_; }
84  int end() const { return end_; }
85  int incr() const { return incr_; }
86  const parS_type & parS() const { return ParS_; }
87  const parE_type & parE() const { return ParE_; }
88 
89 protected:
91 
95  void terminate();
96 
98 
114  void checkTermination();
115 
117 
125  bool select();
126  //bool checkParameters();
127 
129 
139 
141 
146  int curr_;
147 
149 
153  int count_;
154 
156 
162 
164 
170 
173 
175  std::string err_;
176 
178  std::vector<AlgoImpl*> regAlgos_;
179 
182 
185 
186 private:
187 };
188 #endif
int end_
Definition: AlgoPos.h:138
base class for generated checking code for algorithm parameters.
Definition: AlgoCheck.h:10
AlgoImpl * selAlgo_
selected algorithm implementation
Definition: AlgoPos.h:181
bool select()
selection of one of the registered AlgoImpl
Definition: AlgoPos.cc:157
class for algorithmic positioning, represents an algorithm
Definition: AlgoPos.h:27
int curr_
current position in the range of the algorithm
Definition: AlgoPos.h:146
void checkTermination()
for algorithms with incr_==0 the algorithm must check whether to terminate
Definition: AlgoPos.cc:127
void stream(std::ostream &os) const
streams some information about common parameters and the name of the algorithm
Definition: AlgoPos.cc:197
size_t numRegistered()
return number of registered implementations
Definition: AlgoPos.cc:77
int copyno() const
copy-number calculation
Definition: AlgoPos.cc:82
int incr() const
Definition: AlgoPos.h:85
void setParameters(int start, int end, int incr, const parS_type &, const parE_type &)
sets mandatory and optional parameters
Definition: AlgoPos.cc:25
std::vector< AlgoImpl * > regAlgos_
registry of algorithm implementation objects
Definition: AlgoPos.h:178
void terminate()
terminates current algorithmic processing
Definition: AlgoPos.cc:133
AlgoPos(AlgoCheck *check=0)
creates an algorithm named name
Definition: AlgoPos.cc:8
void next()
update for next iteration of the algorithm, don&#39;t call it yourself!
Definition: AlgoPos.cc:96
int count_
invocation count
Definition: AlgoPos.h:153
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
DDRotationMatrix rotation()
rotation calculations
Definition: AlgoPos.cc:151
int start() const
Definition: AlgoPos.h:83
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
std::map< std::string, std::vector< std::string > > parS_type
Definition: DDAlgoPar.h:9
const parE_type & parE() const
Definition: AlgoPos.h:87
implementation of an algorithm, non generated checking code.
Definition: AlgoImpl.h:19
~AlgoPos()
destructor clears registered AlgoImpl
Definition: AlgoPos.cc:14
int start_
range of the algorithm
Definition: AlgoPos.h:138
parS_type ParS_
std::string valued parameters passed to the algorithm
Definition: AlgoPos.h:161
const parS_type & parS() const
Definition: AlgoPos.h:86
bool terminate_
flag to signal whether the algorithm has finished (true)
Definition: AlgoPos.h:172
parE_type ParE_
double valued parameters passed to the algorithm
Definition: AlgoPos.h:169
void registerAlgo(AlgoImpl *)
registers an implementation of the algorithm
Definition: AlgoPos.cc:72
int incr_
Definition: AlgoPos.h:138
bool go() const
no further algorithm processing if go() returns false
Definition: AlgoPos.cc:139
int end() const
Definition: AlgoPos.h:84
DD3Vector translation()
translation calculations
Definition: AlgoPos.cc:145
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
std::map< std::string, std::vector< double > > parE_type
Definition: DDAlgoPar.h:12
AlgoCheck * checkAlgo_
checking object which checks the user-supplied parameters whether they fulfill their spec...
Definition: AlgoPos.h:184
std::string err_
std::string to hold potential error messages found inside checkParameters()
Definition: AlgoPos.h:175