Start of a connection state machine, start of a TLV framework.
This commit is contained in:
18
tlv.h
Normal file
18
tlv.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <list>
|
||||
#include <string>
|
||||
|
||||
class TLVNode {
|
||||
public:
|
||||
TLVNode(const uint16_t type);
|
||||
TLVNode(const uint16_t type, const std::string value);
|
||||
|
||||
static TLVNode* Decode(const std::string& input);
|
||||
void Encode(std::string *output);
|
||||
|
||||
private:
|
||||
const uint16_t type_;
|
||||
const std::string value_;
|
||||
std::list<TLVNode> children_;
|
||||
};
|
||||
Reference in New Issue
Block a user