data.h
Go to the documentation of this file.
1 
32 #ifndef CREATE_DATA_H
33 #define CREATE_DATA_H
34 
35 #include <map>
36 #include <memory>
37 #include <vector>
38 
39 #include "create/packet.h"
40 #include "create/types.h"
41 
42 namespace create {
43  class Data {
44  private:
45  std::map<uint8_t, std::shared_ptr<Packet> > packets;
46  uint32_t totalDataBytes;
47  std::vector<uint8_t> ids;
48 
49  public:
50  Data(ProtocolVersion version = V_3);
51  ~Data();
52 
53  bool isValidPacketID(const uint8_t id) const;
54  std::shared_ptr<Packet> getPacket(const uint8_t id);
55  void validateAll();
56  uint32_t getTotalDataBytes() const;
57  uint8_t getNumPackets() const;
58  std::vector<uint8_t> getPacketIDs();
59  };
60 } // namespace create
61 
62 #endif // CREATE_DATA_H
uint8_t getNumPackets() const
Definition: data.cpp:84
bool isValidPacketID(const uint8_t id) const
Definition: data.cpp:58
std::vector< uint8_t > getPacketIDs()
Definition: data.cpp:88
uint32_t getTotalDataBytes() const
Definition: data.cpp:80
Data(ProtocolVersion version=V_3)
Definition: data.cpp:7
Definition: create.h:48
std::shared_ptr< Packet > getPacket(const uint8_t id)
Definition: data.cpp:65
ProtocolVersion
Definition: types.h:41
std::vector< uint8_t > ids
Definition: data.h:47
std::map< uint8_t, std::shared_ptr< Packet > > packets
Definition: data.h:45
uint32_t totalDataBytes
Definition: data.h:46
void validateAll()
Definition: data.cpp:72


libcreate
Author(s): Jacob Perron
autogenerated on Sat May 8 2021 03:02:37