Alembic::AbcCoreAbstract

The AbcCoreAbstract library is an almost-pure abstract library that describes the interfaces that the storage layer (e.g. AbcCoreHDF5) has to implement for Alembic. The AbcCoreAbstract layer specifies the interface for concepts like Objects or Properties, and the byte-size of data. More on the Alembic concepts like Objects or Properties.

One important piece of Alembic that is defined in this layer is Alembic’s notion of time, in the form of the TimeSampling and TimeSamplingType classes. These are non-abstract classes, and provide a rich interface for working with the temporal component of data samples, and are some of the only classes from this layer that are directly and prominently exposed in higher layers.

AbcCoreAbstract is not intended to be the primary human-friendly data-manipulation library in Alembic; that distinction is held by the Abc library.

class ArchiveReader
#include <ArchiveReader.h>

The Archive is “the file”. It has a single object, it’s top object. It has no properties, but does have metadata.

Public Functions

virtual ~ArchiveReader()

Virtual destructor ...

virtual const std::string &getName() const = 0

Return the archive (file) name. This is the name of the file which the root reader is associated with.

virtual const MetaData &getMetaData() const = 0

The meta data of the archive is the same as the meta data of the top-level object reader.

virtual ObjectReaderPtr getTop() = 0

Get (or open) a pointer to the top object reader corresponding to this archive.

virtual ReadArraySampleCachePtr getReadArraySampleCachePtr() = 0

Get the read array sample cache. It may be a NULL pointer. Caches can be shared amongst separate archives, and caching will is disabled if a NULL cache is returned here.

virtual void setReadArraySampleCachePtr(ReadArraySampleCachePtr iPtr) = 0

Set the read array sample cache. It may also be a NULL pointer. Caches can be shared amongst separate archives, and caching will be disabled if a NULL cache is passed here.

virtual TimeSamplingPtr getTimeSampling(uint32_t iIndex) = 0

Returns the TimeSampling at a given index.

virtual index_t getMaxNumSamplesForTimeSamplingIndex(uint32_t iIndex) = 0

Returns the maximum number of samples written for the TimeSampling at the given index. If an illegal iIndex is specified, or a max number of samplings couldn’t be found for that iIndex (for older archives pre 1.1.3) INDEX_UNKNOWN will be returned.

virtual uint32_t getNumTimeSamplings() = 0

Returns the total number of TimeSamplingPtrs in the Archive TimeSampling pool.

virtual int32_t getArchiveVersion() = 0

Returns the Alembic library numeric version (see Foundation.h) of this archive file.

virtual ArchiveReaderPtr asArchivePtr() = 0

Return self ...

struct ArchiveReaderConstructor

Public Functions

ArchiveReaderPtr operator()(const std::string &iFileName)
ArchiveReaderPtr operator()(const std::string &iFileName, ReadArraySampleCachePtr iCachePtr)
class ArchiveWriter
#include <ArchiveWriter.h>

The Archive is “the file”. It has a single object, it’s top object. It has no properties, but does have metadata.

Public Functions

virtual ~ArchiveWriter()

Virtual destructor ...

virtual const std::string &getName() const = 0

Return the archive (file) name. This is the name of the file which the archive writer is associated with.

virtual const MetaData &getMetaData() const = 0

The meta data of the archive is the same as the meta data of the top-level object writer.

virtual ObjectWriterPtr getTop() = 0

Get the top object writer. Archives always have this single top-level object created automatically.

int8_t getCompressionHint() const

Get the compression applied to array properties. Implementations are free to disregard this.

void setCompressionHint(int8_t iCh)

Set the compression applied to array properties. Implementations are free to disregard this. -1 means off, 0 means “litte”, where 9 means “alot”

virtual ArchiveWriterPtr asArchivePtr() = 0

Return self May sometimes be spoofed.

virtual uint32_t addTimeSampling(const TimeSampling &iTs) = 0

Adds the TimeSampling to the Archive TimeSampling pool. If the TimeSampling already exists in the pool, the index for the match should be returned. index 0 is automatically reserved for uniform time sampling with a start time of 0 and time per cycle of 1 (aka identity sampling)

virtual TimeSamplingPtr getTimeSampling(uint32_t iIndex) = 0

Returns the TimeSampling at a given index. index 0 is automatically reserved for uniform time sampling with a start time of 0 and time per cycle of 1 (aka identity sampling)

virtual uint32_t getNumTimeSamplings() = 0

Returns the total number of TimeSamplingPtrs in the Archive TimeSampling pool.

virtual index_t getMaxNumSamplesForTimeSamplingIndex(uint32_t iIndex) = 0

Returns the maximum number of samples written for the TimeSampling at the given index. If an illegal iIndex is specified, INDEX_UNKNOWN will be returned.

virtual void setMaxNumSamplesForTimeSamplingIndex(uint32_t iIndex, index_t iMaxIndex) = 0

Sets the maximum number of samples written for the TimeSampling at the given index. You normally don’t need to call this as the properties will call it at the appropriate time.

Protected Functions

ArchiveWriter()

Private Members

int8_t m_compressionHint
struct ArchiveWriterConstructor

Public Functions

ArchiveWriterPtr operator()(const std::string &iFileName, const MetaData &iMetaData)
class ArrayPropertyReader
#include <ArrayPropertyReader.h>

An Array Property is a Rank N (usually 1-3) property which has a multidimensional array of identically typed values for each sample. This is distinguished from a Simple Property, which has a single element per sample, and requires less sophisticated resource management.

Inherits from Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::BasePropertyReader

Public Functions

virtual ~ArrayPropertyReader()

Virtual destructor ...

virtual size_t getNumSamples() = 0

Return the number of samples contained in the property. This can be any number, including zero. This returns the number of samples that were written, independently of whether or not they were constant. Implementations may (and should) choose to condense identical samples.

virtual bool isConstant() = 0

Ask if we’re constant - no change in value amongst samples, regardless of the time sampling.

virtual void getSample(index_t iSampleIndex, ArraySamplePtr &oSample) = 0

It returns a shared pointer to a thing which _is_ the data, in a locked and retrieved form. This represents the point of demand, not below here. Implementations of this library can (and should) utilize the custom-deleter capabilities of the smart_ptr to add locking and unlocking access to cache or management code. It will throw an exception on an out-of-range access. Though it could technically return the pointer by value efficiently enough, we return by reference so that the calling signature mirrors the ScalarPropertyReader.

For each DataType, the ( void * ) data buffer returned in the array sample points to one data element, which in the case of DataType( kStringPOD, 1 ) and DataType( kWstringPOD, 1 ) are arrays of std::string and std::wstring, respectively.

virtual std::pair<index_t, chrono_t> getFloorIndex(chrono_t iTime) = 0

Find the largest valid index that has a time less than or equal to the given time. Invalid to call this with zero samples. If the minimum sample time is greater than iTime, index 0 will be returned.

virtual std::pair<index_t, chrono_t> getCeilIndex(chrono_t iTime) = 0

Find the smallest valid index that has a time greater than the given time. Invalid to call this with zero samples. If the maximum sample time is less than iTime, index numSamples-1 will be returned.

virtual std::pair<index_t, chrono_t> getNearIndex(chrono_t iTime) = 0

Find the valid index with the closest time to the given time. Invalid to call this with zero samples.

virtual bool getKey(index_t iSampleIndex, ArraySampleKey &oKey) = 0

Expose the key for apps that use their own custom cache management.

virtual void getDimensions(index_t iSampleIndex, Dimensions &oDim) = 0

The ArraySample may have incorrect dimensions, (even though the packed data will be correct) expose the correct dimensions here for those clients that need it.

virtual bool isScalarLike() = 0

A hint about whether this property has 1 and only 1 DataType for each of it’s samples. Array Properties with no samples written to it are still considered scalar like.

virtual void getAs(index_t iSample, void *iIntoLocation, PlainOldDataType iPod) = 0

Reads the data for the requested sample into the memory location specified by iIntoLocation as the requested POD type specified by iPod. Out-of-range indices, or incompatible POD types will cause an exception to be thrown.

Incompatible POD types include trying to read a std::string, std::wstring, or float16_t as anything OTHER than itself.

In all cases EXCEPT String and Wstring, the iPod type and the total number of items from getDimensions for this property can be used to determine the size of the memory buffer which iIntoLocation must point to. In the case of String and Wstring, iIntoLocation should be an array of std::string or std::wstring.

This is one of the only places where we break from POD types at the base, and we’re making an explicit decision to use std::string and std::wstring as core language-level primitives.

class ArrayPropertyWriter
#include <ArrayPropertyWriter.h>

An Array Property is a Rank N (usually 1-3) property which has a multidimensional array of identically typed values for each sample. This is distinguished from a Simple Property, which has a single element per sample, and requires less sophisticated resource management.

Inherits from Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::BasePropertyWriter

Public Functions

virtual ~ArrayPropertyWriter()

Virtual destructor ...

virtual void setSample(const ArraySample &iSamp) = 0

Sets a sample

This takes a read-only ArraySample by const reference. The class will make an internal copy (or the functional equivalent of ), and will not use that memory block outside the scope of this function call.

Arrays of std::string and std::wstring are assumed to be treated just like regular data elements.

virtual void setFromPreviousSample() = 0

Set the next sample to equal the previous sample. An important feature!

virtual size_t getNumSamples() = 0

Return the number of samples that have been written so far. This changes as samples are written.

virtual void setTimeSamplingIndex(uint32_t iIndex) = 0

Changes the TimeSampling used by this property. If the TimeSampling is changed to Acyclic and the number of samples currently set is more than the number of times provided in the Acyclic TimeSampling, an exception will be thrown.

class ArraySample
#include <ArraySample.h>

The ArraySample class is a reference to a block of memory corresponding to an array of instances of DataTypes. The array may be multi-rank, with different sizes in each dimension, but with its data ultimately stored contiguously. The class is basically just a bundle of a memory address, stored as a void*, a DataType, and a Dimension.

The ArraySample itself does not pretend to own the data referred to memory address “data”. It is just a reference. For data retention mgmt, see the note on ArraySamplePtr below.

Public Types

typedef ArraySample this_type
typedef ArraySampleKey Key
typedef Key key_type

Public Functions

ArraySample()

Default constructor creates NULL bytes with degenerate dimensions. ...

ArraySample(const void *iData, const DataType &iDataType, const Dimensions &iDims)

Explicit constructor takes bytes and dims by reference and creates its own reference to them.

const void *getData() const

Using Default Copy Constructor Using Default Assignment Operator Return the data as a raw pointer ...

const DataType &getDataType() const

Return the datatype. ...

const Dimensions &getDimensions() const

Return the dimensions ...

size_t size() const

Return the “size”, which is getDimensions().numPoints() ...

Key getKey() const

Compute the Key. This is a calculation.

bool valid() const

Return if it is valid. An empty ArraySample is valid. however, an ArraySample that is empty and has a scalar dimension is invalid. This is how we discriminate between setting a sample of length zero (useful in particle systems) vs. indicating an invalid sample (NULL).

void reset()

Reset the array sample to an empty, invalid state. Basically the same as calling *this = ArraySample();

Private Members

const void *m_data
DataType m_dataType
Dimensions m_dimensions
struct ArraySampleKey

Public Functions

bool operator==(const ArraySampleKey &iRhs) const
bool operator<(const ArraySampleKey &iRhs) const

Public Members

uint64_t numBytes

total number of bytes of the sample as originally stored

PlainOldDataType origPOD

Original POD as stored.

PlainOldDataType readPOD

POD used at read time.

Digest digest
struct ArraySampleKeyEqualTo

Public Functions

bool operator()(ArraySampleKey const &a, ArraySampleKey const &b) const
struct ArraySampleKeyStdHash

Public Functions

size_t operator()(ArraySampleKey const &a) const
class BasePropertyReader
#include <BasePropertyReader.h>

Base Property Reader.

Subclassed by Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ArrayPropertyReader, Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::CompoundPropertyReader, Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarPropertyReader

Public Functions

virtual ~BasePropertyReader()

Virtual destructor ...

virtual const PropertyHeader &getHeader() const = 0

Properties are created with a collection of metadata that is stored in a lightweight structure called PropertyHeader. This returns a constant reference to the PropertyHeader which was given upon creation.

const std::string &getName() const

All properties have a name, which is unique amongst its siblings in the compund property they all live in. This is the name that was given when the property was created, and is part of the property header.

PropertyType getPropertyType() const

There are three types of abstract properties. They are Scalar, Array, and Compound properties. This function returns an enum PropertyType which indicates which property type is returned. This is simply a convenience function which returns data from the PropertyHeader.

bool isScalar() const

Convenience to return whether the property is scalar. Same as getPropertyType() == kScalarProperty

bool isArray() const

Convenience to return whether the property is array. Same as getPropertyType() == kArrayProperty

bool isCompound() const

Convenience to return whether the property is compound. Same as getPropertyType() == kCompoundProperty

bool isSimple() const

Convenience to return whether the property is simple (non-compound) Same as getPropertyType() != kCompoundProperty

const MetaData &getMetaData() const

All properties have MetaData. This just returns the MetaData portion of the header that was used in creation.

const DataType &getDataType() const

Non-compound properties have a DataType. It is an error to call this function for CompoundProperties, and an exception will be thrown. This is a convenience function which just returns the DataType from the header that was used in creation.

TimeSamplingPtr getTimeSampling() const

Non-compound properties have a TimeSampling. It is an error to call this function for CompoundProperties, and an exception will be thrown. This is a convenience function which just returns the TimeSampling from the header that was used in creation.

virtual ObjectReaderPtr getObject() = 0

All properties have an object that owns them, and in order to ensure the object stays alive as long as the properties do, they retain a shared pointer to their object.

virtual CompoundPropertyReaderPtr getParent() = 0

Most properties live in a compound property. (Except for the top-compound property in any object) This returns a pointer to the parent compound property.

virtual ScalarPropertyReaderPtr asScalarPtr()

Up-cast this base property to a ScalarProperty, if such an upcast is valid. This can be checked with the isScalar() function. If the upcast is not valid, an empty pointer will be returned. This default implementation returns an empty pointer.

virtual ArrayPropertyReaderPtr asArrayPtr()

Up-cast this base property to an ArrayProperty, if such an upcast is valid. This can be checked with the isArray() function. If the upcast is not valid, an empty pointer will be returned. This default implementation returns an empty pointer.

virtual CompoundPropertyReaderPtr asCompoundPtr()

Up-cast this base property to a CompoundProperty, if such an upcast is valid. This can be checked with the isCompound() function. If the upcast is not valid, an empty pointer will be returned. This default implementation returns an empty pointer.

class BasePropertyWriter
#include <BasePropertyWriter.h>

The BasePropertyWriter is the base class for all properties, from Simple (which encompasses Scalar and Array properties) to Compound. The functions here establish the things which all properties have in common - name, metaData, propertyType, as well as upcasting capabilities. We don’t want to rely on dynamic_cast - it’s slow and potentially has problems across DSO interfaces.

Subclassed by Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ArrayPropertyWriter, Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::CompoundPropertyWriter, Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarPropertyWriter

Public Functions

virtual ~BasePropertyWriter()

Virtual destructor ...

virtual const PropertyHeader &getHeader() const = 0

Properties are created with a collection of metadata that is stored in a lightweight structure called PropertyHeader. This returns a constant reference to the PropertyHeader which was given upon creation.

const std::string &getName() const

All properties have a name, which is unique amongst its siblings in the compund property they all live in. This is the name that was given when the property was created, and is part of the property header.

PropertyType getPropertyType() const

There are three types of abstract properties. They are Scalar, Array, and Compound properties. This function returns an enum PropertyType which indicates which property type is returned. This is simply a convenience function which returns data from the PropertyHeader.

bool isScalar() const

Convenience to return whether the property is scalar. Same as getPropertyType() == kScalarProperty

bool isArray() const

Convenience to return whether the property is array. Same as getPropertyType() == kArrayProperty

bool isCompound() const

Convenience to return whether the property is compound. Same as getPropertyType() == kCompoundProperty

bool isSimple() const

Convenience to return whether the property is simple (non-compound) Same as getPropertyType() != kCompoundProperty

const MetaData &getMetaData() const

All properties have MetaData. This just returns the MetaData portion of the header that was used in creation.

const DataType &getDataType() const

Non-compound properties have a DataType. It is an error to call this function for CompoundProperties, and an exception will be thrown. This is a convenience function which just returns the DataType from the header that was used in creation.

TimeSamplingPtr getTimeSampling() const

Non-compound properties have a TimeSampling. It is an error to call this function for CompoundProperties, and an exception will be thrown. This is a convenience function which just returns the TimeSamplingType from the header that was used in creation.

virtual ObjectWriterPtr getObject() = 0

All properties have an object that owns them, and in order to ensure the object stays alive as long as the properties do, they retain a shared pointer to their object.

virtual CompoundPropertyWriterPtr getParent() = 0

Most properties live in a compound property. (Except for the top-compound property in any object) This returns a pointer to the parent compound property.

virtual ScalarPropertyWriterPtr asScalarPtr()

Up-cast this base property to a ScalarProperty, if such an upcast is valid. This can be checked with the isScalar() function. If the upcast is not valid, an empty pointer will be returned. This default implementation returns an empty pointer.

virtual ArrayPropertyWriterPtr asArrayPtr()

Up-cast this base property to an ArrayProperty, if such an upcast is valid. This can be checked with the isArray() function. If the upcast is not valid, an empty pointer will be returned. This default implementation returns an empty pointer.

virtual CompoundPropertyWriterPtr asCompoundPtr()

Up-cast this base property to a CompoundProperty, if such an upcast is valid. This can be checked with the isCompound() function. If the upcast is not valid, an empty pointer will be returned. This default implementation returns an empty pointer.

class CompoundPropertyReader
#include <CompoundPropertyReader.h>

A CompoundProperty is a group of other properties, possibly Simple or possibly Compound. Every object has at one of these.

Inherits from Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::BasePropertyReader

Public Functions

virtual ~CompoundPropertyReader()

Virtual destructor ...

virtual size_t getNumProperties() = 0

Returns the number of properties read from the file ...

virtual const PropertyHeader &getPropertyHeader(size_t i) = 0

Return the header of a property by index. This will throw an exception on out-of-range access.

virtual const PropertyHeader *getPropertyHeader(const std::string &iName) = 0

Return the header of a property name. This will return a NULL pointer if no header by that name is found.

virtual ScalarPropertyReaderPtr getScalarProperty(const std::string &iName) = 0

Get a Scalar Property by name.. It will return an empty pointer if the property is not scalar or is not found.

virtual ArrayPropertyReaderPtr getArrayProperty(const std::string &iName) = 0

Get a Array Property by name.. It will return an empty pointer if the property is not array or is not found.

virtual CompoundPropertyReaderPtr getCompoundProperty(const std::string &iName) = 0

Get a Compound Property by name.. It will return an empty pointer if the property is not compound or is not found.

BasePropertyReaderPtr getProperty(const std::string &iName)

Get a base property by name. That property can be safely upcast. This is a convenience function that uses getPropertyHeader and the various named “get” functions here.

ScalarPropertyReaderPtr getScalarProperty(size_t i)

Get a Scalar Property by index. It will return an empty pointer if the property is not scalar or is not found. This is convenience function that uses the above functions to get the answer.

ArrayPropertyReaderPtr getArrayProperty(size_t i)

Get a Array Property by index. It will return an empty pointer if the property is not array or is not found. This is convenience function that uses the above functions to get the answer.

CompoundPropertyReaderPtr getCompoundProperty(size_t i)

Get a Compound Property by index. It will return an empty pointer if the property is not compound or is not found. This is convenience function that uses the above functions to get the answer.

BasePropertyReaderPtr getProperty(size_t i)

Get a base property by index. It is an error to call with out-of-range indices. This is a convenience function that uses getPropertyHeader and the various named “get” functions here.

class CompoundPropertyWriter
#include <CompoundPropertyWriter.h>

A CompoundProperty is a group of other properties, possibly Simple or possibly Compound. Every object has at one of these.

Inherits from Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::BasePropertyWriter

Public Functions

virtual ~CompoundPropertyWriter()

Virtual destructor ...

virtual size_t getNumProperties() = 0

Returns the number of properties that have been created thus far. May change as more are created.

virtual const PropertyHeader &getPropertyHeader(size_t i) = 0

Return the header of a property that has already been added. Property is selected by index. This will throw an exception on out-of-range access.

virtual const PropertyHeader *getPropertyHeader(const std::string &iName) = 0

Return the header of a property that has already been added, found by name. A typical use of this would be for an application that wants to incrementally add properties, and wishes to query whether a property of a given name has already been added, before attempting to add a new one. This will return NULL if no property of the given name has been added.

BasePropertyWriterPtr getProperty(size_t i)

It is an error to request for a property by index out of range. This returns a property that has ALREADY BEEN ADDED. This will throw an exception on out-of-range access. There is a possibility it could return a NULL pointer, if the added property has been closed (deleted). This is just a convenience function which calls getPropertyHeader and then getProperty.

virtual BasePropertyWriterPtr getProperty(const std::string &iName) = 0

Returns an ALREADY ADDED PROPERTY by name. If it can’t find one by name, it returns an empty pointer. This can also happen if the property was added, but has been closed (deleted).

virtual ScalarPropertyWriterPtr createScalarProperty(const std::string &iName, const MetaData &iMetaData, const DataType &iDataType, uint32_t iTimeSamplingIndex) = 0

Create and return the requested scalar property. If a property already exists with the same name, throws an exception. An exception will also be thrown if the DataType, or time sampling index is illegal.

virtual ArrayPropertyWriterPtr createArrayProperty(const std::string &iName, const MetaData &iMetaData, const DataType &iDataType, uint32_t iTimeSamplingIndex) = 0

Create and return the requested array property. If a property already exists with the same name, throws. an exception. An exception will also be thrown if the DataType, or time sampling index is illegal.

virtual CompoundPropertyWriterPtr createCompoundProperty(const std::string &iName, const MetaData &iMetaData) = 0

Create and return the requested compound property. If a property already exists with the same name, throws an exception.

class Data

Public Functions

virtual ~Data()
virtual void setToDefault() = 0
virtual void copyFrom(const void *iData) = 0
virtual bool equalTo(const void *iData) const = 0
virtual bool equalEpsilon(const void *iData, double iEpsilon) const = 0
virtual bool lessThan(const void *iData) const = 0
virtual const void *getData() const = 0
class DataType
#include <DataType.h>

The DataType class is a description of how an element of a sample in a Scalar or an Array property is stored. It does not contain an interpretation this is left to the metadata of the properties themselves.

Public Functions

DataType()

Default constructor Sets the DataType to an unknown DataType with extent 0. This is obviously an invalid storage description, and is used in cases where we need to indicated that a DataType could not be determined.

DataType(PlainOldDataType iPod, uint8_t iExtent = 1)

Explicit constructor. Takes a pod and an extent. By default the extent is 1. For String and Wstring types, the extent _must_ be 1.

PlainOldDataType getPod() const

Default copy constructor used. Default assignment operator used. Return the PlainOldDataType enum ...

void setPod(PlainOldDataType iPod)

Set the PlainOldDataType ...

uint8_t getExtent() const

Return the 8-bit extent ...

void setExtent(uint8_t iExtent)

Set the 8-bit extent ...

size_t getNumBytes() const

Returns the number of bytes occupied by a single datum. (element) The assumption that each element has a fixed size in memory is a core assumption in Alembic.

String DataTypes are a troublesome problem. A single string datum does not have a fixed number of bytes associated with it. So we are returning, here, the size of the std::string and std::wstring datatypes, respectively.

bool operator==(const DataType &b) const

Equality operator ...

bool operator<(const DataType &b) const

Returns whether one datatype is lexigraphically “less” than another - this has meaning only so that DataType instances can be meaningfully sorted.

Private Members

PlainOldDataType m_pod

An Enum indicating which PlainOldDataType is our super-storage-class.

uint8_t m_extent

An 8-bit extent indicating the cardinality of a single element of data.

class MetaData
#include <MetaData.h>

The MetaData class lies at the core of Alembic’s notion of “Object and Property Identity”. It is a refinement of the idea of Protocol (for Objects) and Interpretation (for Properties) in OpenGTO. It is, essentially, an UNORDERED, UNIQUE DICTIONARY of strings. It turns itself into a regular string for serialization and deserialization. This is not a virtual class, nor is it intended to be used as a base for derivation. It is explicitly declared and implemented as part of the AbcCoreAbstract library. It is composed (not inherited) from Alembic::Util::TokenMap. In order to not have duplicated (and possibly conflicting) policy implementation, we present this class here as a MOSTLY-WRITE-ONCE interface, with selective exception throwing behavior for failed writes.

Public Types

typedef Alembic::Util::TokenMap token_map_type

Our internals are handled by a TokenMap, which we expose through these typedefs.

typedef token_map_type::key_type key_type

Key type. Keys are unique within each MetaData instance.

typedef token_map_type::data_type data_type

Data type. Data is associated with a key, with each key being unique.

typedef token_map_type::value_type value_type

Value-type This is what the MetaData class “contains”, when viewed as a standard container.

typedef token_map_type::const_reference const_reference

Const reference type This is what the iterators dereference to.

typedef token_map_type::const_iterator const_iterator

const_iterator typedef this dereferences to a const value_type reference.

typedef token_map_type::const_reverse_iterator const_reverse_iterator

const_reverse_iterator typedef this dereferences to a const value_type instance.

Public Functions

MetaData()

Default constructor creates an empty dictionary. ...

MetaData(const MetaData &iCopy)

Copy constructor copies another MetaData. ...

MetaData &operator=(const MetaData &iCopy)

Assignment operator copies the contents of another MetaData instance.

void deserialize(const std::string &iFrom)

Deserialization will replace the contents of this class with the parsed contents of a string. It will just clear the contents first. It will throw an exception if the string is mal-formed.

std::string serialize() const

Serialization will convert the contents of this MetaData into a single string.

size_t size() const
const_iterator begin() const

Returns a const_iterator corresponding to the beginning of the MetaData or the end of the MetaData if empty.

const_iterator end() const

Returns a const_iterator corresponding to the end of the MetaData.

const_reverse_iterator rbegin() const

Returns a const_reverse_iterator corresponding to the beginning of the MetaData or the end of the MetaData if empty.

const_reverse_iterator rend() const

Returns an const_reverse_iterator corresponding to the end of the MetaData.

void set(const std::string &iKey, const std::string &iData)

set lets you set a key/data pair. This will silently overwrite an existing value.

void setUnique(const std::string &iKey, const std::string &iData)

setUnique lets you set a key/data pair, but throws an exception if you attempt to change the value of an existing field. It is fine if you set the same value.

Remark
Not the most efficient implementation at the moment.

std::string get(const std::string &iKey) const

get returns the value, or an empty string if it is not set. ...

std::string getRequired(const std::string &iKey) const

getRequired returns the value, and throws an exception if it is not found.

void append(const MetaData &iMetaData)

append appends the given MetaData to this class. Duplicates are overwritten.

void appendUnique(const MetaData &iMetaData)

append appends the given MetaData to this class. Duplicate values will cause an exception to be thrown.

bool matches(const MetaData &iMetaData) const

The matches function returns true if each of the fields in the passed iMetaData are found in this instance and have the same values. it returns false otherwise. This is not the same as “equals”, because this MetaData may contain fields that are not included in the passed iMetaData. This should be the default “matching” function.

bool matchesOverlap(const MetaData &iMetaData) const

The matchesExisting function returns true if, for each of the fields in the passed iMetaData, we have either no entry, or the same entry.

bool matchesExactly(const MetaData &iMetaData) const

the matchesExactly function returns true if we’re exactly equal in every field. This is a rarely useful concept with MetaData. It is for this reason that we explicitly do not overload the == operator.

Private Members

Alembic::Util::TokenMap m_tokenMap
class ObjectHeader
#include <ObjectHeader.h>

The ObjectHeader is a collection of MetaData which helps define a Property. It also acts as a key for getting an instance of a property from a CompoundProperty.

Public Functions

ObjectHeader()

Default constructor creates an unspecified object header. ...

ObjectHeader(const std::string &iName, const MetaData &iMetaData)

Explicit constructor, ignoring full name. ...

ObjectHeader(const std::string &iName, const std::string &iFullName, const MetaData &iMetaData)

Explicit constructor with full name. ...

const std::string &getName() const

Default Copy constructor Default Assignment operator All objects have a name, which is unique amongst its siblings. ...

void setName(const std::string &iName)
const std::string &getFullName() const

All objects have a full name, which is unique in the whole file. ...

void setFullName(const std::string &iFullName)
const MetaData &getMetaData() const

All objects have metadata. It is manipulated directly.

MetaData &getMetaData()

Private Members

std::string m_name
std::string m_fullName
MetaData m_metaData
class ObjectReader
#include <ObjectReader.h>

An Object consists of a list of children objects, which may be empty, and a single compound property which is the root of any properties which the object may contain. Objects have MetaData, which is identical to the MetaData of the root Compound Property.

Public Functions

virtual ~ObjectReader()

Virtual destructor ...

virtual const ObjectHeader &getHeader() const = 0

All objects have a header, which contains all the MetaData that was specified upon their creation. This function returns a constant reference to that Header.

const std::string &getName() const

All objects have a name. This name is unique amongst their siblings Returned by reference, since it is guaranteed to exist and be unchanging. This is a convenience function which returns the header’s name.

const std::string &getFullName() const

The full name of an object is the complete path name all the way to the root object of the archive. It is guaranteed to be fully unique within the entire archive. This is a convenience function which returns the header’s full name.

const MetaData &getMetaData() const

All objects have metadata. This metadata is identical to the Metadata of the top level compoundProperty “properties”. Because the metadata must exist and be initialized in order to bootstrap the object, it is guaranteed to exist and is returned by reference. This is a convenience function which returns the header’s MetaData.

virtual ArchiveReaderPtr getArchive() = 0

All objects have a shared link to the root. This may seem wasteful, but it is essential in order to allow for the flexible, reference-counted autonomy of the reader objects. Alembic allows you to keep references to readers wherever you want, without requiring you to keep track of (or store) the parental hierarchy directly. In order to make this possible, we have the ability to walk upwards. This may be stored as a direct link, or retrieved by walking up the parent chain, which is a feature of the individual implementations. (it might not be cheap, basically). In order to prevent shared_ptr cycles, it is important that objects only store their children via weak ptrs.

virtual ObjectReaderPtr getParent() = 0

All objects have a shared link to their parent. This may seem wasteful, but it is essential in order to allow for the flexible, reference-counted autonomy of the reader objects. Alembic allows you to keep references to readers wherever you want, without requiring you to keep track of (or store) the parental hierarchy directly. In order to make this possible, we have the ability to walk upwards. In order to prevent shared_ptr cycles, it is important that objects only store their children via weak ptrs.

virtual CompoundPropertyReaderPtr getProperties() = 0

All objects have one and only one compound property which is the root for any properties which are associated with this object. If no properties were written to the object, this may return an empty pointer.

virtual size_t getNumChildren() = 0

Returns the number of objects that are contained as children. Objects do not have to have children, this may return zero.

virtual const ObjectHeader &getChildHeader(size_t i) = 0

Return the header of an object by index. This will throw an exception on out-of-range access.

virtual const ObjectHeader *getChildHeader(const std::string &iName) = 0

Return the header of an object by name. This will return a NULL pointer if no header by that name is found.

virtual ObjectReaderPtr getChild(const std::string &iName) = 0

Get a child object by name. This is a convenience function that uses getChildHeader and the various named “get” functions here.

virtual ObjectReaderPtr getChild(size_t i) = 0

Get a child object by index. It is an error to call with out-of-range indices. This is a convenience function that uses getChildHeader and the various named “get” functions here.

virtual bool getPropertiesHash(Util::Digest &oDigest)

If an aggregated properties hash exists fill oDigest with it and return true, if it doesn’t exist return false

virtual bool getChildrenHash(Util::Digest &oDigest)

If an aggregated child objects hash exists fill oDigest with it and return true, if it doesn’t exist return false

virtual ObjectReaderPtr asObjectPtr() = 0

Returns shared pointer to myself. This is non-virtual

class ObjectWriter
#include <ObjectWriter.h>

An Object consists of a list of children objects, which may be empty, and a single compound property which is the root of any properties which the object may contain. Objects have MetaData, which is identical to the MetaData of the root Compound Property.

Public Functions

virtual ~ObjectWriter()

Virtual destructor ...

virtual const ObjectHeader &getHeader() const = 0

All objects are created from an ObjectHeader, which contains their name, their full name, and their MetaData. This returns a const reference to the ObjectHeader which was given upon creation.

const std::string &getName() const

All objects have a name. This name is unique amongst their siblings Returned by reference, since it is guaranteed to exist and be unchanging. This is the name that was given when the object was created.

const std::string &getFullName() const

The full name of an object is the complete path name all the way to the root object of the archive. It is guaranteed to be fully unique within the entire archive.

const MetaData &getMetaData() const

All objects have metadata. This metadata is identical to the Metadata of the top level compoundProperty “properties”. Because the metadata must exist and be initialized in order to bootstrap the object, it is guaranteed to exist and is returned by reference. While MetaData was required to create the object, additional MetaData may be appended during the writing of the object. This returns the accumulated MetaData, which may change as writing occurs. The reference will remain valid, but the MetaData it points to may change over time.

virtual ArchiveWriterPtr getArchive() = 0

All objects have a shared link to the root. This may seem wasteful, but it is essential in order to allow for the flexible, reference-counted autonomy of the writer objects. Alembic allows you to keep references to writers wherever you want, without requiring you to keep track of (or store) the parental hierarchy directly. In order to make this possible, we have the ability to walk upwards. This may be stored as a direct link, or retrieved by walking up the parent chain, which is a feature of the individual implementations. (it might not be cheap, basically). In order to prevent shared_ptr cycles, it is important that objects only store their children via weak ptrs.

virtual ObjectWriterPtr getParent() = 0

All objects have a shared link to their parent. This may seem wasteful, but it is essential in order to allow for the flexible, reference-counted autonomy of the writer objects. Alembic allows you to keep references to writers wherever you want, without requiring you to keep track of (or store) the parental hierarchy directly. In order to make this possible, we have the ability to walk upwards. In order to prevent shared_ptr cycles, it is important that objects only store their children via weak ptrs.

virtual CompoundPropertyWriterPtr getProperties() = 0

All objects have a single compound property which is the root for any properties which are associated with this object. Guaranteed to exist, even if the compound property itself is empty. This may change as properties are added.

virtual size_t getNumChildren() = 0

Returns the number of objects that are contained as children. this number may increase (but not decrease) as objects are created. This is the number of children object writers that have ALREADY BEEN ADDED. It may increase.

virtual const ObjectHeader &getChildHeader(size_t i) = 0

Returns the header of an object that has already been added. Object is selected by index. This will throw an exception on out-of-range access.

virtual const ObjectHeader *getChildHeader(const std::string &iName) = 0

Returns the header of an object that has already been added, by name. This will return NULL pointer if no header by that name is found. Even if the object assosciated with this header is no longer existing, the header will be non-null if any such object had been created. This is a mechanism for testing if something has already been made.

ObjectWriterPtr getChild(size_t i)

Returns a pointer to an object writer at the given index, that has ALREADY BEEN ADDED. It is an error to request a child with an out of range index, and an exception will be thrown. In a strange case, this will return an empty pointer if the writer has been added in the past, but was closed (deleted). There is really no distinction between an empty weak pointer and a weak pointer to an expired object, so we simply return an empty pointer if the object had been created but no longer exists. This is just a convenience function that uses getChildHeader and getChild( name );

virtual ObjectWriterPtr getChild(const std::string &iName) = 0

Returns a pointer to an object writer of the given name iName, for an object that has ALREADY BEEN ADDED. This will return an empty pointer if no object of the given name has been added.

virtual ObjectWriterPtr createChild(const ObjectHeader &iHeader) = 0

Create an object with given header. the header’s “fullName” will be ignored and set by the parent object. If an object with the given name already exists, an exception will be thrown, as this is a programming error.

virtual ObjectWriterPtr asObjectPtr() = 0

Returns shared pointer to myself. Sometimes this may be a spoofed ptr.

class PropertyHeader
#include <PropertyHeader.h>

The PropertyHeader is a collection of MetaData which helps define a Property. It also acts as a key for getting an instance of a property from a CompoundProperty.

Public Functions

PropertyHeader()

Default constructor creates an invalid property. The propertyType is set to Scalar, but the dataType will be set to its default value of kUnknownPOD[1]

PropertyHeader(const std::string &iName, const MetaData &iMetaData)

Construct a compound property header. Just give a name and metadata, the rest is redundant or unused.

PropertyHeader(const std::string &iName, PropertyType iPropType, const MetaData &iMetaData, const DataType &iDataType, const TimeSamplingPtr &iTsamp)

Construct a simple property header. Use this for array or scalar properties.

PropertyHeader(const PropertyHeader &iCopy)

Copy constructor ...

PropertyHeader &operator=(const PropertyHeader &iCopy)

Assignment operator ...

const std::string &getName() const

All properties have a name, which is unique amongst its siblings. ...

void setName(const std::string &iName)
PropertyType getPropertyType() const

All properties have a type, which is the enum defined above. ...

void setPropertyType(PropertyType iPtyp)
bool isScalar() const

Convenience to return whether the property is scalar. Same as getPropertyType() == kScalarProperty

bool isArray() const

Convenience to return whether the property is array. Same as getPropertyType() == kArrayProperty

bool isCompound() const

Convenience to return whether the property is compound. Same as getPropertyType() == kCompoundProperty

bool isSimple() const

Convenience to return whether the property is simple (non-compound) Same as getPropertyType() != kCompoundProperty

const MetaData &getMetaData() const

All properties have metadata. ...

void setMetaData(const MetaData &iMetaData)
const DataType &getDataType() const

Non-compound properties have a data type. If this is called for a Compound Property (basically, one which returns kCompoundProperty from getType() above) it will throw an exception.

void setDataType(const DataType &iDataType)
TimeSamplingPtr getTimeSampling() const

Non-compound properties have time sampling If this is called for a Compound Property (basically, one which returns kCompoundProperty from getType() above) it will throw an exception.

void setTimeSampling(const TimeSamplingPtr &iTsamp)

Private Members

std::string m_name
PropertyType m_propertyType
MetaData m_metaData
DataType m_dataType
TimeSamplingPtr m_timeSampling
class ReadArraySampleCache
#include <ReadArraySampleCache.h>

Alembic caches array samples based on a Murmur3 128bit checksum key. This is an abstract interface to these caches, which can be implemented in any number of ways.

Public Functions

virtual ~ReadArraySampleCache()

Virtual destructor ...

virtual ReadArraySampleID find(const ArraySample::Key &iKey) = 0

If it finds the entry, return a valid pointer to it which is expected to lock the entry in the cache until the pointer is dereferenced.

virtual ReadArraySampleID store(const ArraySample::Key &iKey, ArraySamplePtr iSamp) = 0

Store an entry given an explicit set of storage. The magnificent flexibility of the shared_ptr class makes it possible for an ArraySamplePtr to contain its own destructor as a custom deleter, and thus we can use ArraySamplePtrs for both reference and ownership, depending on the deleter. In this case, it is assumed that iSamp represents “owned” data, rather than a reference. The data will not be copied, but rather this sample will be stored directly using the passed shared_ptr.

class ReadArraySampleID
#include <ReadArraySampleCache.h>

A ReadArraySampleID is a bundle that contains a pointer to the ArraySample itself, along with the sample’s key.

Public Types

typedef ReadArraySampleID this_type

By convention, we define the typedef this_type. This is used by the unspecified-bool-type cast below.

Public Functions

ReadArraySampleID()

Default constructor creates empty ID ...

ReadArraySampleID(const ArraySample::Key &iSampleKey, ArraySamplePtr iSample)

Explicit constructor creates ID with key and sample.

const ArraySample::Key &getKey() const

Default copy constructor Default assignment operator. Return the sample key ...

ArraySamplePtr getSample() const

Return the sample itself. ...

bool valid() const

Return whether or not this read sample is valid ...

ALEMBIC_OPERATOR_BOOL(valid())

Unspecified bool type cast ...

Private Members

ArraySample::Key m_sampleKey
ArraySamplePtr m_sample
class ScalarPropertyReader
#include <ScalarPropertyReader.h>

A Scalar Property is a Rank 0 property which has a single value for each sample. This is distinguished from an Array Property, which has a variable number of elements per sample, and requires more sophisticated resource management.

Inherits from Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::BasePropertyReader

Public Functions

virtual ~ScalarPropertyReader()

Virtual destructor ...

virtual size_t getNumSamples() = 0

Return the number of samples contained in the property. This can be any number, including zero. This returns the number of samples that were written, independently of whether or not they were constant. Implementations may (and should) choose to condense identical samples.

virtual bool isConstant() = 0

Ask if we’re constant - no change in value amongst samples, regardless of the time sampling.

virtual void getSample(index_t iSample, void *iIntoLocation) = 0

Returns the single sample value for the requested sample by reference. Out-of-range indices will cause an exception to be thrown. It will copy the scalar value directly into the memory location specified by iIntoLocation

In all cases EXCEPT String and Wstring, the DataType for this property can be used to determine the size of the memory buffer which iIntoLocation must point to. In the case of String and Wstring, iIntoLocation should be ( void * )&std::string and ( void * )&std::wstring, respectively.

This is one of the only places where we break from POD types at the base, and we’re making an explicit decision to use std::string and std::wstring as core language-level primitives.

virtual std::pair<index_t, chrono_t> getFloorIndex(chrono_t iTime) = 0

Find the largest valid index that has a time less than or equal to the given time. Invalid to call this with zero samples. If the minimum sample time is greater than iTime, index 0 will be returned.

virtual std::pair<index_t, chrono_t> getCeilIndex(chrono_t iTime) = 0

Find the smallest valid index that has a time greater than the given time. Invalid to call this with zero samples. If the maximum sample time is less than iTime, index numSamples-1 will be returned.

virtual std::pair<index_t, chrono_t> getNearIndex(chrono_t iTime) = 0

Find the valid index with the closest time to the given time. Invalid to call this with zero samples.

class ScalarPropertyWriter
#include <ScalarPropertyWriter.h>

A Scalar Property is a Rank 0 property which has a single value for each sample. This is distinguished from an Array Property, which has a variable number of elements per sample, and requires more sophisticated resource management.

Inherits from Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::BasePropertyWriter

Public Functions

virtual ~ScalarPropertyWriter()

Virtual destructor ...

virtual void setSample(const void *iSamp) = 0

Sets a sample.

For specifying the sample, this takes a void pointer which points to the beginning of the memory corresponding to the scalar.

For String and Wstring, the const void *iSamp is assumed to be static_castable to const std::string * and const std::wstring *, respectively.

The data passed into this function will be used or copied locally by this function, and need not live (in the calling context) outside the return scope of this function call.

virtual void setFromPreviousSample() = 0

Simply copies the previously written sample’s value. This is an important feature.

virtual size_t getNumSamples() = 0

Return the number of samples that have been written so far. This changes as samples are written.

virtual void setTimeSamplingIndex(uint32_t iIndex) = 0

Changes the TimeSampling used by this property. If the TimeSampling is changed to Acyclic and the number of samples currently set is more than the number of times provided in the Acyclic TimeSampling, an exception will be thrown.

class ScalarSample
#include <ScalarSample.h>

ScalarSample is purely a helper class for implementations. It is not a required object of exchange within Alembic, and you wouldn’t want this to be the carrier of data with scalars because you’d be carrying around the extra 2 bytes of “DataType” data every time you passed data, which is wasteful and unnecessary.

However, since the Scalar Readers and Writers will always be obligated to compare samples to previously written samples and copy sample values, this class will be helpful in that regard.

Plus - and this is just a hunch - I suspect that as Alembic evolves, there will be a need for this extra bit of encapsulation at the abstract level, which is why I’m putting it here.

Public Functions

ScalarSample(const DataType &iDataType)

Construct from given data type and data. Data will be copied. If given data is NULL, internal data will be set to default value.

void copyFrom(const void *iData)

Assignment to just data. Will assume data is of the same type as described internally by our data type. is invalid to set to NULL here.

const DataType &getDataType() const

Returns the datatype. ...

const void *getData() const

Returns the memory address corresponding to the data ...

bool operator==(const void *iRhs) const

Assuming the passed memory address points to data of the same type as us, are they equal? An element-by-element comparison is done.

bool operator==(const ScalarSample &iRhs) const

Are the data types exactly equal? This will do an element-by-element comparison.

bool equalWithRelAbsError(const void *iRhs, double iRelAbsError) const

Are the data types equal with some precision. This only applies to floating point types, but will just ignore the relAbsError for the non-floating-point types.

bool equalWithRelAbsError(const ScalarSample &iRhs, double iRelAbsError) const

Same as precision-bound equality operator above. ...

bool operator<(const void *iRhs) const

Sorting operator. Compares element by element, with first elements having precedence over later ones.

bool operator<(const ScalarSample &iRhs) const

Sorting operator. Compares element by element, with first elements having precedence over later ones.

void setToDefault()

Sets to to default values for whichever POD types are contained. ...

Private Members

DataType m_dataType
Alembic::Util::unique_ptr<Data> m_data
template <class T>
struct TArrayDeleter

Public Functions

void operator()(void *memory) const
class TimeSampling
#include <TimeSampling.h>

The TimeSampling class’s whole job is to report information about the time values that are associated with the samples that were written to a property. Most of the time, the sampling will be uniform or cyclic, in which case this is mostly an algorithmic interface to the small sample times buffer. In the case where the sampling is truly acyclic, this class acts as an accessor to that array of times.

Public Functions

TimeSampling(const TimeSamplingType &iTimeSamplingType, const std::vector<chrono_t> &iSampleTimes)

Parameters
  • iSampleTimes -

    The number of time samples per cycle

The TimeSampling class is really a portable interface, usable via aggregation, that the SimplePropertyReaders and Writers (and their derived classes) can use to provide consistent time-sampling introspection to clients.

TimeSampling(chrono_t iTimePerCycle, chrono_t iStartTime)

Convenience constructor which creates uniform time sampling with the specified time per cycle and the specified start time.

TimeSampling(const TimeSampling &copy)
TimeSampling()
bool operator==(const TimeSampling &iRhs) const
size_t getNumStoredTimes() const

Get the number of stored times. This is same as the samples per cycle in the time sampling type except for acyclic time sampling. There will always be at least one sample because a start time is always needed.

const std::vector<chrono_t> &getStoredTimes() const
TimeSamplingType getTimeSamplingType() const
chrono_t getSampleTime(index_t iIndex) const

Get the time of any sample it is invalid to call this for out-of-range indices.

std::pair<index_t, chrono_t> getFloorIndex(chrono_t iTime, index_t iNumSamples) const

Find the largest valid index that has a time less than or equal to the given time. Invalid to call this with zero samples. If the minimum sample time is greater than iTime, index 0 will be returned.

std::pair<index_t, chrono_t> getCeilIndex(chrono_t iTime, index_t iNumSamples) const

Find the smallest valid index that has a time greater than the given time. Invalid to call this with zero samples. If the maximum sample time is less than iTime, index numSamples-1 will be returned.

std::pair<index_t, chrono_t> getNearIndex(chrono_t iTime, index_t iNumSamples) const

Find the valid index with the closest time to the given time. Invalid to call this with zero samples.

Protected Attributes

TimeSamplingType m_timeSamplingType

A TimeSamplingType This is “Uniform”, “Cyclic”, or “Acyclic”.

std::vector<chrono_t> m_sampleTimes

Private Functions

void init()
class TimeSamplingType
#include <TimeSamplingType.h>

The TimeSamplingType class controls how properties in Alembic relate time values to their sample indices.

The default behavior is where there is a time value associated with sample zero, and a uniform time amount between each subsequent sample. This is called “Uniform” time sampling, and would correspond to sampling every frame at 1/24 per second, or similar.

The second behavior is where there is a period of time over which a fixed number of samples are distributed unevenly - imagine a render scene sampled across a shutter period at shutter-begin-open, shutter-full-open, shutter-begin-close, shutter-full-close. This is (perhaps confusingly) called “Cyclic” time sampling.

The final behavior is where the time samples are totally uneven. We make a restriction that they must be strictly increasing, as the indices are increasing. This is so we can bisection search to find the lower or upper bounds when searching for floor, ceiling, or nearest samples by comparing time. This is called “Acyclic” time sampling.

Public Types

enum AcyclicFlag

ACYCLIC This enum exists solely as a way of distinguishing between the argument-less static time sampling, and the argument-less acyclic time sampling.

Values:

kAcyclic

Public Functions

TimeSamplingType()

Uniform default.

TimeSamplingType(chrono_t iTimePerCycle)

UNIFORM ...

TimeSamplingType(uint32_t iNumSamplesPerCycle, chrono_t iTimePerCycle)

CYCLIC ...

TimeSamplingType(AcyclicFlag)
bool operator==(const TimeSamplingType &iRhs) const

Using Default Copy Constructor Using Default Assignment Operator

bool isUniform() const

Asks if the sampling is: Uniform (1 sample per cycle) Cyclic (N>1 samples per cycle) Acyclic (INF samples per cycle - acyclic!)

bool isCyclic() const
bool isAcyclic() const
uint32_t getNumSamplesPerCycle() const
chrono_t getTimePerCycle() const

Public Static Functions

static uint32_t AcyclicNumSamples()
static chrono_t AcyclicTimePerCycle()

Private Members

uint32_t m_numSamplesPerCycle
chrono_t m_timePerCycle

Friends

ALEMBIC_EXPORT friend std::ostream& operator<<(std::ostream & ostr, const TimeSamplingType & tst)
template <class MAPPED>
struct UnorderedMapUtil

Public Types

typedef Alembic::Util::unordered_map<ArraySampleKey, MAPPED, ArraySampleKeyStdHash, ArraySampleKeyEqualTo> umap_type
namespace Alembic
namespace AbcCoreAbstract
namespace ALEMBIC_VERSION_NS

Typedefs

typedef Alembic::Util::shared_ptr<ArraySample> ArraySamplePtr

Smart Ptrs to Helper types. The Ptr suffix in Alembic _ALWAYS_ refers to a shared_ptr of whatever class name precedes the Ptr suffix.

The ArraySamplePtr can be used not only to share this ArraySample, but also to manage the data referred to by the memory address in the pointer, by way of a custom deleter. In this manner, ArraySample and ArraySamplePtr can be used both as a reference to data and as an explicit ownership of data. This greatly reduces the redundancy of this library’s code.

typedef Alembic::Util::shared_ptr<ArchiveWriter> ArchiveWriterPtr

Smart Ptrs to Writers.

typedef Alembic::Util::shared_ptr<ObjectWriter> ObjectWriterPtr
typedef Alembic::Util::shared_ptr<CompoundPropertyWriter> CompoundPropertyWriterPtr
typedef Alembic::Util::shared_ptr<ArrayPropertyWriter> ArrayPropertyWriterPtr
typedef Alembic::Util::shared_ptr<ScalarPropertyWriter> ScalarPropertyWriterPtr
typedef Alembic::Util::shared_ptr<BasePropertyWriter> BasePropertyWriterPtr
typedef Alembic::Util::shared_ptr<ArchiveReader> ArchiveReaderPtr

Smart Ptrs to Readers.

typedef Alembic::Util::shared_ptr<ObjectReader> ObjectReaderPtr
typedef Alembic::Util::shared_ptr<CompoundPropertyReader> CompoundPropertyReaderPtr
typedef Alembic::Util::shared_ptr<ArrayPropertyReader> ArrayPropertyReaderPtr
typedef Alembic::Util::shared_ptr<ScalarPropertyReader> ScalarPropertyReaderPtr
typedef Alembic::Util::shared_ptr<BasePropertyReader> BasePropertyReaderPtr
typedef Alembic::Util::shared_ptr<ReadArraySampleCache> ReadArraySampleCachePtr
typedef Alembic::Util::shared_ptr<TimeSampling> TimeSamplingPtr
typedef int64_t index_t

Index type Just being pedantic.

typedef float64_t chrono_t

Chrono type. This is used whenever time values are needed in the library. They are generally assumed to be seconds, but this does not need to be explicitly enforced by the API.

Enums

enum PropertyType

In Alembic, Objects may have three distinct types of abstract properties. Any fancy type-specific properties are ultimately and instance of one of these three types of properties, identified here by an enum. “Simple” properties are simply “non-compound” properties - the SimpleProperty classes are simply common base classes for Scalar and Array Properties.

Values:

kCompoundProperty = 0

Compound Properties are groups of other properties, with their own unique name and set of MetaData. All objects have a single root compound property as the base of their property description.

kScalarProperty = 1

Scalar Properties represent Rank-0 properties, which contain a single element value for any given time sample.

kArrayProperty = 2

Array Properties represent Rank-N properties, which contain an array of values for any given time sample. Array properties may have any rank of 1 or higher, but will most often be ranks 1, 2, 3.

Functions

size_t StdHash(ArraySampleKey const &a)
ALEMBIC_EXPORT ArraySamplePtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::AllocateArraySample(const DataType & iDtype, const Dimensions & iDims)

When creating an actual buffer for reading an array sample into, we need to allocate an array of some number of bytes, and then delete it with a special deleter. This function will return an array sample that is managed in this way. Dimensions tells us how many instances of the DataType to create DataType tells us what the instance is - and this works for pretty much every case, including std::string and std::wstring.

template <class T>
ArraySamplePtr TAllocateArraySample(size_t iDataTypeExtent, const Dimensions &iDims)
std::ostream &operator<<(std::ostream &ostr, const DataType &a)

Outputs DataType to a std::ostream Makes use of PlainOldDataType’s string conversion functions

ALEMBIC_EXPORT std::string Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::GetLibraryVersion()

Helper function which returns the version and date built in a string e.g. “Alembic 1.0.0 (built Jul 6 2011)”

ALEMBIC_EXPORT std::string Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::GetLibraryVersionShort()

Returns just the version number, as a string, of the Alembic library. e.g. “1.0.0”

namespace IllustrationOnly

In order for an implementation to concretely provide a starting point for using the abstract API, a single “explicitly linked” function to start from is necessary. That function will return, in the case of writing, an ArchiveWriterPtr. This typedef provides a signature that such a function should adhere to. This idiom is a workaround for the lack of virtual constructors in C++, and to avoid creating another class (such as “Implementation” or something similar)

In order for an implementation to concretely provide a starting point for using the abstract API, a single “explicitly linked” function to start from is necessary. That function will return, in the case of reading, an ArchiveReaderPtr. This typedef provides a signature that such a function should adhere to. This idiom is a workaround for the lack of virtual constructors in C++, and to avoid creating another class (such as “Implementation” or something similar) This is provided here as an illustration. It does not need to be derived from explicitly.

file All.h
#include <Alembic/AbcCoreAbstract/ArchiveReader.h>#include <Alembic/AbcCoreAbstract/ArchiveWriter.h>#include <Alembic/AbcCoreAbstract/ArrayPropertyReader.h>#include <Alembic/AbcCoreAbstract/ArrayPropertyWriter.h>#include <Alembic/AbcCoreAbstract/ArraySample.h>#include <Alembic/AbcCoreAbstract/ArraySampleKey.h>#include <Alembic/AbcCoreAbstract/BasePropertyReader.h>#include <Alembic/AbcCoreAbstract/BasePropertyWriter.h>#include <Alembic/AbcCoreAbstract/CompoundPropertyReader.h>#include <Alembic/AbcCoreAbstract/CompoundPropertyWriter.h>#include <Alembic/AbcCoreAbstract/DataType.h>#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/MetaData.h>#include <Alembic/AbcCoreAbstract/ObjectHeader.h>#include <Alembic/AbcCoreAbstract/ObjectReader.h>#include <Alembic/AbcCoreAbstract/ObjectWriter.h>#include <Alembic/AbcCoreAbstract/PropertyHeader.h>#include <Alembic/AbcCoreAbstract/ScalarPropertyReader.h>#include <Alembic/AbcCoreAbstract/ScalarPropertyWriter.h>#include <Alembic/AbcCoreAbstract/ScalarSample.h>#include <Alembic/AbcCoreAbstract/TimeSampling.h>#include <Alembic/AbcCoreAbstract/TimeSamplingType.h>
file ArchiveReader.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/ReadArraySampleCache.h>
file ArchiveWriter.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/MetaData.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>
file ArrayPropertyReader.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/BasePropertyReader.h>#include <Alembic/AbcCoreAbstract/ArraySample.h>
file ArrayPropertyWriter.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/BasePropertyWriter.h>#include <Alembic/AbcCoreAbstract/ArraySample.h>
file ArraySample.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ArraySampleKey.h>#include <Alembic/AbcCoreAbstract/DataType.h>
file ArraySampleKey.h
#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/DataType.h>
file BasePropertyReader.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/PropertyHeader.h>
file BasePropertyWriter.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/PropertyHeader.h>
file CompoundPropertyReader.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/BasePropertyReader.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/PropertyHeader.h>
file CompoundPropertyWriter.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/BasePropertyWriter.h>
file DataType.h
#include <Alembic/AbcCoreAbstract/Foundation.h>
file ForwardDeclarations.h
#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/PropertyHeader.h>
file Foundation.h
#include <Alembic/Util/All.h>#include <Alembic/Util/Export.h>#include <limits>#include <utility>#include <vector>#include <assert.h>#include <string.h>#include <stdio.h>#include <stdlib.h>#include <math.h>

Defines

INDEX_UNKNOWN

Returned by (to match index_t).

kChrono_TPOD
ABCA_THROW(TEXT)

Exception types borrowed from Alembic::Util. We should probably eventually create specific exception types.

ABCA_ASSERT(COND, TEXT)
file MetaData.h
#include <Alembic/AbcCoreAbstract/Foundation.h>
file ObjectHeader.h
#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/MetaData.h>
file ObjectReader.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/ObjectHeader.h>
file ObjectWriter.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ForwardDeclarations.h>#include <Alembic/AbcCoreAbstract/ObjectHeader.h>
file PropertyHeader.h
#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/MetaData.h>#include <Alembic/AbcCoreAbstract/DataType.h>#include <Alembic/AbcCoreAbstract/TimeSampling.h>
file ReadArraySampleCache.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/ArraySample.h>
file ScalarPropertyReader.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/BasePropertyReader.h>
file ScalarPropertyWriter.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/BasePropertyWriter.h>
file ScalarSample.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/DataType.h>
file TimeSampling.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>#include <Alembic/AbcCoreAbstract/TimeSamplingType.h>#include <Alembic/AbcCoreAbstract/ArraySample.h>
file TimeSamplingType.h
#include <Alembic/Util/Export.h>#include <Alembic/AbcCoreAbstract/Foundation.h>