HOPS
HOPS class reference
MHO_NDArrayWrapper_0.hh
Go to the documentation of this file.
1 #ifndef MHO_NDArrayWrapper_0_HH__
2 #define MHO_NDArrayWrapper_0_HH__
3 
4 //this include file should not be used directly
5 #ifndef MHO_NDArrayWrapper_HH__
6  #error "Do not include MHO_NDArrayWrapper_0.hh directly; use MHO_NDArrayWrapper.hh instead."
7 #endif
8 
9 namespace hops
10 {
11 
15 template< typename XValueType >
16 class MHO_NDArrayWrapper< XValueType, 0 >
17  : public MHO_ExtensibleElement //any and all extensions are purely a runtime concept and do NOT get streamed for I/O
18 {
19  public:
20  using value_type = XValueType;
21  typedef std::integral_constant< std::size_t, 0 > rank;
22 
24 
25  MHO_NDArrayWrapper(const XValueType& data) { fData = data; }
26 
27  MHO_NDArrayWrapper(const MHO_NDArrayWrapper& obj) { fData = obj.fData; }
28 
29  virtual ~MHO_NDArrayWrapper(){};
30 
31  //directly set/get the only value
37  void SetData(const XValueType& value) { fData = value; }
38 
44  XValueType GetData() { return fData; };
45 
51  std::size_t GetRank() const { return 0; }
52 
58  std::size_t GetSize() const { return 1; };
59 
61  {
62  if(this != &rhs)
63  {
64  fData = rhs.fData;
65  }
66  return *this;
67  }
68 
74  void SetArray(const XValueType& obj) { fData = obj; }
75 
79  void ZeroArray() { std::memset(&fData, 0, sizeof(XValueType)); }
80 
81  protected:
82  XValueType fData; //single value
83 };
84 
85 } // namespace hops
86 
87 #endif
Class MHO_ExtensibleElement.
Definition: MHO_ExtensibleElement.hh:60
XValueType fData
Definition: MHO_NDArrayWrapper_0.hh:82
void SetData(const XValueType &value)
Setter for data.
Definition: MHO_NDArrayWrapper_0.hh:37
MHO_NDArrayWrapper(const XValueType &data)
Definition: MHO_NDArrayWrapper_0.hh:25
MHO_NDArrayWrapper(const MHO_NDArrayWrapper &obj)
Definition: MHO_NDArrayWrapper_0.hh:27
void SetArray(const XValueType &obj)
Setter for array.
Definition: MHO_NDArrayWrapper_0.hh:74
std::size_t GetRank() const
Getter for rank.
Definition: MHO_NDArrayWrapper_0.hh:51
XValueType value_type
Definition: MHO_NDArrayWrapper_0.hh:20
XValueType GetData()
Getter for data.
Definition: MHO_NDArrayWrapper_0.hh:44
virtual ~MHO_NDArrayWrapper()
Definition: MHO_NDArrayWrapper_0.hh:29
MHO_NDArrayWrapper & operator=(const MHO_NDArrayWrapper &rhs)
Definition: MHO_NDArrayWrapper_0.hh:60
std::size_t GetSize() const
Getter for size.
Definition: MHO_NDArrayWrapper_0.hh:58
MHO_NDArrayWrapper()
Definition: MHO_NDArrayWrapper_0.hh:23
std::integral_constant< std::size_t, 0 > rank
Definition: MHO_NDArrayWrapper_0.hh:21
void ZeroArray()
Sets all elements in the array to zero.
Definition: MHO_NDArrayWrapper_0.hh:79
Class MHO_NDArrayWrapper.
Definition: MHO_NDArrayWrapper.hh:42
Definition: fit_gsl.h:54
Definition: MHO_AdhocFlagging.hh:18
Definition: vex.h:175