Alembic::Util

template <class T>
class BaseDimensions

Public Functions

BaseDimensions()
BaseDimensions(const T &t)
BaseDimensions(const BaseDimensions &copy)
template <class Y>
BaseDimensions(const BaseDimensions<Y> &copy)
BaseDimensions &operator=(const BaseDimensions &copy)
template <class Y>
BaseDimensions &operator=(const BaseDimensions<Y> &copy)
size_t rank() const
void setRank(size_t r)
T &operator[](size_t i)
const T &operator[](size_t i) const
T *rootPtr()
const T *rootPtr() const
size_t numPoints() const

Private Types

typedef std::vector<T> SizeVec

Private Members

SizeVec m_vector
class bool_t
#include <PlainOldDataType.h>

BOOLEAN BASE TYPE - since C++ doesn’t explicitly demand that bool be a given bit depth, but we need it to be here, we make our own bool type, which is a bit silly. This is purely for storage reasons.

Public Functions

bool_t()
bool_t(bool tf)
bool_t(byte_t b)
bool_t &operator=(bool tf)

Using default copy constructor ... Using default assignment operator ...

bool_t &operator=(byte_t b)
bool_t operator!(void)
bool asBool() const
operator bool() const

Private Members

byte_t m_byte
struct Digest

Inherits from Alembic::Util::ALEMBIC_VERSION_NS::totally_ordered< Digest >

Public Functions

Digest()
Digest(const Digest &copy)
Digest &operator=(const Digest &copy)
uint8_t &operator[](size_t i)
uint8_t operator[](size_t i) const
void print(std::ostream &ostr) const
std::string str() const
bool operator==(const Digest &iRhs) const
bool operator<(const Digest &iRhs) const

Public Members

uint8_t d[16]
uint64_t words[2]
union Alembic::Util::ALEMBIC_VERSION_NS::Digest::@0 Alembic::Util::ALEMBIC_VERSION_NS::Digest::@1
class Exception
#include <Exception.h>

Base class for all exceptions in the Alembic libraries. Derived from both std::exception and std::string, publicly It is mostly commonly thrown using the macros.

Public Functions

Exception()

default constructor creates exception with empty message string

Exception(const std::string &str)

Creates exception with an explicit message string. ...

Exception(const Exception &exc)

Copies exception. ...

virtual ~Exception()

Destructor is empty, but virtual to support polymorphic destruction of data in any derived classes.

virtual const char *what() const

Inherited from std::exception, this returns a non-modifiable character string describing the nature of the exception.

class mutex

Inherits from Alembic::Util::ALEMBIC_VERSION_NS::noncopyable

Public Functions

mutex()
~mutex()
void lock()
void unlock()

Private Members

pthread_mutex_t m
class noncopyable

Subclassed by Alembic::Util::ALEMBIC_VERSION_NS::mutex, Alembic::Util::ALEMBIC_VERSION_NS::scoped_lock

Protected Functions

noncopyable()
~noncopyable()

Private Functions

noncopyable(const noncopyable&)
const noncopyable &operator=(const noncopyable&)
template <PlainOldDataType PODT, class T>
struct PODTraits
template <PlainOldDataType PENUM>
struct PODTraitsFromEnum
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kBooleanPOD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kFloat16POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kFloat32POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kFloat64POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kInt16POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kInt32POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kInt64POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kInt8POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kStringPOD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kUint16POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kUint32POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kUint64POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kUint8POD>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromEnum<kWstringPOD>
template <class PTYPE>
struct PODTraitsFromType
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<bool_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<float16_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<float32_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<float64_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<int16_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<int32_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<int64_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<int8_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<string>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<uint16_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<uint32_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<uint64_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<uint8_t>
template <>
struct >
class Alembic::Util::ALEMBIC_VERSION_NS::PODTraitsFromType<wstring>
class scoped_lock

Inherits from Alembic::Util::ALEMBIC_VERSION_NS::noncopyable

Public Functions

scoped_lock(mutex &l)
~scoped_lock()

Private Members

mutex &m
class SpookyHash

Public Functions

void Init(uint64_t seed1, uint64_t seed2)
void Update(const void *message, size_t length)
void Final(uint64_t *hash1, uint64_t *hash2)

Public Static Functions

static void Hash128(const void *message, size_t length, uint64_t *hash1, uint64_t *hash2)
static uint64_t Hash64(const void *message, size_t length, uint64_t seed)
static uint32_t Hash32(const void *message, size_t length, uint32_t seed)
static uint64_t Rot64(uint64_t x, int k)
static void Mix(const uint64_t *data, uint64_t &s0, uint64_t &s1, uint64_t &s2, uint64_t &s3, uint64_t &s4, uint64_t &s5, uint64_t &s6, uint64_t &s7, uint64_t &s8, uint64_t &s9, uint64_t &s10, uint64_t &s11)
static void EndPartial(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3, uint64_t &h4, uint64_t &h5, uint64_t &h6, uint64_t &h7, uint64_t &h8, uint64_t &h9, uint64_t &h10, uint64_t &h11)
static void End(const uint64_t *data, uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3, uint64_t &h4, uint64_t &h5, uint64_t &h6, uint64_t &h7, uint64_t &h8, uint64_t &h9, uint64_t &h10, uint64_t &h11)
static void ShortMix(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3)
static void ShortEnd(uint64_t &h0, uint64_t &h1, uint64_t &h2, uint64_t &h3)

Private Members

uint64_t m_data[2 *sc_numVars]
uint64_t m_state[sc_numVars]
size_t m_length
uint8_t m_remainder

Private Static Functions

static void Short(const void *message, size_t length, uint64_t *hash1, uint64_t *hash2)

Private Static Attributes

const size_t sc_numVars
const size_t sc_blockSize
const size_t sc_bufSize
const uint64_t sc_const
class TokenMap
#include <TokenMap.h>

A wrapper around std::map that serializes and deserializes the map into a doubly-tokenized string, usually of the form token=value;token=value;token=value;.

Public Types

typedef std::map<std::string, std::string> map_type

The map_type is std::map<std::string,std::string> ...

typedef map_type::key_type key_type

key_type promoted from map_type::key_type, which is std::string ...

typedef std::string data_type

data_type promoted from map_type::data_type, which is std::string ...

typedef map_type::value_type value_type

value_type promoted from map_type::value_type, which is std::pair<std::string, std::string>

typedef map_type::iterator iterator

iterator promoted from map_type::iterator ...

typedef map_type::const_iterator const_iterator

const_iterator promoted from map_type::iterator ...

typedef map_type::reverse_iterator reverse_iterator

reverse_iterator promoted from map_type::reverse_iterator ...

typedef map_type::const_reverse_iterator const_reverse_iterator

const_reverse_iterator promoted from map_type::const_reverse_iterator ...

typedef map_type::reference reference

reference promoted from map_type::reference ...

typedef map_type::const_reference const_reference

const_reference promoted from map_type::const_reference ...

Public Functions

TokenMap()

Default constructor Map is initialized with no entries. Values can be added using The set and setUnique member functions.

TokenMap(const std::string &config, char pairSeparator = ';', char assignSeparator = '=', bool unique = false, bool quiet = true)

Explicit constructor Map is initialized from given string, using the delimiter scheme as presented. If the ‘unique’ bool is ‘true’, it will use the setUnique function, obeying the ‘quiet’ bool accordingly. Otherwise it will use the set function.

void set(const std::string &config, char pairSeparator = ';', char assignSeparator = '=')

This function sets the token/value pairs in the map by deserializing them from a doubly-delimited string.

Using default copy constructor ... Using default assignment operator. ...

The delimiter scheme defaults to: “token=value;token=value;token=value” but may be overridden using the optional separator arguments. Values are added to the map one-by-one, overwriting any values that were there before. To avoid overwriting, use the setUnique function, which can silently or rigidly deal with conflicts

void setUnique(const std::string &config, char pairSeparator = ';', char assignSeparator = '=', bool quiet = true)

This function sets only unique (not already stored) token/value pairs by deserializing them from a doubly-delimited string.

The delimiter scheme and rules are the same as set , the main difference here is that the class will not overwrite values that already exist. If the function is called with the default value of ‘true’ for the ‘quiet’ parameter, it will simply not write those values. Otherwise, it will throw a Alembic::Util::Exception

std::string get(char pairSeparator = ';', char assignSeparator = '=', bool check = false) const

This function turns the map back into a doubly-tokenized string.

The passed delimiters are used to delimit the string, and they have default values. Checking is optionally performed (based on the ‘check’ bool) to make sure neither the tokens nor values contain the delimiter characters, and an Alembic::Util::Exception is thrown if a conflict is detected.

void clear()
size_t size() const

This function returns the number of pairs. ...

bool tokenExists(const std::string &token) const

This function returns whether the map contains an entry for a particular token.

std::string value(const std::string &token) const

This function returns the string value associated with a particular token, or the empty string “” if the map does not contain this token-value pair.

std::string operator[](const std::string &token) const

This function is a shorthand for value It will not return a modifiable entry. To modify, setValue must be used.

void setValue(const std::string &keyStr, const std::string &valueStr)

This function sets the value of a token. It will either add a new token-value pair if the map does not already contain this token, or it will overwrite the value for this token if it already exists. You can use the tokenExists function to manage uniqueness guarantees.

iterator begin()

same as std::map begin Returns an iterator corresponding to the beginning of the map or the end of the map if the map is empty.

const_iterator begin() const

same as std::map begin const Returns a const_iterator corresponding to the beginning of the map or the end of the map if the map is empty.

iterator end()

same as std::map end Returns an iterator corresponding to the end of the map.

const_iterator end() const

same as std::map end const Returns an const_iterator corresponding to the end of the map.

reverse_iterator rbegin()

same as std::map rbegin Returns an reverse_iterator corresponding to the reverse_beginning of the map or the reverse_end of the map if the map is empty.

const_reverse_iterator rbegin() const

same as std::map rbegin const Returns a const_reverse_iterator corresponding to the beginning of the map or the end of the map if the map is empty.

reverse_iterator rend()

same as std::map rend Returns an reverse_iterator corresponding to the reverse end of the map.

const_reverse_iterator rend() const

same as std::map rend const Returns an const_reverse_iterator corresponding to the end of the map.

bool exactMatch(const TokenMap &iOther) const

Return an exact match ...

Protected Attributes

map_type m_map
template <class T>
class totally_ordered

Friends

bool operator>(const T &x, const T &y)
bool operator<=(const T &x, const T &y)
bool operator>=(const T &x, const T &y)
bool operator!=(const T &x, const T &y)
namespace Alembic

Alembic namespace ...

namespace Util
namespace ALEMBIC_VERSION_NS

Typedefs

typedef unsigned char byte_t

Bytes are unsigned chars, by definition. We use bytes in Alembic as the name of anonymous storage memory, since it is not possible to create arrays of voids.

typedef half float16_t
typedef float float32_t
typedef double float64_t
typedef BaseDimensions<Alembic::Util::uint64_t> Dimensions

Enums

enum PlainOldDataType

I’m using explicit names here because the terms ‘int’, ‘short’, ‘long’, etc, have different bit-depths on different machine architectures. To avoid any ambiguity whatsoever, I’m just making these explicit. End users will rarely see these anyway, so it’s okay to be a bit pedantic.

These are always represented in the endian-ness of the host machine when resident in working memory, but need to have an explicit endian-ness when being written out. That’s hidden from the user by HDF5.

Values:

kBooleanPOD

Booleans are difficult to store in arrays in a ‘one bit per bool’ kind of way, so we actually file them as bytes (uint8). But again this is entirely hidden from the end user. Implemented via the “bool_t” type defined above.

kUint8POD

Char/UChar.

kInt8POD
kUint16POD

Short/UShort.

kInt16POD
kUint32POD

Int/UInt.

kInt32POD
kUint64POD

Long/ULong.

kInt64POD
kFloat16POD

Half/Float/Double.

kFloat32POD
kFloat64POD
kStringPOD

String Pointer.

kWstringPOD

Wide String Pointer.

kNumPlainOldDataTypes

Number of POD.

kUnknownPOD = 127

Unknown.

Functions

ALEMBIC_EXPORT bool Alembic::Util::ALEMBIC_VERSION_NS::isStandardName(const std::string & name)
ALEMBIC_EXPORT void Alembic::Util::ALEMBIC_VERSION_NS::makeStandardName(std::string & name, const char fixChar = '_')
bool operator==(const bool_t &a, const bool_t &b)
bool operator==(const bool_t &a, bool b)
bool operator==(bool a, const bool_t &b)
bool operator!=(const bool_t &a, const bool_t &b)
bool operator!=(const bool_t &a, bool b)
bool operator!=(bool a, const bool_t &b)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kBooleanPOD, bool_t, "bool_t", false, BooleanPODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kUint8POD, uint8_t, "uint8_t", 0, Uint8PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kInt8POD, int8_t, "int8_t", 0, Int8PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kUint16POD, uint16_t, "uint16_t", 0, Uint16PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kInt16POD, int16_t, "int16_t", 0, Int16PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kUint32POD, uint32_t, "uint32_t", 0, Uint32PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kInt32POD, int32_t, "int32_t", 0, Int32PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kUint64POD, uint64_t, "uint64_t", 0, Uint64PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kInt64POD, int64_t, "int64_t", 0, Int64PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kFloat16POD, float16_t, "float16_t", 0, Float16PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kFloat32POD, float32_t, "float32_t", 0, Float32PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kFloat64POD, float64_t, "float64_t", 0, Float64PODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kStringPOD, string, "string", "", StringPODTraits)
Alembic::Util::ALEMBIC_VERSION_NS::DECLARE_TRAITS(kWstringPOD, wstring, "wstring", L"", WstringPODTraits)
size_t PODNumBytes(PlainOldDataType pod)
const char *PODName(PlainOldDataType pod)
PlainOldDataType PODFromName(const std::string &n)
template <PlainOldDataType POD>
void PODSetDefaultPOD(void *addr)

This actually does work with strings!

void PODSetDefault(PlainOldDataType pod, void *bytes)
ALEMBIC_EXPORT void Alembic::Util::ALEMBIC_VERSION_NS::MurmurHash3_x64_128(const void * key, const size_t len, const size_t podSize, void * out)
std::ostream &operator<<(std::ostream &ostr, const Digest &a)
bool operator==(const TokenMap &iA, const TokenMap &iB)
template <class T, class Y>
bool operator==(const BaseDimensions<T> &a, const BaseDimensions<Y> &b)
template <class T, class Y>
bool operator!=(const BaseDimensions<T> &a, const BaseDimensions<Y> &b)
template <class T>
std::ostream &operator<<(std::ostream &ostr, const BaseDimensions<T> &a)
file All.h
#include <Alembic/Util/Export.h>#include <Alembic/Util/Foundation.h>#include <Alembic/Util/Digest.h>#include <Alembic/Util/Dimensions.h>#include <Alembic/Util/Exception.h>#include <Alembic/Util/Murmur3.h>#include <Alembic/Util/Naming.h>#include <Alembic/Util/OperatorBool.h>#include <Alembic/Util/PlainOldDataType.h>#include <Alembic/Util/TokenMap.h>#include <Alembic/Util/SpookyV2.h>
file Config.h

Defines

ALEMBIC_LIBRARY_VERSION
file Digest.h
#include <Alembic/Util/Foundation.h>#include <Alembic/Util/PlainOldDataType.h>
file Dimensions.h
#include <Alembic/Util/Foundation.h>#include <Alembic/Util/PlainOldDataType.h>
file Exception.h
#include <Alembic/Util/Foundation.h>

Header file containing class definition for class Alembic::Util::Exception.

Defines

ABC_THROW(TEXT)

convenient macro which may be used with std::iostream syntax

Same as ALEMBIC_THROW

ALEMBIC_THROW(TEXT)

convenient macro which may be used with std::iostream syntax

Same as ABC_THROW

file Export.h

Defines

ALEMBIC_EXPORT
ALEMBIC_EXPORT_CONST
file Foundation.h
#include <Alembic/Util/Config.h>#include <unordered_map>#include <memory>#include <half.h>#include <iomanip>#include <iostream>#include <sstream>#include <exception>#include <limits>#include <map>#include <string>#include <vector>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include <Alembic/Util/Export.h>#include <algorithm>

Defines

ALEMBIC_VERSION_NS
file Murmur3.h
#include <Alembic/Util/Export.h>#include <Alembic/Util/Foundation.h>
file Naming.h
#include <string>#include <Alembic/Util/Export.h>#include <Alembic/Util/Foundation.h>
file OperatorBool.h
#include <Alembic/Util/Foundation.h>

Defines

ALEMBIC_OPERATOR_BOOL(PASS_COND)
ALEMBIC_OVERRIDE_OPERATOR_BOOL(PASS_COND)
file PlainOldDataType.h
#include <Alembic/Util/Foundation.h>#include <Alembic/Util/Exception.h>#include <stdint.h>

Defines

DECLARE_TRAITS(PENUM, PTYPE, PNAME, DFLT, PTDEF)

Unfortunately, C++ only allows for static const declaration of constants with integral types, not floating. Therefore, we have the whole inlined static function for default values.

file SpookyV2.h
#include <Alembic/Util/Export.h>#include <Alembic/Util/PlainOldDataType.h>
file TokenMap.h
#include <Alembic/Util/Export.h>#include <Alembic/Util/Exception.h>#include <Alembic/Util/Foundation.h>

The header file containing the class definition for the Alembic::Util::TokenMap class.