The Tree class is a simple implementation of the AIDA::ITree interface. More...
#include <Tree.h>
Public Types | |
typedef std::vector< std::string > | Path |
A path is a vector of directory names. More... | |
typedef std::set< Path > | PathSet |
A set of paths. | |
typedef std::map< std::string, IManagedObject * > | ObjMap |
Map of paths to objects. More... | |
Public Member Functions | |
Tree (std::string storename, bool xml=true) | |
The standard constructor. | |
Tree () | |
The default constructor. | |
Tree (const Tree &dt) | |
The copy constructor. | |
virtual | ~Tree () |
Destructor. | |
std::string | storeName () const |
Get the name of the store. More... | |
IManagedObject * | find (const std::string &path) |
Get the IManagedObject at a given path in the ITree. More... | |
ITree * | findTree (const std::string &) |
LWH cannot get a mounted ITree at a given path in the current ITree. More... | |
bool | cd (const std::string &dir) |
Change to a given directory. More... | |
bool | insert (std::string str, IManagedObject *o) |
Insert the ManagedObject o in the tree with the path str. | |
std::string | pwd () const |
Get the path of the current working directory. More... | |
bool | ls (const std::string &=".", bool=false, std::ostream &=std::cout) const |
Not implemented in LWH. More... | |
std::vector< std::string > | listObjectNames (const std::string &=".", bool=false) const |
Not implemented in LWH. | |
std::vector< std::string > | listObjectTypes (const std::string &=".", bool=false) const |
Not implemented in LWH. | |
bool | mkdir (const std::string &dir) |
Create a new directory. More... | |
bool | mkdirs (const std::string &dir) |
Create a directory recursively. More... | |
bool | mkdirs (Path p) |
Create a directory recursively. More... | |
bool | rmdir (const std::string &dir) |
Remove a directory and all the contents underneeth. More... | |
bool | rm (const std::string &path) |
Remove and delete an IManagedObject by specifying its path. More... | |
std::string | findPath (const IManagedObject &o) const |
Get the full path of an IManagedObject. More... | |
bool | mv (const std::string &oldp, const std::string &newp) |
Move an IManagedObject or a directory from one directory to another. More... | |
bool | commit () |
Print all histograms to the current filename. More... | |
void | setOverwrite (bool o=true) |
Not implemented in LWH. | |
bool | cp (const std::string &, const std::string &, bool=false) |
Not implemented in LWH. More... | |
bool | symlink (const std::string &, const std::string &) |
Not implemented in LWH. More... | |
bool | mount (const std::string &, ITree &, const std::string &) |
Not implemented in LWH. More... | |
bool | unmount (const std::string &) |
Not implemented in LWH. More... | |
bool | close () |
Calls commit(). | |
void * | cast (const std::string &) const |
Not implemented in LWH. More... | |
Protected Member Functions | |
std::string | sts (std::string s) const |
Strip trailing slash. More... | |
std::string | stn (std::string s) const |
Strip trailing name. | |
std::string | fullpath (std::string d) const |
Get proper full path from possibly relative path. More... | |
Path | str2pth (std::string s) const |
Convert a string containing a path to a Path object. More... | |
std::string | pth2str (const Path &pth) const |
Convert a Path object to a corresponding string. More... | |
Path | purgepath (const Path &pth) const |
Remove '..' and '. More... | |
Private Attributes | |
std::string | name |
The filename to print histograms to. More... | |
bool | flat |
If true write histograms in FLAT format, otherwise in XML. More... | |
PathSet | dirs |
The set of defined directories. More... | |
ObjMap | objs |
The set of defined objects. More... | |
std::string | cwd |
The current working directory. More... | |
bool | overwrite |
Overwrite strategy. More... | |
Friends | |
class | AnalysisFactory |
The AnalysisFactory is a friend. More... | |
The Tree class is a simple implementation of the AIDA::ITree interface.
typedef std::map<std::string, IManagedObject *> LWH::Tree::ObjMap |
typedef std::vector<std::string> LWH::Tree::Path |
|
inline |
|
inline |
|
inline |
Print all histograms to the current filename.
Definition at line 281 of file Tree.h.
References LWH::ManagedObject::writeFLAT(), and LWH::ManagedObject::writeXML().
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
Create a new directory.
Given a path only the last directory in it is created if all the intermediate subdirectories already exist.
dir | The absolute or relative path of the new directory. |
|
inline |
Create a directory recursively.
Given a path the last directory and all the intermediate non-existing subdirectories are created.
dir | The absolute or relative path of the new directory. |
|
inline |
Create a directory recursively.
Given a Path the last directory and all the intermediate non-existing subdirectories are created.
p | The full Path of the new directory. |
|
inline |
|
inline |
|
inlineprotected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
inline |
|
inline |
|
friend |
The AnalysisFactory is a friend.
|
private |
|
private |
|
private |
|
private |