Alembic: Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter Class Reference

Alembic 1.8.11

Loading...
Searching...
No Matches
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter Class Referenceabstract

`#include <ObjectWriter.h>`

Inheritance diagram for Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter:

## Public Member Functions
virtual | ~ObjectWriter ()
virtual const ObjectHeader & | getHeader () const =0
const std::string & | getName () const
const std::string & | getFullName () const
const MetaData & | getMetaData () const
virtual ArchiveWriterPtr | getArchive ()=0
virtual ObjectWriterPtr | getParent ()=0
virtual CompoundPropertyWriterPtr | getProperties ()=0
virtual size_t | getNumChildren ()=0
virtual const ObjectHeader & | getChildHeader (size_t i)=0
virtual const ObjectHeader * | getChildHeader (const std::string &iName)=0
ObjectWriterPtr | getChild (size_t i)
virtual ObjectWriterPtr | getChild (const std::string &iName)=0
virtual ObjectWriterPtr | createChild (const ObjectHeader &iHeader)=0
virtual ObjectWriterPtr | asObjectPtr ()=0

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ ~ObjectWriter()

Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::~ObjectWriter | ( |  | ) |
| virtual

Virtual destructor ...

## Member Function Documentation

## ◆ asObjectPtr()

virtual ObjectWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::asObjectPtr | ( |  | ) |
| pure virtual

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

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ createChild()

virtual ObjectWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::createChild | ( | const ObjectHeader & | iHeader | ) |
| pure virtual

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.

## ◆ getArchive()

virtual ArchiveWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getArchive | ( |  | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getChild() [1/2]

virtual ObjectWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getChild | ( | const std::string & | iName | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getChild() [2/2]

ObjectWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::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 );

## ◆ getChildHeader() [1/2]

virtual const ObjectHeader * Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getChildHeader | ( | const std::string & | iName | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getChildHeader() [2/2]

virtual const ObjectHeader & Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getChildHeader | ( | size_t | i | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getFullName()

const std::string & Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getFullName | ( |  | ) | const
| inline

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.

## ◆ getHeader()

virtual const ObjectHeader & Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getHeader | ( |  | ) | const
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getMetaData()

const MetaData & Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getMetaData | ( |  | ) | const
| inline

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.

## ◆ getName()

const std::string & Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getName | ( |  | ) | const
| inline

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.

## ◆ getNumChildren()

virtual size_t Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getNumChildren | ( |  | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getParent()

virtual ObjectWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getParent | ( |  | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

## ◆ getProperties()

virtual CompoundPropertyWriterPtr Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ObjectWriter::getProperties | ( |  | ) |
| pure virtual

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.

Implemented in Alembic::AbcCoreHDF5::ALEMBIC_VERSION_NS::OwImpl, and Alembic::AbcCoreOgawa::ALEMBIC_VERSION_NS::OwImpl.

The documentation for this class was generated from the following files:

- AbcCoreAbstract/ObjectWriter.h
- AbcCoreAbstract/ObjectWriter.cpp