FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
TreeVariableArray.h
1 // CTreeVariableArray.h
3 // Implementation of the Class CTreeVariableArray
4 // Created on: 30-Mar-2005 11:03:53 AM
5 // Original author: Ron Fox
7 
8 /*
9  This software is Copyright by the Board of Trustees of Michigan
10  State University (c) Copyright 2005.
11 
12  You may use this software under the terms of the GNU public license
13  (GPL). The terms of this license are described at:
14 
15  http://www.gnu.org/licenses/gpl.txt
16 
17  Author:
18  Ron Fox
19  NSCL
20  Michigan State University
21  East Lansing, MI 48824-1321
22 */
23 // This implementation of TreeParameter is based on the ideas and original code of::
24 // Daniel Bazin
25 // National Superconducting Cyclotron Lab
26 // Michigan State University
27 // East Lansing, MI 48824-1321
28 //
29 
30 
31 
32 #ifndef CTREEVARIABLEARRAY_H
33 #define CTREEVARIABLEARRAY_H
34 
35 #include "TreeVariable.h"
36 #include <string>
37 #include <vector>
38 
39 // Forward definitions.
40 
41 namespace frib {
42  namespace analysis {
43 
44 
71  {
72  // object member data:
73 
74  private:
78  int m_nFirstIndex;
82  std::vector<CTreeVariable*> m_TreeVariables;
83  public:
85  CTreeVariableArray(std::string baseName, double initialValue,
86  std::string units, unsigned size, int firstIndex = 0);
87  CTreeVariableArray(std::string baseName, unsigned size, int firstIndex = 0);
90  void Initialize(std::string baseName, double initialValue,
91  std::string units, unsigned size, int firstElement);
92  CTreeVariable& operator[](int index);
93  const CTreeVariable& operator[](int index) const;
95 
96  unsigned size() const;
97  int firstIndex() const;
98 
99  protected:
100  void BuildArray(std::string basename, unsigned int size,
101  const CTreeVariable::Definition& example);
102  void CopyArray(const CTreeVariableArray& rhs);
103 
104  private:
105 
106  void DestroyArray();
107 
108  };
109 
110  }
111 
112 }
113 
114 
115 
116 
117 
118 #endif
Definition: TreeVariable.h:56
: Define a class that holds variables that steer computations.
Definition: TreeVariable.h:53
Definition: TreeVariableArray.h:70
CTreeVariableArray()
Definition: TreeVariableArray.cpp:45
CTreeVariableArray & operator=(const CTreeVariableArray &rhs)
Definition: TreeVariableArray.cpp:307
int firstIndex() const
Definition: TreeVariableArray.cpp:336
~CTreeVariableArray()
Definition: TreeVariableArray.cpp:130
unsigned size() const
Definition: TreeVariableArray.cpp:328
void BuildArray(std::string basename, unsigned int size, const CTreeVariable::Definition &example)
Definition: TreeVariableArray.cpp:151
CTreeVariable & operator[](int index)
Definition: TreeVariableArray.cpp:278
void CopyArray(const CTreeVariableArray &rhs)
Definition: TreeVariableArray.cpp:215
void Initialize(std::string baseName, double initialValue, std::string units, unsigned size, int firstElement)
Definition: TreeVariableArray.cpp:251
Definition: AbstractApplication.cpp:30