stream_class.h#
Defines
-
FIELD_VARINT#
-
FIELD_FIXED64#
-
FIELD_FIXED_SIZE#
-
FIELD_FIXED32#
-
SERIALIZATION_METHOD()#
Serialization/parsing core declaration macro for generated proto classes.
-
BEGIN_PROTO(cls, doc)#
Macro for beginning a generated proto class with a default constructor.
-
BEGIN_PROTO_NOINIT(cls, doc)#
Macro for beginning a generated proto class without adding a default constructor.
-
END_PROTO()#
Macro for ending a generated proto class and injecting the serialization/parsing API.
-
FIELD(type, name, order, doc)#
-
FIELD_BYTES(name, order, doc)#
Like FIELD but for ByteSpan (protobuf
bytes) fields. \ Bytes are exposed as autils::ByteSpan(breaking change). The old protobuf-style \name()/mutable_##name()accessors returnedconst std::string&/std::string*, \ which is unsafe here: a ByteSpan may hold borrowed (zero-copy) or aligned-owned bytes that \ are not backed by a std::string, so exposing them as a std::string would require a hidden copy \ and could not preserve alignment or borrowed semantics.name()/mutable_##name()are \ kept but now returnutils::ByteSpan, equivalent to ref_##name(); use the ByteSpan API \ (data()/size()/assign()/…) to read or mutate bytes.
-
FIELD_DEFAULT(type, name, order, default_value, doc)#
-
FIELD_STR(name, order, doc)#
-
FIELD_REPEATED_BASE(type, repeated_type, name, order, doc)#
-
FIELD_REPEATED(type, name, order, doc)#
-
FIELD_REPEATED_STR(type, name, order, doc)#
-
FIELD_REPEATED_PROTO(type, name, order, doc)#
-
FIELD_REPEATED_PACKED(type, name, order, doc)#
-
_FIELD_OPTIONAL(type, name, order, doc)#
-
FIELD_OPTIONAL(type, name, order, doc)#
-
FIELD_OPTIONAL_ONEOF(type, name, order, oneof, doc)#
-
FIELD_OPTIONAL_ENUM(type, name, order, doc)#
-
namespace onnx_light
Alias that makes onnx-light headers compatible with code that references
ONNX_LIGHT_NAMESPACE(the macro used in the standard onnx package).Set to
ONNX_LIGHT_NAMESPACEso both names resolve to the same namespace.Symbol-visibility attribute for the public onnx-light C++ API.
Maps the upstream compatibility macro to onnx-light’s explicit proto ABI annotation. This keeps declarations from vendored ONNX headers visible when
lib_onnx_protouses hidden visibility by default.Namespace alias so that ONNX C++ code (and consumers such as onnxruntime) that refers to the literal
onnxnamespace — rather than theONNX_NAMESPACEmacro — resolves to the onnx-light namespace. The standard onnx package lives innamespace onnx; onnx-light usesonnx_light(via ONNX_LIGHT_NAMESPACE), so this alias keeps onnx-light a true drop-in. It is only introduced when the onnx-light namespace differs fromonnx.Functions
-
template<typename T>
inline bool _has_field_(const T&)# Returns true if the field holds a non-default value (always true for scalar types other than String and raw-bytes vectors, which have their own specializations).
-
template<>
inline bool _has_field_(const utils::String &field)# Returns true if the string field is non-empty.
-
template<>
inline bool _has_field_(const utils::OptionalString &field)# Returns true if the optional string field is present (proto2 optional-string presence).
-
template<>
inline bool _has_field_(const std::vector<uint8_t> &field)# Returns true if the raw-bytes field is non-empty.
-
template<>
inline bool _has_field_(const utils::ByteSpan &field)# Returns true if the ByteSpan field is non-empty (owned or borrowed).
-
template<typename T>
void CopyProtoFrom(T &dest, const T &src)# Copies all fields from src into dest. Generated for every proto class.
-
template<typename T, typename = std::enable_if_t<std::is_base_of<Message, T>::value>>
inline void swap(T &a, T &b) noexcept# ADL-visible swap for generated proto messages so that unqualified
swap(a, b)calls in consuming code (e.g. onnxruntime) resolve, mirroring the friendswapthat protobuf generates for every message class.
-
class Message#
- #include <stream_class.h>
Base class for generated ONNX proto messages.
Subclassed by onnx_light::AttributeProto, onnx_light::DeviceConfigurationProto, onnx_light::FunctionProto, onnx_light::GraphProto, onnx_light::IntIntListEntryProto, onnx_light::MapProto, onnx_light::ModelProto, onnx_light::NodeDeviceConfigurationProto, onnx_light::NodeProto, onnx_light::OperatorSetIdProto, onnx_light::OptionalProto, onnx_light::ProtoMessageAdapter< Derived >, onnx_light::SequenceProto, onnx_light::ShardedDimProto, onnx_light::ShardingSpecProto, onnx_light::SimpleShardedDimProto, onnx_light::SparseTensorProto, onnx_light::StringStringEntryProto, onnx_light::TensorAnnotation, onnx_light::TensorProto, onnx_light::TensorProto::Segment, onnx_light::TensorShapeProto, onnx_light::TensorShapeProto::Dimension, onnx_light::TypeProto, onnx_light::TypeProto::Map, onnx_light::TypeProto::Opaque, onnx_light::TypeProto::Optional, onnx_light::TypeProto::Sequence, onnx_light::TypeProto::SparseTensor, onnx_light::TypeProto::Tensor, onnx_light::ValueInfoProto
-
template<typename Derived>
class ProtoMessageAdapter : public onnx_light::Message# - #include <stream_class.h>
Supplies protobuf-compatible convenience methods without emitting one exported copy per generated message. The wire-format core declared by SERIALIZATION_METHOD and the small CopyFrom entry point remain type-specific and out of line.
Public Functions
-
SerializeSizeResult SerializeSize() const#
-
size_t ByteSizeLong() const#
-
bool ParseFromString(const std::string &raw, ParseOptions &opts)#
-
bool ParseFromArray(const void *data, int size)#
-
bool ParseFromZeroCopyStream(utils::BinaryStream *stream)#
-
bool ParseFromZeroCopyStream(utils::BinaryStream *stream, ParseOptions &opts)#
-
bool ParseFromFileDescriptor(int fd)#
-
bool SerializeToArray(void *data, int size) const#
-
bool SerializeToZeroCopyStream(utils::BinaryWriteStream *output) const#
-
bool SerializeToString(std::string &out, SerializeOptions &opts) const#
-
bool SerializeToFileDescriptor(int fd) const#
-
bool SerializeToFileDescriptor(int fd, SerializeOptions &opts) const#
-
bool SaveToFileDescriptor(int fd) const#
-
bool SaveToFileDescriptor(int fd, SerializeOptions &opts) const#
-
bool ParseFromStream(utils::BinaryStream &stream)#
-
void SerializeToStream(utils::BinaryWriteStream &stream) const#
-
SerializeSizeResult SerializeSize() const#
-
namespace proto_default_detail#
-
template<typename T>