15#ifndef DDL_CODEC_FACTORY_CLASS_HEADER
16#define DDL_CODEC_FACTORY_CLASS_HEADER
66 CodecFactory(
const std::string& struct_name,
const std::string& dd_string);
118 return StaticCodec(_codec_access, data, data_size, rep);
184 std::string_view relative_path)
const;
296 std::shared_ptr<const StructAccess> _codec_access;
316 return decoder_or_factory.getStaticElementCount();
361 return codec.getElementCount();
374 std::vector<CodecIndex> indices;
377 [&indices](
const auto& element) { indices.push_back(element.getIndex()); });
393 std::vector<LeafCodecIndex> indices;
395 forEachLeafElement(decoder_or_factory.getElements(), [&indices, &rep](
const auto& element) {
396 indices.push_back(LeafCodecIndex(element.getIndex(), rep));
Definition result_type_decl.h:34
Utility class for a complete valid data definition of one StructType and its dependencies....
Definition ddstructure.h:57
Legacy helper for the ddl::StructElement.
Definition access_element_legacy.h:35
Iteratable container type for the given Element type in ElementAccessType::element_type.
Definition codec_iterator.h:257
FactoryElement< FactoryElementAccess< const CodecFactory > > Element
Definition codec_factory.h:143
CodecFactory(const CodecFactory &)
copy CTOR
const Elements & getElements() const
size_t getStaticBufferSize(DataRepresentation rep=deserialized) const
Gets the static buffer size in bytes for the structure.
CodecFactory & operator=(const CodecFactory &)
copy assignment operator
size_t getStaticElementCount() const
a_util::result::Result getStaticElement(size_t leaf_index, const ddl::StructElement *&legacy_struct_element) const
const std::string & getElementBaseName(const CodecIndex &codec_index) const
Retrieves the base name of the element within its structured element.
Decoder makeDecoderFor(const void *data, size_t data_size, DataRepresentation rep=deserialized) const
Element getElement(std::string_view full_path) const
CodecFactory(const std::string &struct_name, const std::string &dd_string)
CodecFactory(CodecFactory &&)
move CTOR
CodecFactory & operator=(CodecFactory &&)
move assignment operator
Element getElement(const CodecIndex &codec_index) const
CodecIndex resolve(size_t leaf_index, std::string &full_element_name) const
CodecFactory(const ddl::dd::StructType &struct_type, const dd::DataDefinition &dd)
std::string getElementName(const CodecIndex &codec_index) const
Retrieves the name of the element within its structured element.
ChildElements< FactoryElementAccess< const CodecFactory > > Elements
Definition codec_factory.h:190
CodecIndex resolve(size_t leaf_index) const
void resolve(CodecIndex &codec_index) const
size_t getElementChildCount(const CodecIndex &codec_index=CodecIndex()) const
a_util::result::Result isValid() const
std::string getElementFullName(const CodecIndex &codec_index) const
Retrieves the full name of the element within its main structure.
Element getChildElement(const CodecIndex &parent_codec_index, std::string_view relative_path) const
StaticCodec makeStaticCodecFor(void *data, size_t data_size, DataRepresentation rep=deserialized) const
Definition codec_factory.h:114
~CodecFactory()=default
Default dtor.
CodecFactory(const DDStructure &dd_struct)
CodecFactory(const ddl::dd::StructTypeAccess &struct_type_access)
StaticDecoder makeStaticDecoderFor(const void *data, size_t data_size, DataRepresentation rep=deserialized) const
Definition codec_factory.h:100
Codec makeCodecFor(void *data, size_t data_size, DataRepresentation rep=deserialized) const
Definition codec_index.h:276
A FactoryElement.
Definition codec_iterator.h:560
Definition static_codec.h:328
Definition static_codec.h:38
size_t getElementCount() const
The Data Definiton class uses the validation model to keep a Data Definition datamodel (ddl::dd::data...
Definition dd.h:92
Accessing class for a instance of a struct. This will calculate the byte positions can be used for se...
Definition dd_struct_access.h:598
size_t getDecoderOrFactoryElementCount(const T &decoder_or_factory)
Get the Decoder or Factory leaf element count.
Definition codec_factory.h:314
Namespace for the new faster CodecFactory/Decoder/Codec implementation.
Definition codec.h:22
std::vector< LeafCodecIndex > getLeafCodecIndices(const T &decoder_or_factory, ddl::DataRepresentation rep)
Get the leaf indices object.
Definition codec_factory.h:390
void forEachLeafElement(ElementsType &elements, const std::function< void(std::conditional_t< std::is_const< ElementsType >::value, const typename ElementsType::element_type, typename ElementsType::element_type > &)> &func)
Iterates ALL leaf elements within ALL array elements.
Definition codec_iterator.h:1475
@ deserialized
first bit is zero for deserialized data representation of the LeafCodecIndex::data_flags
Definition leaf_layout.h:30
std::vector< CodecIndex > getCodecIndices(const T &decoder_or_factory)
Retrieves all codec indices for the given codec of type T.
Definition codec_factory.h:372
definition of the dd namespace
Definition datamodel_base.h:26
datamodel::StructType StructType
Definition dd.h:59
definition of the ddl namespace
Definition codec.h:21
DataRepresentation
Definition data_representation.h:25
Definition struct_element.h:32