MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ add_field()

template<typename T >
requires (ArithmeticData<T> || std::same_as<std::remove_cvref_t<T>, std::string> || std::same_as<std::remove_cvref_t<T>, std::vector<uint8_t>>)
bool MayaFlux::Kakshya::CompositeLayout::add_field ( std::string  name)
inline

Declare a named arithmetic, text, or binary field.

Template Parameters
TExact stored type; use std::string for text or std::vector<uint8_t> for binary bytes.
Parameters
nameNonempty unique field name.
Returns
True if added; false if the name is invalid, duplicated, or the layout has already been finalized.

Definition at line 65 of file Composite.hpp.

66 {
67 if constexpr (std::same_as<std::remove_cvref_t<T>, std::string>
68 || std::same_as<std::remove_cvref_t<T>, std::vector<uint8_t>>) {
69 return add_field_impl(std::move(name), typeid(T), 2 * sizeof(uint64_t));
70 } else {
71 return add_field_impl(std::move(name), typeid(T), sizeof(T));
72 }
73 }
std::string name
Definition VKDevice.cpp:123
bool add_field_impl(std::string name, std::type_index type, size_t size_bytes)
Definition Composite.cpp:32

References name.

Referenced by MayaFlux::IO::DelimitedTextReader::open().

+ Here is the caller graph for this function: