Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
VariableArray.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file VariableArray.h
1 #ifndef VARARRAY_VARIABLEARRAY_H
2 #define VARARRAY_VARIABLEARRAY_H
3 
4 #include <phool/PHObject.h>
5 
6 #include <iostream>
7 #include <vector>
8 
9 class VariableArray : public PHObject
10 {
11  public:
12  VariableArray(const unsigned int idval = 0);
13  ~VariableArray() override;
14 
15  void identify(std::ostream &os = std::cout) const override;
16 
17  // Here are the very explicit set routines...
18  void set_val(const std::vector<short> &vec);
19  const short int *get_array() const { return sval; }
20  unsigned int get_array_size() const { return nVal; }
21  int Id() const { return id; }
22 // cppcheck-suppress virtualCallInConstructor
23  void Reset() override;
24 
25  protected:
26  int id;
27  unsigned int nVal;
28  short *sval; //[nVal]
29 
30  ClassDefOverride(VariableArray, 1)
31 };
32 
33 #endif /* VARIABLEARRAY */