HighLAND
DocStringManager.hxx
1 #ifndef DocStringManager_h
2 #define DocStringManager_h
3 
4 #include <iostream>
5 #include <algorithm>
6 #include "DocString.hxx"
7 #include <HLClonesArray.hxx>
8 
9 /// This class is used to store and access documentation for the variables stored
10 /// in the micro-trees.
11 ///
12 /// This singleton class will store a TClonesArray of DocString objects into the
13 /// "config" tree. When using the DrawingTools, the array will be read in, and the
14 /// use can then use the DrawingTools functions to interrogate the information.
15 ///
16 /// When adding a variable to the micro-tree, the DocumentVar function is called
17 /// automatically. The user does not need to call this function themselves.
19  public :
20 
21 
23 
24  virtual ~DocStringManager(){}
25 
26  /// Create the DocString object for this variable, and add it to the array
27  /// that will be saved. See the DocString class documentation for the
28  /// meaning of the parameters passed in here.
29  void DocumentVar(const std::string& tree, const std::string& name, const std::string& doc, const std::string& type, int size1, const std::string& counter1, int size2, const std::string& counter2, int size3, const std::string& counter3) {
30  DocString* newdoc = new((*_objects)[_NObjects++]) DocString(tree, name, doc, type, size1, counter1, size2, counter2, size3, counter3);
31  _docStrings.push_back(newdoc);
32  }
33 
34  /// Read the "config" tree from the given file, to read the docstrings that were
35  /// used when running the analysis. This is used so we can access the info in
36  /// the DrawingTools.
37  void ReadDocStrings(const std::string& file);
38 
39  /// Print the details of the specified variable in the given tree.
40  void ExplainVar(const std::string& name, const std::string& tree_name);
41 
42  /// List all the variables that were stored in this tree.
43  void ListVars(const std::string& tree_name);
44 
45 protected:
46 
47  std::vector<DocString*> _docStrings;
48 
49 };
50 
51 
52 #endif
void DocumentVar(const std::string &tree, const std::string &name, const std::string &doc, const std::string &type, int size1, const std::string &counter1, int size2, const std::string &counter2, int size3, const std::string &counter3)
void ExplainVar(const std::string &name, const std::string &tree_name)
Print the details of the specified variable in the given tree.
void ListVars(const std::string &tree_name)
List all the variables that were stored in this tree.
Int_t _NObjects
The number of steps that were added.
void ReadDocStrings(const std::string &file)