evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SegmentHeader.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_SEGMENTHEADER_H
12 #define EVIO_6_0_SEGMENTHEADER_H
13 
14 
15 #include "Util.h"
16 #include "DataType.h"
17 #include "ByteOrder.h"
18 #include "ByteBuffer.h"
19 #include "BaseStructureHeader.h"
20 
21 
22 namespace evio {
23 
24 
35 
36  public:
37 
38  SegmentHeader() = default;
39  SegmentHeader(uint16_t tag, DataType const & dataType);
40 
41  uint32_t getDataLength() override;
42  uint32_t getHeaderLength() override;
43  std::string toString() override;
44 
45  size_t write(std::shared_ptr<ByteBuffer> & dest) override ;
46  size_t write(ByteBuffer & dest) override;
47  size_t write(uint8_t *dest, ByteOrder const & order) override;
48  };
49 
50 }
51 
52 
53 #endif //EVIO_6_0_SEGMENTHEADER_H
This class is copied from one of the same name in the Java programming language.
Definition: ByteBuffer.h:42
SegmentHeader()=default
uint32_t getHeaderLength() override
Get the length of the structure&#39;s header in ints.
Definition: SegmentHeader.cpp:38
Numerical values associated with endian byte order.
Definition: ByteOrder.h:53
uint32_t tag
The structure tag.
Definition: BaseStructureHeader.h:57
size_t write(std::shared_ptr< ByteBuffer > &dest) override
Write myself out a byte buffer.
Definition: SegmentHeader.cpp:66
This the header for the base structure (BaseStructure).
Definition: BaseStructureHeader.h:39
uint32_t getDataLength() override
Get the length of the structure&#39;s data in 32 bit ints (not counting the header words).
Definition: SegmentHeader.cpp:30
Numerical values associated with evio data types.
Definition: DataType.h:32
DataType dataType
The data type of the structure.
Definition: BaseStructureHeader.h:60
std::string toString() override
Obtain a string representation of the segment header.
Definition: SegmentHeader.cpp:91
This the header for an evio segment structure (EvioSegment).
Definition: SegmentHeader.h:34