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 
12 
16 template< typename XValueType >
17 class MHO_NDArrayWrapper< XValueType, 0 >
18  : public MHO_ExtensibleElement //any and all extensions are purely a runtime concept and do NOT get streamed for I/O
19 {
20  public:
21  using value_type = XValueType;
22  typedef std::integral_constant< std::size_t, 0 > rank;
23 
25 
26  MHO_NDArrayWrapper(const XValueType& data) { fData = data; }
27 
28  MHO_NDArrayWrapper(const MHO_NDArrayWrapper& obj) { fData = obj.fData; }
29 
30  virtual ~MHO_NDArrayWrapper(){};
31 
32  //directly set/get the only value
38  void SetData(const XValueType& value) { fData = value; }
39 
45  XValueType GetData() { return fData; };
46 
52  std::size_t GetRank() const { return 0; }
53 
59  std::size_t GetSize() const { return 1; };
60 
62  {
63  if(this != &rhs)
64  {
65  fData = rhs.fData;
66  }
67  return *this;
68  }
69 
75  void SetArray(const XValueType& obj) { fData = obj; }
76 
80  void ZeroArray() { std::memset(&fData, 0, sizeof(XValueType)); }
81 
82  protected:
83  XValueType fData; //single value
84 };
85 
86 } // namespace hops
87 
88 #endif
Class MHO_ExtensibleElement.
Definition: MHO_ExtensibleElement.hh:60
XValueType fData
Definition: MHO_NDArrayWrapper_0.hh:83
void SetData(const XValueType &value)
Setter for data.
Definition: MHO_NDArrayWrapper_0.hh:38
MHO_NDArrayWrapper(const XValueType &data)
Definition: MHO_NDArrayWrapper_0.hh:26
MHO_NDArrayWrapper(const MHO_NDArrayWrapper &obj)
Definition: MHO_NDArrayWrapper_0.hh:28
void SetArray(const XValueType &obj)
Setter for array.
Definition: MHO_NDArrayWrapper_0.hh:75
std::size_t GetRank() const
Getter for rank.
Definition: MHO_NDArrayWrapper_0.hh:52
XValueType value_type
Definition: MHO_NDArrayWrapper_0.hh:21
XValueType GetData()
Getter for data.
Definition: MHO_NDArrayWrapper_0.hh:45
virtual ~MHO_NDArrayWrapper()
Definition: MHO_NDArrayWrapper_0.hh:30
MHO_NDArrayWrapper & operator=(const MHO_NDArrayWrapper &rhs)
Definition: MHO_NDArrayWrapper_0.hh:61
std::size_t GetSize() const
Getter for size.
Definition: MHO_NDArrayWrapper_0.hh:59
MHO_NDArrayWrapper()
Definition: MHO_NDArrayWrapper_0.hh:24
std::integral_constant< std::size_t, 0 > rank
Definition: MHO_NDArrayWrapper_0.hh:22
void ZeroArray()
Sets all elements in the array to zero.
Definition: MHO_NDArrayWrapper_0.hh:80
Class MHO_NDArrayWrapper.
Definition: MHO_NDArrayWrapper.hh:42
Definition: MHO_ChannelLabeler.hh:17
Definition: vex.h:175