4 #ifndef OPENVDB_METADATA_METAMAP_HAS_BEEN_INCLUDED
5 #define OPENVDB_METADATA_METAMAP_HAS_BEEN_INCLUDED
43 void readMeta(std::istream&);
45 void writeMeta(std::ostream&)
const;
58 void insertMeta(
const MetaMap&);
61 void removeMeta(
const Name&);
73 template<
typename T>
typename T::Ptr getMetadata(
const Name&);
74 template<
typename T>
typename T::ConstPtr getMetadata(
const Name&)
const;
80 template<
typename T>
T& metaValue(
const Name&);
81 template<
typename T>
const T& metaValue(
const Name&)
const;
112 std::ostream&
operator<<(std::ostream&,
const MetaMap&);
122 return (iter == mMeta.end() ?
Metadata::Ptr() : iter->second);
129 return (iter == mMeta.end() ?
Metadata::Ptr() : iter->second);
137 inline typename T::Ptr
141 if (iter == mMeta.end())
return typename T::Ptr{};
147 if (iter->second->typeName() == T::staticTypeName()) {
148 return StaticPtrCast<T, Metadata>(iter->second);
150 return typename T::Ptr{};
154 inline typename T::ConstPtr
158 if (iter == mMeta.end())
return typename T::ConstPtr{};
164 if (iter->second->typeName() == T::staticTypeName()) {
165 return StaticPtrCast<const T, const Metadata>(iter->second);
167 return typename T::ConstPtr{};
176 MetaMap::getValidTypedMetadata(
const Name &
name)
const
179 if (iter == mMeta.end())
OPENVDB_THROW(LookupError,
"Cannot find metadata " << name);
187 m = StaticPtrCast<TypedMetadata<T>,
Metadata>(iter->second);
189 if (!m)
OPENVDB_THROW(TypeError,
"Invalid type for metadata " << name);
217 #endif // OPENVDB_METADATA_METAMAP_HAS_BEEN_INCLUDED
std::ostream & operator<<(std::ostream &ostr, const Metadata &metadata)
Write a Metadata to an output stream.
GLsizei const GLchar *const * string
#define OPENVDB_USE_VERSION_NAMESPACE
std::shared_ptr< T > SharedPtr
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
GLuint const GLchar * name
LeafData & operator=(const LeafData &)=delete
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
#define OPENVDB_THROW(exception, message)