| The Gaudi Framework v27r1

- 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 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:10
Gaudi::Parsers::Node::type
NodeType type
Definition: Node.h:31

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())
58 result += " value=\"" + value + "\"";
59 if (position.line() != 0)
60 result += " line=\"" + std::to_string(position.line()) + "\"";
61 if (position.column() != 0)
62 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),
67 result + ">\n" , [&](std::string s, const gp::Node& node) {
68 return s + node.ToString(indent+2);
69 }).append( ' ', indent ) + "</" + 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:47
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)
project_manifest.indent
def indent
Definition: project_manifest.py:11
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