\section{A\-I\-D\-A\-:\-:I\-Tree\-R\-O\-O\-T Class Reference}
\label{classAIDA_1_1ITreeROOT}\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}


class \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject};  




{\ttfamily \#include $<$I\-Tree\-R\-O\-O\-T.\-h$>$}

Inheritance diagram for A\-I\-D\-A\-:\-:I\-Tree\-R\-O\-O\-T\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2.000000cm]{classAIDA_1_1ITreeROOT}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual {\bf $\sim$\-I\-Tree\-R\-O\-O\-T} ()\label{classAIDA_1_1ITreeROOT_aada3a09916ea29d0eef10b1db41b51dd}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
{\bf I\-Tree\-R\-O\-O\-T} (const std\-::string \&{\bf store\-Name}, const std\-::string \&store\-Type=\char`\"{}\char`\"{}, bool read\-Only=false, bool create\-New=false, const std\-::string \&options=\char`\"{}\char`\"{})
\begin{DoxyCompactList}\small\item\em Creates a new tree and associates it with a store. \end{DoxyCompactList}\item 
virtual std\-::string {\bf store\-Name} () const 
\begin{DoxyCompactList}\small\item\em Get the name of the store. \end{DoxyCompactList}\item 
virtual bool {\bf cd} (const std\-::string \&path)
\begin{DoxyCompactList}\small\item\em Get the \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} at a given path in the \doxyref{I\-Tree}{p.}{classAIDA_1_1ITree}. \end{DoxyCompactList}\item 
virtual std\-::string {\bf pwd} () const 
\begin{DoxyCompactList}\small\item\em Get the path of the current working directory. \end{DoxyCompactList}\item 
virtual bool {\bf ls} (const std\-::string \&path=\char`\"{}.\char`\"{}, bool recursive=false, std\-::ostream \&os=std\-::cout) const 
\begin{DoxyCompactList}\small\item\em List, into a given output stream, all the I\-Managed\-Objects, including directories (but not \char`\"{}.\char`\"{} and \char`\"{}..\char`\"{}), in a given path. \end{DoxyCompactList}\item 
virtual bool {\bf mkdir} (const std\-::string \&path)
\begin{DoxyCompactList}\small\item\em Get the list of names of the I\-Managed\-Objects under a given path, including directories (but not \char`\"{}.\char`\"{} and \char`\"{}..\char`\"{}). \end{DoxyCompactList}\item 
virtual bool {\bf commit} ()
\begin{DoxyCompactList}\small\item\em Create a directory recursively. \end{DoxyCompactList}\item 
virtual bool {\bf close} ()
\begin{DoxyCompactList}\small\item\em Set the strategy of what should happen if two objects have the same path. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
class \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject}; 

User level interface to a Tree.

All paths follow unix convention .., ., /, backslash is the escape character. Relative paths are allowed.

N\-O\-T\-E\-: -\/ this tree keeps a current position(pwd) within the tree. This may be implemented on a per-\/thread basis.

\begin{DoxyAuthor}{Author}
T. Kraemer, D\-E\-S\-Y 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}
\doxyref{I\-Tree\-R\-O\-O\-T.\-h}{p.}{ITreeROOT_8h_source},v 1.\-5 2008-\/01-\/30 17\-:42\-:20 killenberg Exp 
\end{DoxyParagraph}


\subsection{Constructor \& Destructor Documentation}
\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!I\-Tree\-R\-O\-O\-T@{I\-Tree\-R\-O\-O\-T}}
\index{I\-Tree\-R\-O\-O\-T@{I\-Tree\-R\-O\-O\-T}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{I\-Tree\-R\-O\-O\-T}]{\setlength{\rightskip}{0pt plus 5cm}I\-Tree\-R\-O\-O\-T\-::\-I\-Tree\-R\-O\-O\-T (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{store\-Name, }
\item[{const std\-::string \&}]{store\-Type = {\ttfamily \char`\"{}\char`\"{}}, }
\item[{bool}]{read\-Only = {\ttfamily false}, }
\item[{bool}]{create\-New = {\ttfamily false}, }
\item[{const std\-::string \&}]{options = {\ttfamily \char`\"{}\char`\"{}}}
\end{DoxyParamCaption}
)}\label{classAIDA_1_1ITreeROOT_af8863918c0ee7b203300a0bb00bb2e7d}


Creates a new tree and associates it with a store. 

The store is assumed to be read/write. The store will be created if it does not exist. 
\begin{DoxyParams}{Parameters}
{\em store\-Name} & The name of the store, if empty (\char`\"{}\char`\"{}), the tree is created in memory and therefore will not be associated with a file. \\
\hline
{\em store\-Type} & Implementation specific string, may control store type \\
\hline
{\em read\-Only} & If true the store is opened readonly, an exception if it does not exist \\
\hline
{\em create\-New} & If false the file must exist, if true the file will be created \\
\hline
{\em options} & Other options, currently are not specified \\
\hline
\end{DoxyParams}


References store\-Name().



\subsection{Member Function Documentation}
\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!cd@{cd}}
\index{cd@{cd}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{cd}]{\setlength{\rightskip}{0pt plus 5cm}bool I\-Tree\-R\-O\-O\-T\-::cd (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{path}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_a7d42cc2ac021956fe59ab09b49eab178}


Get the \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} at a given path in the \doxyref{I\-Tree}{p.}{classAIDA_1_1ITree}. 

The path can either be absolute or relative to the current working directory. 
\begin{DoxyParams}{Parameters}
{\em path} & The path. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The corresponding I\-Managed\-Object.\-virtual \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} $\ast$ find(const std\-::string \& path); Get a mounted \doxyref{I\-Tree}{p.}{classAIDA_1_1ITree} at a given path in the current \doxyref{I\-Tree}{p.}{classAIDA_1_1ITree}. The path can either be absolute or relative to the current working directory. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The path. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The corresponding I\-Tree.\-virtual \doxyref{I\-Tree}{p.}{classAIDA_1_1ITree} $\ast$ find\-Tree(const std\-::string \& path); Change to a given directory. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The absolute or relative path of the directory we are changing to. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If the path does not exist. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_a1e56da5bd7510e74a0717e4303980827}.



References store\-Name().



Referenced by ls(), and mkdir().

\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!close@{close}}
\index{close@{close}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}bool I\-Tree\-R\-O\-O\-T\-::close (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_a0ad5bd7f16d549df8d35158a15096a69}


Set the strategy of what should happen if two objects have the same path. 

Default is overwrite. 
\begin{DoxyParams}{Parameters}
{\em overwrite} & {\ttfamily true} to enable overwriting.\-virtual void set\-Overwrite(bool overwrite = true); Copy an object from a path to another. \\
\hline
{\em old\-Path} & The path of the object to be copied. \\
\hline
{\em new\-Path} & The path where the object is to be copied. \\
\hline
{\em recursive} & {\ttfamily true} if a recursive copy has to be performed. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If either path does not exist.\-virtual bool cp(const std\-::string \& old\-Path, const std\-::string \& new\-Path, bool recursive = false); Create a symbolic link to an object in the \doxyref{I\-Tree}{p.}{classAIDA_1_1ITree}. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The absolute or relative path of the object to be linked. \\
\hline
{\em alias} & The absolute or relative name of the link. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If path or any subidrectory within path does not exist.\-virtual bool symlink(const std\-::string \& path, const std\-::string \& alias); Mounts a tree within another (target) tree. A tree can only be mounted once. Example\-: 
\begin{DoxyPre}
    target.mount("/home/tonyj",tree,"/");
\end{DoxyPre}
 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The path in the target tree \\
\hline
{\em tree} & The tree to mount within the target tree \\
\hline
{\em tree\-Path} & The mount point within the tree to be mounted. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If something does not exist.\-virtual bool mount(const std\-::string \& path, I\-Tree \& tree, const std\-::string \& tree\-Path) ; Unmount a subtree at a given path (mount point). Whenever a tree is destroyed it first unmounts all dependent trees. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The path of the subtree to be unmounted. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If path does not exist.\-virtual bool unmount(const std\-::string \& path); Closes the underlying store. Changes will be saved only if \doxyref{commit()}{p.}{classAIDA_1_1ITreeROOT_a3dd3cc9b5fceae7e3c1d145373a961f3} has been called before. The call is propagated to the dependent mounted trees. 

false If there are problems writing out the underlying store. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_a3d79f628ef83df594c6513c0af192422}.

\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!commit@{commit}}
\index{commit@{commit}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{commit}]{\setlength{\rightskip}{0pt plus 5cm}bool I\-Tree\-R\-O\-O\-T\-::commit (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_a3dd3cc9b5fceae7e3c1d145373a961f3}


Create a directory recursively. 

Given a path the last directory and all the intermediate non-\/existing subdirectories are created. 
\begin{DoxyParams}{Parameters}
{\em path} & The absolute or relative path of the new directory. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If an intermediate subdirectory is not a directory, or if the directory already exists.\-virtual bool mkdirs(const std\-::string \& path); Remove a directory and all the contents underneeth. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The absolute or relative path of the directory to be removed. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If path does not exist or if it is not a directory.\-virtual bool rmdir(const std\-::string \& path); Remove an \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} by specifying its path. If the path points to a mount point, the mount point should first commit, then close and delete the tree object. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em path} & The absolute or relative path of the \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} to be removed. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If path does not exist.\-virtual bool rm(const std\-::string \& path); Get the full path of an \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject}. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em object} & The \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} whose path is to be returned. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The object's absolute path. In C++ if the object does not exist, an empty string is returned.\-virtual std\-::string find\-Path(const I\-Managed\-Object \& object) const; Move an \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} or a directory from one directory to another. 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em old\-Path} & The path of the \doxyref{I\-Managed\-Object}{p.}{classAIDA_1_1IManagedObject} or direcoty to be moved. \\
\hline
{\em new\-Path} & The path of the diretory in which the object has to be moved to. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If either path does not exist.\-virtual bool mv(const std\-::string \& old\-Path, const std\-::string \& new\-Path); Commit any open transaction to the underlying store(s). It flushes objects into the disk for non-\/memory-\/mapped stores. 

false If the underlying store cannot be written out. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_a3929d969908517f2db0c7ed43b568f74}.

\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!ls@{ls}}
\index{ls@{ls}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{ls}]{\setlength{\rightskip}{0pt plus 5cm}bool I\-Tree\-R\-O\-O\-T\-::ls (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{path = {\ttfamily \char`\"{}.\char`\"{}}, }
\item[{bool}]{recursive = {\ttfamily false}, }
\item[{std\-::ostream \&}]{os = {\ttfamily std\-:\-:cout}}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_a47366ef01e306048d22e34a9a30e68ce}


List, into a given output stream, all the I\-Managed\-Objects, including directories (but not \char`\"{}.\char`\"{} and \char`\"{}..\char`\"{}), in a given path. 

Directories end with \char`\"{}/\char`\"{}. The list can be recursive. 
\begin{DoxyParams}{Parameters}
{\em path} & The path where the list has to be performed (by default the current directory \char`\"{}.\char`\"{}). \\
\hline
{\em recursive} & If {\ttfamily true} the list is extended recursively in all the directories under path (the default is {\ttfamily false}. \\
\hline
{\em os} & The output stream into which the list is dumped (by default the standard output). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If the path does not exist. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_a8cedb4f96259c8e3506030c847eedff7}.



References cd(), and pwd().

\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!mkdir@{mkdir}}
\index{mkdir@{mkdir}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{mkdir}]{\setlength{\rightskip}{0pt plus 5cm}bool I\-Tree\-R\-O\-O\-T\-::mkdir (
\begin{DoxyParamCaption}
\item[{const std\-::string \&}]{path}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_aa97fa7e420c61b1e6bea5115a4f9d9a2}


Get the list of names of the I\-Managed\-Objects under a given path, including directories (but not \char`\"{}.\char`\"{} and \char`\"{}..\char`\"{}). 

Directories end with \char`\"{}/\char`\"{}. The returned names are appended to the given path unless the latter is \char`\"{}.\char`\"{}. 
\begin{DoxyParams}{Parameters}
{\em path} & The path where the list has to be performed (by default the current directory \char`\"{}.\char`\"{}). \\
\hline
{\em recursive} & If {\ttfamily true} the list is extended recursively in all the directories under path (the default is {\ttfamily false}.virtual std\-::vector$<$std\-::string$>$ list\-Object\-Names(const std\-::string \& path = \char`\"{}.\char`\"{}, bool recursive = false) const; Get the list of types of the I\-Managed\-Objects under a given path. The types are the leaf class of the Interface, e.\-g. \char`\"{}\-I\-Histogram1\-D\char`\"{}, \char`\"{}\-I\-Tuple\char`\"{}, etc. Directories are marked with \char`\"{}dir\char`\"{}. The order of the types is the same as the order for the list\-Object\-Names() method to achieve a one-\/to-\/one correspondance between object names and types. \\
\hline
{\em path} & The path where the list has to be performed (by default the current directory \char`\"{}.\char`\"{}). \\
\hline
{\em recursive} & If {\ttfamily true} the list is extended recursively in all the directories under path (the default is {\ttfamily false}.virtual std\-::vector$<$std\-::string$>$ list\-Object\-Types(const std\-::string \& path = \char`\"{}.\char`\"{}, bool recursive = false) const; Create a new directory. Given a path only the last directory in it is created if all the intermediate subdirectories already exist. \\
\hline
{\em path} & The absolute or relative path of the new directory. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
false If a subdirectory within the path does not exist or it is not a directory. Also if the directory already exists. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_ab320ae9eb7fad9c874dba8558eaa3f2f}.



References cd(), and pwd().

\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!pwd@{pwd}}
\index{pwd@{pwd}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{pwd}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string I\-Tree\-R\-O\-O\-T\-::pwd (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_a23945ad98cef73484d4da1f075539812}


Get the path of the current working directory. 

\begin{DoxyReturn}{Returns}
The path of the current working directory. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_a42789a7bb66198be8a86e9b867e66f01}.



Referenced by ls(), and mkdir().

\index{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}!store\-Name@{store\-Name}}
\index{store\-Name@{store\-Name}!AIDA::ITreeROOT@{A\-I\-D\-A\-::\-I\-Tree\-R\-O\-O\-T}}
\subsubsection[{store\-Name}]{\setlength{\rightskip}{0pt plus 5cm}std\-::string I\-Tree\-R\-O\-O\-T\-::store\-Name (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classAIDA_1_1ITreeROOT_ab034e5801085cca7e2971503acd9fe34}


Get the name of the store. 

\begin{DoxyReturn}{Returns}
The store's name. 
\end{DoxyReturn}


Implements {\bf A\-I\-D\-A\-::\-I\-Tree} \doxyref{}{p.}{classAIDA_1_1ITree_a55f3228d047f2380031f6783fd137523}.



Referenced by cd(), and I\-Tree\-R\-O\-O\-T().



The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
I\-Tree\-R\-O\-O\-T.\-h\item 
I\-Tree\-R\-O\-O\-T.\-cc\end{DoxyCompactItemize}
