OpenMS
Param::ParamNode Struct Reference

Node inside a Param object which is used to build the internal tree. More...

#include <OpenMS/DATASTRUCTURES/Param.h>

Collaboration diagram for Param::ParamNode:
[legend]

Public Types

typedef std::vector< ParamNode >::iterator NodeIterator
 Iterator for child nodes. More...
 
typedef std::vector< ParamEntry >::iterator EntryIterator
 Iterator for entries. More...
 
typedef std::vector< ParamNode >::const_iterator ConstNodeIterator
 Iterator for child nodes. More...
 
typedef std::vector< ParamEntry >::const_iterator ConstEntryIterator
 Iterator for entries. More...
 

Public Member Functions

 ParamNode ()
 Default constructor. More...
 
 ParamNode (const std::string &n, const std::string &d)
 Constructor with name and description. More...
 
 ParamNode (const ParamNode &)=default
 Copy constructor. More...
 
 ParamNode (ParamNode &&)=default
 Move constructor. More...
 
 ~ParamNode ()
 Destructor. More...
 
ParamNodeoperator= (const ParamNode &)=default
 Assignment operator. More...
 
ParamNodeoperator= (ParamNode &&) &=default
 Move assignment operator. More...
 
bool operator== (const ParamNode &rhs) const
 Equality operator (name, entries and subnodes are compared) More...
 
EntryIterator findEntry (const std::string &name)
 Look up entry of this node (local search) More...
 
NodeIterator findNode (const std::string &name)
 Look up subnode of this node (local search) More...
 
ParamNodefindParentOf (const std::string &name)
 Look up the parent node of the entry or node corresponding to name (tree search) More...
 
ParamEntryfindEntryRecursive (const std::string &name)
 Look up the entry corresponding to name (tree search) More...
 
void insert (const ParamNode &node, const std::string &prefix="")
 Inserts a node with the given prefix. More...
 
void insert (const ParamEntry &entry, const std::string &prefix="")
 Inserts an entry with the given prefix. More...
 
size_t size () const
 Returns the number of entries in the whole subtree. More...
 
std::string suffix (const std::string &key) const
 Returns the name suffix of a key (the part behind the last ':' character) More...
 

Public Attributes

std::string name
 Name of the node. More...
 
std::string description
 Description of the node. More...
 
std::vector< ParamEntryentries
 Entries (leafs) in the node. More...
 
std::vector< ParamNodenodes
 Subnodes. More...
 

Detailed Description

Node inside a Param object which is used to build the internal tree.

Member Typedef Documentation

◆ ConstEntryIterator

typedef std::vector<ParamEntry>::const_iterator ConstEntryIterator

Iterator for entries.

◆ ConstNodeIterator

typedef std::vector<ParamNode>::const_iterator ConstNodeIterator

Iterator for child nodes.

◆ EntryIterator

typedef std::vector<ParamEntry>::iterator EntryIterator

Iterator for entries.

◆ NodeIterator

typedef std::vector<ParamNode>::iterator NodeIterator

Iterator for child nodes.

Constructor & Destructor Documentation

◆ ParamNode() [1/4]

ParamNode ( )

Default constructor.

◆ ParamNode() [2/4]

ParamNode ( const std::string &  n,
const std::string &  d 
)

Constructor with name and description.

◆ ParamNode() [3/4]

ParamNode ( const ParamNode )
default

Copy constructor.

◆ ParamNode() [4/4]

ParamNode ( ParamNode &&  )
default

Move constructor.

◆ ~ParamNode()

~ParamNode ( )

Destructor.

Member Function Documentation

◆ findEntry()

EntryIterator findEntry ( const std::string &  name)

Look up entry of this node (local search)

Returns the end iterator if no entry is found

◆ findEntryRecursive()

ParamEntry* findEntryRecursive ( const std::string &  name)

Look up the entry corresponding to name (tree search)

Returns 0 if no entry is found

◆ findNode()

NodeIterator findNode ( const std::string &  name)

Look up subnode of this node (local search)

Returns the end iterator if no entry is found

◆ findParentOf()

ParamNode* findParentOf ( const std::string &  name)

Look up the parent node of the entry or node corresponding to name (tree search)

Returns 0 if no entry is found

◆ insert() [1/2]

void insert ( const ParamEntry entry,
const std::string &  prefix = "" 
)

Inserts an entry with the given prefix.

◆ insert() [2/2]

void insert ( const ParamNode node,
const std::string &  prefix = "" 
)

Inserts a node with the given prefix.

◆ operator=() [1/2]

ParamNode& operator= ( const ParamNode )
default

Assignment operator.

◆ operator=() [2/2]

ParamNode& operator= ( ParamNode &&  ) &
default

Move assignment operator.

◆ operator==()

bool operator== ( const ParamNode rhs) const

Equality operator (name, entries and subnodes are compared)

◆ size()

size_t size ( ) const

Returns the number of entries in the whole subtree.

◆ suffix()

std::string suffix ( const std::string &  key) const

Returns the name suffix of a key (the part behind the last ':' character)

Member Data Documentation

◆ description

std::string description

Description of the node.

◆ entries

std::vector<ParamEntry> entries

Entries (leafs) in the node.

◆ name

std::string name

Name of the node.

◆ nodes

std::vector<ParamNode> nodes

Subnodes.