| The Gaudi Framework v32r1 (f65d50dc)

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

## Member Enumeration Documentation

## ◆ NodeType

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

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

## Constructor & Destructor Documentation

## ◆ Node()

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

## Member Function Documentation

## ◆ name()

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

Definition at line 47 of file Node.cpp.

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

## ◆ ToString()

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

Definition at line 53 of file Node.cpp.

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

## Member Data Documentation

## ◆ children

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

Definition at line 61 of file Node.h.

## ◆ position

Position Gaudi::Parsers::Node::position

Definition at line 62 of file Node.h.

## ◆ type

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

Definition at line 59 of file Node.h.

## ◆ value

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

Definition at line 60 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