20#ifndef GEODE_STRUCT_H_
21#define GEODE_STRUCT_H_
23#include <unordered_map>
28#include "Serializable.hpp"
30#include "internal/DataSerializableFixedId.hpp"
31#include "internal/geode_globals.hpp"
50 :
public internal::DataSerializableFixedId_t<internal::DSFid::Struct> {
52 typedef std::vector<std::shared_ptr<Serializable>>::iterator iterator;
58 std::vector<std::shared_ptr<Serializable>>& fieldValues);
62 ~Struct() noexcept override = default;
76 const std::shared_ptr<
Serializable> operator[](int32_t index) const;
86 const std::
string& fieldName) const;
93 const std::shared_ptr<
StructSet> getStructSet() const;
104 int32_t size() const;
106 void fromData(
DataInput& input) override;
108 void toData(
DataOutput& output) const override;
115 virtual const std::
string& getFieldName(const int32_t index) const;
120 size_t objectSize()
const override {
127 typedef std::unordered_map<std::string, int32_t> FieldNameToIndexMap;
130 std::vector<std::shared_ptr<Serializable>> m_fieldValues;
131 FieldNameToIndexMap m_fieldNameToIndex;
Contains generic template definitions for Cacheable types and instantiations for built-in types.
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:59
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:48
This base class is the superclass of all user objects in the cache that can be serialized.
Definition: Serializable.hpp:53
A Struct has a StructSet as its parent.
Definition: Struct.hpp:50
Struct(StructSet *ssPtr, std::vector< std::shared_ptr< Serializable > > &fieldValues)
Constructor - meant only for internal use.
A StructSet may be obtained after executing a Query which is obtained from a QueryService which in tu...
Definition: StructSet.hpp:42