ATLAS Offline Software
Functions
addnode.cxx File Reference
#include "addnode.h"
#include "spacer.h"
Include dependency graph for addnode.cxx:

Go to the source code of this file.

Functions

nodesubnode (node *np, const std::string &name)
 check whether a subnode with this name already exists
More...
 
nodeaddnode (node *np, const std::string &name, TObject *td, node::TYPE t)
 add a submode with a specific name, or return the existing node if one already exists More...
 

Function Documentation

◆ addnode()

node* addnode ( node np,
const std::string &  name,
TObject *  td,
node::TYPE  t 
)

add a submode with a specific name, or return the existing node if one already exists

add a new node (or return the already existing node with this name)

Definition at line 25 of file addnode.cxx.

25  {
26 
27  node* np_ = subnode( np, name );
28 
29  if ( np_ ) return np_;
30 
31  np_ = new node( np, np->depth()+spacer, td );
32  np_->name( name );
33  np_->type( t );
34 
35  np->push_back( np_ );
36 
37  return np_;
38 }

◆ subnode()

node* subnode ( node np,
const std::string &  name 
)

check whether a subnode with this name already exists

check if a subnode already exists

Definition at line 17 of file addnode.cxx.

17  {
18  if ( np==0 ) return 0;
19  for ( unsigned i=np->size() ; i-- ; ) if ( np->at(i)->name()==name ) return np->at(i);
20  return 0;
21 }
node::type
void type(TYPE t)
Definition: node.h:49
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
PlotPulseshapeFromCool.np
np
Definition: PlotPulseshapeFromCool.py:64
subnode
node * subnode(node *np, const std::string &name)
check whether a subnode with this name already exists
Definition: addnode.cxx:17
spacer
const std::string spacer
Definition: spacer.h:24
lumiFormat.i
int i
Definition: lumiFormat.py:92
PyPoolBrowser.node
node
Definition: PyPoolBrowser.py:131
node::name
void name(const std::string &n)
Definition: node.h:38
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
node
Definition: memory_hooks-stdcmalloc.h:74