HighLAND
DocString.cxx
1 #include "DocString.hxx"
2 #include <iostream>
3 
4 ClassImp(DocString)
5 
6 
7 DocString::DocString(const std::string& tree,
8  const std::string& name,
9  const std::string& doc,
10  const std::string& type,
11  int size1,
12  const std::string& counter1,
13  int size2,
14  const std::string& counter2,
15  int size3,
16  const std::string& counter3) {
17  _tree = tree;
18  _name = name;
19  _doc = doc;
20  _type = type;
21  _counter1 = counter1;
22  _counter2 = counter2;
23  _counter3 = counter3;
24  _size1 = size1;
25  _size2 = size2;
26  _size3 = size3;
27 }
28 
30  std::string dim = "Unknown";
31  std::string nicetype = "Unknown";
32 
33  if (_size3 != 0) {
34  dim = "3D matrix of ";
35  } else if (_size2 != 0) {
36  dim = "Matrix of ";
37  } else if (_size1 != 0) {
38  dim = "Vector of ";
39  } else {
40  dim = "";
41  }
42 
43  if (_type == "F") {
44  nicetype = "float";
45  } else if (_type == "D") {
46  nicetype = "double";
47  } else if (_type == "I") {
48  nicetype = "integer";
49  } else if (_type == "C") {
50  nicetype = "char";
51  }
52 
53  std::cout << "Variable name..... " << _name << std::endl;
54  std::cout << "Stored in tree.... " << _tree << std::endl;
55  std::cout << "Type of variable.. " << dim << nicetype << std::endl;
56  if (_size1 != 0) {
57  std::cout << "Size of variable: " << std::endl;
58  std::cout << " 1st dimension... ";
59  if (_size1>0) {
60  std::cout << abs(_size1) << " (fixed size)" << std::endl;
61  } else {
62  std::cout << _counter1 << " (variable size, up to a maximum of " << abs(_size1) << ")" << std::endl;
63  }
64  if (_size2 != 0) {
65  std::cout << " 2nd dimension... ";
66  if (_size2>0) {
67  std::cout << abs(_size2) << " (fixed size)" << std::endl;
68  } else {
69  std::cout << _counter2 << " (variable size, up to a maximum of " << abs(_size2) << ")" << std::endl;
70  }
71  if (_size3 != 0) {
72  std::cout << " 3rd dimension... ";
73  if (_size3>0) {
74  std::cout << abs(_size3) << " (fixed size)" << std::endl;
75  } else {
76  std::cout << _counter3 << " (variable size, up to a maximum of " << abs(_size3) << ")" << std::endl;
77  }
78  }
79  }
80  }
81  std::cout << "Documentation..... " << _doc << std::endl;
82 
83  // if (ND::categ().HasCategory(_name)) {
84  // ND::categ().DumpTrackCategory(_name);
85  // }
86 }
std::string _counter1
If a vector, the counter used for the 1st dimension.
Definition: DocString.hxx:55
std::string _type
The type of this variable (I/F/C/D)
Definition: DocString.hxx:52
int _size1
If a vector, the size of the 1st dimension.
Definition: DocString.hxx:64
int _size2
If a matrix, the size of the 2nd dimension.
Definition: DocString.hxx:67
std::string _counter2
If a matrix, the counter used for the 2nd dimension.
Definition: DocString.hxx:58
void Explain()
Definition: DocString.cxx:29
std::string _counter3
If a 3D matrix, the counter used for the 3rd dimension.
Definition: DocString.hxx:61
std::string _name
The name of this variable.
Definition: DocString.hxx:46
std::string _tree
The name of the tree this variable was stored in.
Definition: DocString.hxx:43
std::string _doc
The documentation string provided by the user.
Definition: DocString.hxx:49
int _size3
If a 3D matrix, the size of the 3rd dimension.
Definition: DocString.hxx:70