Katana Plug-in APIs 0.1
Public Member Functions | Static Public Member Functions

Foundry::Katana::Attribute Class Reference

The base class of all Attributes. More...

#include <FnAttributeBase.h>

Inheritance diagram for Foundry::Katana::Attribute:
Foundry::Katana::DataAttribute Foundry::Katana::GroupAttribute Foundry::Katana::NullAttribute Foundry::Katana::DoubleAttribute Foundry::Katana::FloatAttribute Foundry::Katana::IntAttribute Foundry::Katana::StringAttribute

List of all members.

Public Member Functions

 Attribute ()
bool isValid () const
uint64_t getSize () const
FnKatAttributeType getType () const
std::string getXML () const
void getBinary (std::vector< char > *buffer) const
bool writeAttributeStream (void *stream, FnAttributeWriteStreamFunc func, FnKatStreamType streamType) const

Static Public Member Functions

static Attribute parseXML (const char *xml)
static Attribute parseBinary (const char *buffer, size_t size)
static Attribute readAttributeStream (void *stream, FnAttributeReadStreamFunc func, FnKatStreamType streamType)

Detailed Description

The base class of all Attributes.


Constructor & Destructor Documentation

Foundry::Katana::Attribute::Attribute ( ) [inline]

Create empty attribute class (isValid() == false).


Member Function Documentation

void Foundry::Katana::Attribute::getBinary ( std::vector< char > *  buffer) const

Returns an binary representation of the attribute.

uint64_t Foundry::Katana::Attribute::getSize ( ) const [inline]

Returns the total memory in bytes that was allocated when the attribute was created.

For GroupAttribute, this value includes, apart from the allocated size of the group internals, also the size of all its children. If an attribute is included more than once in the group, the size of said attribute will be added just as many times as it appears.

Releasing the last reference to the attribute will potentially free as much data as returned by this function.

Note:
Katana may optimize the storage of certain attributes by caching small, frequently-used values internally. In these cases, it will not be possible to release the last reference.
Returns:
The total allocated memory of the attribute in bytes.
FnKatAttributeType Foundry::Katana::Attribute::getType ( ) const [inline]
std::string Foundry::Katana::Attribute::getXML ( ) const

Returns an xml representation of the attribute.

bool Foundry::Katana::Attribute::isValid ( ) const [inline]
static Attribute Foundry::Katana::Attribute::parseBinary ( const char *  buffer,
size_t  size 
) [static]

Returns an Attribute from a binary representation.

static Attribute Foundry::Katana::Attribute::parseXML ( const char *  xml) [static]

Returns an Attribute from an XML representation.

static Attribute Foundry::Katana::Attribute::readAttributeStream ( void *  stream,
FnAttributeReadStreamFunc  func,
FnKatStreamType  streamType 
) [static]

Returns an Attribute read from the stream provided.

Parameters:
streamOpaque pointer to stream object.
funcFunction to read bytes from stream object.
streamTypeHow to read the stream either as XML or binary.
bool Foundry::Katana::Attribute::writeAttributeStream ( void *  stream,
FnAttributeWriteStreamFunc  func,
FnKatStreamType  streamType 
) const

Writes an Attribute to the stream provided. Returns true for success, false for failure.

Parameters:
streamOpaque pointer to stream object.
funcFunction to write bytes to stream object.
streamTypeHow to write the stream either as XML or binary.

The documentation for this class was generated from the following file:
 All Classes Functions Variables Typedefs Enumerations Enumerator