4#ifndef OPENVDB_METADATA_HAS_BEEN_INCLUDED
5#define OPENVDB_METADATA_HAS_BEEN_INCLUDED
47 virtual std::string
str()
const = 0;
64 void write(std::ostream&)
const;
103 std::string
str()
const override {
return (mBytes.empty() ?
"" :
"<binary data>"); }
104 bool asBool()
const override {
return !mBytes.empty(); }
136 std::string
str()
const override;
176 os.write(
reinterpret_cast<const char*
>(&n),
sizeof(
Index32));
184 is.read(
reinterpret_cast<char*
>(&n),
sizeof(
Index32));
267 metadata->copy(*
this);
286 is.read(
reinterpret_cast<char*
>(&mValue), this->
size());
293 os.write(
reinterpret_cast<const char*
>(&mValue), this->
size());
300 std::ostringstream ostr;
347 return (mValue ?
"true" :
"false");
354 ostr << metadata.
str();
385 return static_cast<Index32>(mValue.size());
401 mValue.resize(
size,
'\0');
402 is.read(&mValue[0],
size);
409 os.write(
reinterpret_cast<const char*
>(&mValue[0]), this->
size());
#define OPENVDB_ASSERT(X)
Definition Assert.h:41
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:371
TypedMetadata< float > FloatMetadata
Definition Metadata.h:361
TypedMetadata< Vec2d > Vec2DMetadata
Definition Metadata.h:365
TypedMetadata< Vec3d > Vec3DMetadata
Definition Metadata.h:368
TypedMetadata< int32_t > Int32Metadata
Definition Metadata.h:362
TypedMetadata< Mat4d > Mat4DMetadata
Definition Metadata.h:375
std::ostream & operator<<(std::ostream &ostr, const Metadata &metadata)
Write a Metadata to an output stream.
Definition Metadata.h:352
TypedMetadata< Vec2i > Vec2IMetadata
Definition Metadata.h:366
uint32_t Index32
Definition Types.h:52
TypedMetadata< std::string > StringMetadata
Definition Metadata.h:364
TypedMetadata< Vec4s > Vec4SMetadata
Definition Metadata.h:373
TypedMetadata< Vec3s > Vec3SMetadata
Definition Metadata.h:370
std::shared_ptr< T > SharedPtr
Definition Types.h:114
TypedMetadata< Vec2s > Vec2SMetadata
Definition Metadata.h:367
TypedMetadata< Vec4i > Vec4IMetadata
Definition Metadata.h:372
TypedMetadata< Mat4s > Mat4SMetadata
Definition Metadata.h:374
TypedMetadata< Vec3i > Vec3IMetadata
Definition Metadata.h:369
TypedMetadata< bool > BoolMetadata
Definition Metadata.h:359
TypedMetadata< int64_t > Int64Metadata
Definition Metadata.h:363
TypedMetadata< double > DoubleMetadata
Definition Metadata.h:360
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:218