| The Gaudi Framework v28r2p1 (f1a77ff4)

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

26 {kRoot,kInclude, kIdentifier, kProperty, kOperation,
27 kValue, kAssign, kEqual, kPlusEqual, kMinusEqual, kVector, kMap, kPair,
28 kSimple, kString, kReal, kBool, kUnits, kUnit, kCondition, kIfdef, kIfndef,
29 kElse, kPrintOptions, kPrintOn, kPrintOff, kShell, kPrintTree, kDumpFile,
30 kPropertyRef, number_of_node_types};
Gaudi::Parsers::Node::kString
Definition: Node.h:28
Gaudi::Parsers::Node::kRoot
Definition: Node.h:26
Gaudi::Parsers::Node::kMap
Definition: Node.h:27
Gaudi::Parsers::Node::kPlusEqual
Definition: Node.h:27
Gaudi::Parsers::Node::kShell
Definition: Node.h:29
Gaudi::Parsers::Node::kPair
Definition: Node.h:27
Gaudi::Parsers::Node::kOperation
Definition: Node.h:26
Gaudi::Parsers::Node::kUnit
Definition: Node.h:28
Gaudi::Parsers::Node::kValue
Definition: Node.h:27
Gaudi::Parsers::Node::kIdentifier
Definition: Node.h:26
Gaudi::Parsers::Node::kIfdef
Definition: Node.h:28
Gaudi::Parsers::Node::kMinusEqual
Definition: Node.h:27
Gaudi::Parsers::Node::kElse
Definition: Node.h:29
Gaudi::Parsers::Node::kVector
Definition: Node.h:27
Gaudi::Parsers::Node::kEqual
Definition: Node.h:27
Gaudi::Parsers::Node::kPrintOff
Definition: Node.h:29
Gaudi::Parsers::Node::kAssign
Definition: Node.h:27
Gaudi::Parsers::Node::kCondition
Definition: Node.h:28
Gaudi::Parsers::Node::kBool
Definition: Node.h:28
Gaudi::Parsers::Node::kPrintOptions
Definition: Node.h:29
Gaudi::Parsers::Node::kSimple
Definition: Node.h:28
Gaudi::Parsers::Node::kPrintTree
Definition: Node.h:29
Gaudi::Parsers::Node::kInclude
Definition: Node.h:26
Gaudi::Parsers::Node::kPrintOn
Definition: Node.h:29
Gaudi::Parsers::Node::kUnits
Definition: Node.h:28
Gaudi::Parsers::Node::kIfndef
Definition: Node.h:28
Gaudi::Parsers::Node::number_of_node_types
Definition: Node.h:30
Gaudi::Parsers::Node::kDumpFile
Definition: Node.h:29
Gaudi::Parsers::Node::kProperty
Definition: Node.h:26
Gaudi::Parsers::Node::kPropertyRef
Definition: Node.h:30
Gaudi::Parsers::Node::kReal
Definition: Node.h:28

## 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.

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

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

Definition at line 54 of file Node.cpp.

54 {
55
56 std::string result( indent, ' ');
57 result += "<" + name();
58 if (!value.empty())
59 result += " value=\"" + value + "\"";
60 if (position.line() != 0)
61 result += " line=\"" + std::to_string(position.line()) + "\"";
62 if (position.column() != 0)
63 result += " column=\"" + std::to_string(position.column()) + "\"";
64 if (children.empty()) {
65 result += "/>\n";
66 } else {
67 result = std::accumulate( std::begin(children), std::end(children),
68 result + ">\n" , [&](std::string s, const gp::Node& node) {
69 return s + node.ToString(indent+2);
70 }).append( ' ', indent ) + "</" + name() + ">\n";
71 }
72 return result;
73 }
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:19
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:18
std::begin
T begin(T...args)
gaudirun.s
string s
Definition: gaudirun.py:245
std::accumulate
T accumulate(T...args)
Gaudi::Parsers::Node::value
std::string value
Definition: Node.h:32
Gaudi::Parsers::Node::position
Position position
Definition: Node.h:34
Gaudi::Parsers::Node::children
std::vector< Node > children
Definition: Node.h:33

## Member Data Documentation

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

Definition at line 33 of file Node.h.

Position Gaudi::Parsers::Node::position

Definition at line 34 of file Node.h.

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

Definition at line 31 of file Node.h.

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

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