6 #include "google/protobuf/descriptor.h" 7 #include "google/protobuf/dynamic_message.h" 9 #include "proio/proto/proio.pb.h" 21 Event(
const std::string &proto);
28 uint64_t
AddEntry(google::protobuf::Message *entry, std::string tag =
"");
37 google::protobuf::Message *
GetEntry(uint64_t
id);
41 void TagEntry(uint64_t
id, std::string tag);
50 std::vector<std::string>
Tags();
61 std::vector<std::string>
EntryTags(uint64_t
id);
69 google::protobuf::Message *
Free(
const google::protobuf::Descriptor *desc);
74 std::map<std::string, std::shared_ptr<const std::string>> &
Metadata() {
return metadata; }
84 return getProto()->SerializeToString(output);
113 uint64_t getTypeID(google::protobuf::Message *entry);
114 const google::protobuf::Descriptor *getDescriptor(uint64_t typeID);
116 void clearDescriptors();
121 proto::Event *getProto();
123 proto::Event *eventProto;
124 std::map<std::string, uint64_t> revTypeLookup;
125 std::map<uint64_t, google::protobuf::Message *> entryCache;
126 std::map<uint64_t, const google::protobuf::Descriptor *> descriptorCache;
127 std::map<std::string, std::shared_ptr<const std::string>> metadata;
128 const google::protobuf::DescriptorPool *descriptorPool;
129 std::unique_ptr<google::protobuf::DynamicMessageFactory> messageFactory;
133 std::map<const google::protobuf::Descriptor *, std::vector<google::protobuf::Message *>> store;
137 virtual const char *what()
const throw() {
return "Unknown message type"; }
138 } unknownMessageTypeError;
141 #endif // PROIO_EVENT_H
google::protobuf::Message * Free(const google::protobuf::Descriptor *desc)
void DeleteTag(std::string tag)
std::vector< std::string > Tags()
std::vector< std::string > EntryTags(uint64_t id)
uint64_t AddEntry(google::protobuf::Message *entry, std::string tag="")
google::protobuf::Message * GetEntry(uint64_t id)
void TagEntry(uint64_t id, std::string tag)
std::map< std::string, std::shared_ptr< const std::string > > & Metadata()
void SetDescriptorPool(const google::protobuf::DescriptorPool *pool=NULL)
void RemoveEntry(uint64_t id)
bool SerializeToString(std::string *output)
void UntagEntry(uint64_t id, std::string tag)
void UseGeneratedPool(bool useGenPool=true)
std::vector< uint64_t > AllEntries()
std::vector< uint64_t > TaggedEntries(std::string tag)