4#ifndef OPENVDB_METADATA_HAS_BEEN_INCLUDED
5#define OPENVDB_METADATA_HAS_BEEN_INCLUDED
46 virtual std::string
str()
const = 0;
63 void write(std::ostream&)
const;
102 std::string
str()
const override {
return (mBytes.empty() ?
"" :
"<binary data>"); }
103 bool asBool()
const override {
return !mBytes.empty(); }
135 std::string
str()
const override;
175 os.write(
reinterpret_cast<const char*
>(&n),
sizeof(
Index32));
183 is.read(
reinterpret_cast<char*
>(&n),
sizeof(
Index32));
266 metadata->copy(*
this);
285 is.read(
reinterpret_cast<char*
>(&mValue), this->
size());
292 os.write(
reinterpret_cast<const char*
>(&mValue), this->
size());
299 std::ostringstream ostr;
346 return (mValue ?
"true" :
"false");
353 ostr << metadata.
str();
384 return static_cast<Index32>(mValue.size());
400 mValue.resize(
size,
'\0');
401 is.read(&mValue[0],
size);
408 os.write(
reinterpret_cast<const char*
>(&mValue[0]), this->
size());
OPENVDB_API std::ostream & operator<<(std::ostream &os, half h)
Output h to os, formatted as a float.
General-purpose arithmetic and comparison routines, most of which accept arbitrary value types (or at...
Definition Exceptions.h:64
bool isZero(const Type &x)
Return true if x is exactly equal to zero.
Definition Math.h:337
std::string Name
Definition Name.h:19
TypedMetadata< Vec4d > Vec4DMetadata
Definition Metadata.h:370
TypedMetadata< float > FloatMetadata
Definition Metadata.h:360
TypedMetadata< Vec2d > Vec2DMetadata
Definition Metadata.h:364
TypedMetadata< Vec3d > Vec3DMetadata
Definition Metadata.h:367
TypedMetadata< int32_t > Int32Metadata
Definition Metadata.h:361
TypedMetadata< Mat4d > Mat4DMetadata
Definition Metadata.h:374
std::ostream & operator<<(std::ostream &ostr, const Metadata &metadata)
Write a Metadata to an output stream.
Definition Metadata.h:351
TypedMetadata< Vec2i > Vec2IMetadata
Definition Metadata.h:365
uint32_t Index32
Definition Types.h:52
TypedMetadata< std::string > StringMetadata
Definition Metadata.h:363
TypedMetadata< Vec4s > Vec4SMetadata
Definition Metadata.h:372
TypedMetadata< Vec3s > Vec3SMetadata
Definition Metadata.h:369
std::shared_ptr< T > SharedPtr
Definition Types.h:114
TypedMetadata< Vec2s > Vec2SMetadata
Definition Metadata.h:366
TypedMetadata< Vec4i > Vec4IMetadata
Definition Metadata.h:371
TypedMetadata< Mat4s > Mat4SMetadata
Definition Metadata.h:373
TypedMetadata< Vec3i > Vec3IMetadata
Definition Metadata.h:368
TypedMetadata< bool > BoolMetadata
Definition Metadata.h:358
TypedMetadata< int64_t > Int64Metadata
Definition Metadata.h:362
TypedMetadata< double > DoubleMetadata
Definition Metadata.h:359
const char * typeNameAsString()
Definition Types.h:516
Definition Exceptions.h:13
#define OPENVDB_THROW(exception, message)
Definition Exceptions.h:74
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition version.h.in:121
#define OPENVDB_USE_VERSION_NAMESPACE
Definition version.h.in:212