| The Gaudi Framework v29r1 (5cd95fa2)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Public Attributes | List of all members
Gaudi::Parsers::Node Class Referencefinal

`#include <src/JobOptionsSvc/Node.h>`

Collaboration diagram for Gaudi::Parsers::Node:
[legend]

## Public Types
enum | NodeType { kRoot, kInclude, kIdentifier, kProperty, kOperation, kValue, kAssign, kEqual, kPlusEqual, kMinusEqual, kVector, kMap, kPair, kSimple, kString, kReal, kBool, kUnits, kUnit, kCondition, kIfdef, kIfndef, kElse, kPrintOptions, kPrintOn, kPrintOff, kShell, kPrintTree, kDumpFile, kPropertyRef, number_of_node_types }

## Public Member Functions
| Node ()=default
std::string | name () const
std::string | ToString (int indent=0) const

## Public Attributes
NodeType | type = kRoot
std::string | value
std::vector< Node > | children
Position | position

## Detailed Description

Definition at line 27 of file Node.h.

## Member Enumeration Documentation

enum Gaudi::Parsers::Node::NodeType

Enumerator
kRoot |
kInclude |
kIdentifier |
kProperty |
kOperation |
kValue |
kAssign |
kEqual |
kPlusEqual |
kMinusEqual |
kVector |
kMap |
kPair |
kSimple |
kString |
kReal |
kBool |
kUnits |
kUnit |
kCondition |
kIfdef |
kIfndef |
kElse |
kPrintOptions |
kPrintOn |
kPrintOff |
kShell |
kPrintTree |
kDumpFile |
kPropertyRef |
number_of_node_types |

Definition at line 30 of file Node.h.

30 {
31 kRoot,
32 kInclude,
33 kIdentifier,
34 kProperty,
35 kOperation,
36 kValue,
37 kAssign,
38 kEqual,
39 kPlusEqual,
40 kMinusEqual,
41 kVector,
42 kMap,
43 kPair,
44 kSimple,
45 kString,
46 kReal,
47 kBool,
48 kUnits,
49 kUnit,
50 kCondition,
51 kIfdef,
52 kIfndef,
53 kElse,
54 kPrintOptions,
55 kPrintOn,
56 kPrintOff,
57 kShell,
58 kPrintTree,
59 kDumpFile,
60 kPropertyRef,
61 number_of_node_types
62 };
Gaudi::Parsers::Node::kString
Definition: Node.h:45
Gaudi::Parsers::Node::kRoot
Definition: Node.h:31
Gaudi::Parsers::Node::kMap
Definition: Node.h:42
Gaudi::Parsers::Node::kPlusEqual
Definition: Node.h:39
Gaudi::Parsers::Node::kShell
Definition: Node.h:57
Gaudi::Parsers::Node::kPair
Definition: Node.h:43
Gaudi::Parsers::Node::kOperation
Definition: Node.h:35
Gaudi::Parsers::Node::kUnit
Definition: Node.h:49
Gaudi::Parsers::Node::kValue
Definition: Node.h:36
Gaudi::Parsers::Node::kIdentifier
Definition: Node.h:33
Gaudi::Parsers::Node::kIfdef
Definition: Node.h:51
Gaudi::Parsers::Node::kMinusEqual
Definition: Node.h:40
Gaudi::Parsers::Node::kElse
Definition: Node.h:53
Gaudi::Parsers::Node::kVector
Definition: Node.h:41
Gaudi::Parsers::Node::kEqual
Definition: Node.h:38
Gaudi::Parsers::Node::kPrintOff
Definition: Node.h:56
Gaudi::Parsers::Node::kAssign
Definition: Node.h:37
Gaudi::Parsers::Node::kCondition
Definition: Node.h:50
Gaudi::Parsers::Node::kBool
Definition: Node.h:47
Gaudi::Parsers::Node::kPrintOptions
Definition: Node.h:54
Gaudi::Parsers::Node::kSimple
Definition: Node.h:44
Gaudi::Parsers::Node::kPrintTree
Definition: Node.h:58
Gaudi::Parsers::Node::kInclude
Definition: Node.h:32
Gaudi::Parsers::Node::kPrintOn
Definition: Node.h:55
Gaudi::Parsers::Node::kUnits
Definition: Node.h:48
Gaudi::Parsers::Node::kIfndef
Definition: Node.h:52
Gaudi::Parsers::Node::number_of_node_types
Definition: Node.h:61
Gaudi::Parsers::Node::kDumpFile
Definition: Node.h:59
Gaudi::Parsers::Node::kProperty
Definition: Node.h:34
Gaudi::Parsers::Node::kPropertyRef
Definition: Node.h:60
Gaudi::Parsers::Node::kReal
Definition: Node.h:46

## Constructor & Destructor Documentation

Gaudi::Parsers::Node::Node | ( |  | ) |
| default

## Member Function Documentation

std::string Gaudi::Parsers::Node::name | ( |  | ) | const

Definition at line 48 of file Node.cpp.

49 {
50 static const auto names = init_names();
51 return names[type];
52 }
init_names
std::vector< std::string > init_names()
Definition: Node.cpp:11
Gaudi::Parsers::Node::type
NodeType type
Definition: Node.h:63

std::string Gaudi::Parsers::Node::ToString | ( | int | indent = `0` | ) | const

Definition at line 55 of file Node.cpp.

56 {
57
58 std::string result( indent, ' ' );
59 result += "<" + name();
60 if ( !value.empty() ) result += " value=\"" + value + "\"";
61 if ( position.line() != 0 ) result += " line=\"" + std::to_string( position.line() ) + "\"";
62 if ( position.column() != 0 ) result += " column=\"" + std::to_string( position.column() ) + "\"";
63 if ( children.empty() ) {
64 result += "/>\n";
65 } else {
66 result = std::accumulate( std::begin( children ), std::end( children ), result + ">\n",
67 [&]( std::string s, const gp::Node& node ) { return s + node.ToString( indent + 2 ); } )
68 .append( ' ', indent ) +
69 "</" + name() + ">\n";
70 }
71 return result;
72 }
std::string::empty
T empty(T...args)
Gaudi::Parsers::Node::name
std::string name() const
Definition: Node.cpp:48
Gaudi::Parsers::Position::column
unsigned column() const
Definition: Position.h:25
std::to_string
T to_string(T...args)
std::end
T end(T...args)
std::string
STL class.
Gaudi::Parsers::Position::line
unsigned line() const
Definition: Position.h:24
std::begin
T begin(T...args)
gaudirun.s
string s
Definition: gaudirun.py:253
std::accumulate
T accumulate(T...args)
Gaudi::Parsers::Node::value
std::string value
Definition: Node.h:64
Gaudi::Parsers::Node::position
Position position
Definition: Node.h:66
Gaudi::Parsers::Node::children
std::vector< Node > children
Definition: Node.h:65

## Member Data Documentation

std::vector<Node> Gaudi::Parsers::Node::children

Definition at line 65 of file Node.h.

Position Gaudi::Parsers::Node::position

Definition at line 66 of file Node.h.

NodeType Gaudi::Parsers::Node::type = kRoot

Definition at line 63 of file Node.h.

std::string Gaudi::Parsers::Node::value

Definition at line 64 of file Node.h.

The documentation for this class was generated from the following files:

- GaudiCoreSvc/src/JobOptionsSvc/Node.h
- GaudiCoreSvc/src/JobOptionsSvc/Node.cpp