CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes
WalkAST Struct Reference

#include <TrackerDetIdSelector.h>

Public Types

typedef void result_type
 

Public Member Functions

void operator() () const
 
void operator() (int n) const
 
void operator() (std::string str) const
 
void operator() (ExpressionAST const &ast) const
 
void operator() (BinaryOP const &expr) const
 
void operator() (UnaryOP const &expr) const
 
 WalkAST (const DetId &detId, const TrackerTopology &trackerTopology)
 

Public Attributes

Accessor _acc
 

Detailed Description

Definition at line 214 of file TrackerDetIdSelector.h.

Member Typedef Documentation

typedef void WalkAST::result_type

Definition at line 223 of file TrackerDetIdSelector.h.

Constructor & Destructor Documentation

WalkAST::WalkAST ( const DetId detId,
const TrackerTopology trackerTopology 
)
inline

Definition at line 218 of file TrackerDetIdSelector.h.

218  :
219  _acc(detId,trackerTopology)
220  {
221  }

Member Function Documentation

void WalkAST::operator() ( ) const
inline

Definition at line 225 of file TrackerDetIdSelector.h.

225 {}
void WalkAST::operator() ( int  n) const
inline

Definition at line 226 of file TrackerDetIdSelector.h.

References gather_cfg::cout, and gen::n.

226 { std::cout << n; std::cout<<" ["<<_acc(n)<<"] "; }
void WalkAST::operator() ( std::string  str) const
inline

Definition at line 227 of file TrackerDetIdSelector.h.

References gather_cfg::cout, and str.

227 { std::cout << str; std::cout<<" ["<<_acc(str)<<"] "; }
#define str(s)
void WalkAST::operator() ( ExpressionAST const &  ast) const
inline

Definition at line 228 of file TrackerDetIdSelector.h.

References gather_cfg::cout, and ExpressionAST::expr.

229  {
230  boost::apply_visitor(*this, ast.expr);
231  std::cout<<" [="<<_acc(ast)<<"] ";
232  }
void WalkAST::operator() ( BinaryOP const &  expr) const
inline

Definition at line 234 of file TrackerDetIdSelector.h.

References BinaryOP::AND, gather_cfg::cout, BinaryOP::EQUAL, ExpressionAST::expr, BinaryOP::GREATER, BinaryOP::GREATER_EQUAL, BinaryOP::left, BinaryOP::LESS, BinaryOP::LESS_EQUAL, BinaryOP::NOT_EQUAL, BinaryOP::op, BinaryOP::OR, and BinaryOP::right.

235  {
236  std::cout << "(";
237  boost::apply_visitor(*this, expr.left.expr);
238  switch(expr.op)
239  {
241  std::cout<<" > ";
242  break;
244  std::cout<<" >= ";
245  break;
246  case BinaryOP::OP::EQUAL:
247  std::cout<<" == ";
248  break;
250  std::cout<<" <= ";
251  break;
252  case BinaryOP::OP::LESS:
253  std::cout<<" < ";
254  break;
256  std::cout<<" != ";
257  break;
258  case BinaryOP::OP::AND:
259  std::cout<<" && ";
260  break;
261  case BinaryOP::OP::OR:
262  std::cout<<" || ";
263  break;
264  }
265  boost::apply_visitor(*this, expr.right.expr);
266  std::cout << ')';
267  }
void WalkAST::operator() ( UnaryOP const &  expr) const
inline

Definition at line 269 of file TrackerDetIdSelector.h.

References gather_cfg::cout, ExpressionAST::expr, UnaryOP::NEG, UnaryOP::op, and UnaryOP::subject.

270  {
271  switch (expr.op)
272  {
273  case UnaryOP::OP::NEG:
274  std::cout<<" !(";
275  break;
276  }
277  boost::apply_visitor(*this, expr.subject.expr);
278  std::cout << ')';
279  }

Member Data Documentation

Accessor WalkAST::_acc

Definition at line 216 of file TrackerDetIdSelector.h.