evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RecordNode.h
Go to the documentation of this file.
1 //
2 // Copyright 2020, Jefferson Science Associates, LLC.
3 // Subject to the terms in the LICENSE file found in the top-level directory.
4 //
5 // EPSCI Group
6 // Thomas Jefferson National Accelerator Facility
7 // 12000, Jefferson Ave, Newport News, VA 23606
8 // (757)-269-7100
9 
10 
11 #ifndef EVIO_6_0_RECORDNODE_H
12 #define EVIO_6_0_RECORDNODE_H
13 
14 
15 #include <cstdint>
16 #include <sstream>
17 
18 
19 namespace evio {
20 
21 
30  class RecordNode {
31 
32  friend class EvioCompactReaderV4;
33 
34  private:
35 
37  uint32_t len = 0;
39  uint32_t count = 0;
41  size_t pos = 0;
46  uint32_t place = 0;
47 
48  public:
49 
50  RecordNode() = default;
51 
53  void clear() {
54  len = count = pos = place = 0;
55  }
56 
61  uint32_t getLen() const {return len;}
62 
67  void setLen(uint32_t l) {len = l;}
68 
69 
74  uint32_t getCount() const {return count;}
75 
80  void setCount(uint32_t c) {count = c;}
81 
82 
87  size_t getPos() const {return pos;}
88 
93  void setPos(size_t p) {pos = p;}
94 
95 
100  uint32_t getPlace() const {return place;}
101 
106  void setPlace(uint32_t p) {place = p;}
107 
108 
113  std::string toString() const {
114  std::stringstream ss;
115 
116  ss << "len = " << len;
117  ss << ", count = " << count;
118  ss << ", pos = " << pos;
119  ss << ", place = " << place;
120 
121  return ss.str();
122  }
123 
124  };
125 
126 }
127 
128 
129 #endif //EVIO_6_0_RECORDNODE_H
size_t getPos() const
Get the position of this record in the file/buffer.
Definition: RecordNode.h:87
void setPos(size_t p)
Set the position of this record in the file/buffer.
Definition: RecordNode.h:93
This class is used to store relevant info about an evio record (or block) along with its position in ...
Definition: RecordNode.h:30
uint32_t getLen() const
Get the record&#39;s length in 32-bit words.
Definition: RecordNode.h:61
This class is used to read an evio format version 4 formatted file or buffer and extract specific evi...
Definition: EvioCompactReaderV4.h:54
std::string toString() const
Get a string representation of this object.
Definition: RecordNode.h:113
RecordNode()=default
uint32_t getCount() const
Get the number of events in this record.
Definition: RecordNode.h:74
uint32_t getPlace() const
Get the place of this record in file/buffer.
Definition: RecordNode.h:100
void setLen(uint32_t l)
Set the record&#39;s length in 32-bit words.
Definition: RecordNode.h:67
void setCount(uint32_t c)
Set the number of events in this record.
Definition: RecordNode.h:80
void clear()
Set all internal values to 0.
Definition: RecordNode.h:53
void setPlace(uint32_t p)
Set the place of this record in file/buffer.
Definition: RecordNode.h:106