Alembic: Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample Class Reference

Alembic 1.8.11

Loading...
Searching...
No Matches
Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample Class Reference

`#include <ScalarSample.h>`

Inheritance diagram for Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample:

## Classes
class | Data

## Public Member Functions
| ScalarSample (const DataType &iDataType)
void | copyFrom (const void *iData)
const DataType & | getDataType () const
const void * | getData () const
bool | operator== (const void *iRhs) const
bool | operator== (const ScalarSample &iRhs) const
bool | equalWithRelAbsError (const void *iRhs, double iRelAbsError) const
bool | equalWithRelAbsError (const ScalarSample &iRhs, double iRelAbsError) const
bool | operator< (const void *iRhs) const
bool | operator< (const ScalarSample &iRhs) const
void | setToDefault ()

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ ScalarSample()

Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::ScalarSample | ( | const DataType & | iDataType | ) |
| explicit

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

## Member Function Documentation

## ◆ copyFrom()

void Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::copyFrom | ( | const void * | iData | ) |
| inline

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.

## ◆ equalWithRelAbsError() [1/2]

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::equalWithRelAbsError | ( | const ScalarSample & | iRhs,
|  | double | iRelAbsError ) const
| inline

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

## ◆ equalWithRelAbsError() [2/2]

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::equalWithRelAbsError | ( | const void * | iRhs,
|  | double | iRelAbsError ) const
| inline

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.

## ◆ getData()

const void * Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::getData | ( |  | ) | const
| inline

Returns the memory address corresponding to the data ...

## ◆ getDataType()

const DataType & Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::getDataType | ( |  | ) | const
| inline

Returns the datatype. ...

## ◆ operator<() [1/2]

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::operator< | ( | const ScalarSample & | iRhs | ) | const
| inline

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

## ◆ operator<() [2/2]

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::operator< | ( | const void * | iRhs | ) | const
| inline

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

## ◆ operator==() [1/2]

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::operator== | ( | const ScalarSample & | iRhs | ) | const
| inline

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

## ◆ operator==() [2/2]

bool Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::operator== | ( | const void * | iRhs | ) | const
| inline

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

## ◆ setToDefault()

void Alembic::AbcCoreAbstract::ALEMBIC_VERSION_NS::ScalarSample::setToDefault | ( |  | ) |
| inline

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

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

- AbcCoreAbstract/ScalarSample.h
- AbcCoreAbstract/ScalarSample.cpp