| The Gaudi Framework v30r0 (c919700c)

- 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 Struct 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 28 of file Node.h.

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

## 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:61

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::Position::column
unsigned column() const
Definition: Position.h:25
std::to_string
T to_string(T...args)
std::end
T end(T...args)
Gaudi::Parsers::Node::name
std::string name() const
Definition: Node.cpp:48
std::string
STL class.
Gaudi::Parsers::Position::line
unsigned line() const
Definition: Position.h:24
Gaudi::Parsers::Node::children
std::vector< Node > children
Definition: Node.h:63
Gaudi::Parsers::Node::position
Position position
Definition: Node.h:64
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:62

## Member Data Documentation

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

Definition at line 63 of file Node.h.

Position Gaudi::Parsers::Node::position

Definition at line 64 of file Node.h.

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

Definition at line 61 of file Node.h.

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

Definition at line 62 of file Node.h.

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

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