evio  6.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EvioSegment.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_EVIOSEGMENT_H
12 #define EVIO_6_0_EVIOSEGMENT_H
13 
14 
15 #include <cstring>
16 #include <memory>
17 
18 
19 #include "ByteBuffer.h"
20 #include "DataType.h"
21 #include "BaseStructure.h"
22 #include "SegmentHeader.h"
23 #include "StructureType.h"
24 
25 
26 namespace evio {
27 
28 
36  class EvioSegment : public BaseStructure {
37 
38 
39  private:
40 
45  explicit EvioSegment(std::shared_ptr<SegmentHeader> const & head) : BaseStructure(head) {}
46 
47  public:
48 
54  static std::shared_ptr<EvioSegment> getInstance(std::shared_ptr<SegmentHeader> const & head) {
55  std::shared_ptr<EvioSegment> pNode(new EvioSegment(head));
56  return pNode;
57  }
58 
65  static std::shared_ptr<EvioSegment> getInstance(uint16_t tag, DataType const & typ) {
66  std::shared_ptr<SegmentHeader> head(new SegmentHeader(tag, typ));
67  std::shared_ptr<EvioSegment> pNode(new EvioSegment(head));
68  return pNode;
69  }
70 
78  StructureType getStructureType() const override {
80  }
81 
82  };
83 
84 }
85 
86 
87 #endif //EVIO_6_0_EVIOSEGMENT_H
static std::shared_ptr< EvioSegment > getInstance(std::shared_ptr< SegmentHeader > const &head)
Method to return a shared pointer to a constructed object of this class.
Definition: EvioSegment.h:54
This is the base class for all evio structures: Banks, Segments, and TagSegments. ...
Definition: BaseStructure.h:347
This holds a CODA Segment structure.
Definition: EvioSegment.h:36
static std::shared_ptr< EvioSegment > getInstance(uint16_t tag, DataType const &typ)
Method to return a shared pointer to a constructed object of this class.
Definition: EvioSegment.h:65
static const StructureType STRUCT_SEGMENT
Segment.
Definition: StructureType.h:40
Numerical values associated with evio data types.
Definition: DataType.h:32
Numerical values associated with evio structure types.
Definition: StructureType.h:34
StructureType getStructureType() const override
This implements the virtual method from BaseStructure.
Definition: EvioSegment.h:78
BaseStructure()
Constructor.
Definition: BaseStructure.cpp:28
This the header for an evio segment structure (EvioSegment).
Definition: SegmentHeader.h:34