CAttributes Class Reference

#include <CAttributes.h>

Inheritance diagram for CAttributes:

IAttributes IrrUnknown

Public Member Functions

Protected Member Functions

Protected Attributes

Static Protected Attributes


Constructor & Destructor Documentation

CAttributes ( video::IVideoDriver driver = 0  ) 

~CAttributes (  ) 


Member Function Documentation

void addBinary ( const c8 attributeName,
void *  data,
s32  dataSizeInBytes 
) [virtual]

Implements IAttributes.

void addBool ( const c8 attributeName,
bool  value 
) [virtual]

Implements IAttributes.

void addColor ( const c8 attributeName,
video::SColor  value 
) [virtual]

Implements IAttributes.

void addColorf ( const c8 attributeName,
video::SColorf  value 
) [virtual]

Implements IAttributes.

void addEnum ( const c8 attributeName,
s32  enumValue,
const char *const *  enumerationLiterals 
) [virtual]

Implements IAttributes.

void addEnum ( const c8 attributeName,
const char *  enumValue,
const char *const *  enumerationLiterals 
) [virtual]

Implements IAttributes.

void addFloat ( const c8 attributeName,
f32  value 
) [virtual]

Implements IAttributes.

void addInt ( const c8 attributeName,
s32  value 
) [virtual]

Implements IAttributes.

void addString ( const c8 attributeName,
const char *  value 
) [virtual]

Implements IAttributes.

void addTexture ( const c8 attributeName,
video::ITexture texture 
) [virtual]

Implements IAttributes.

void addVector3d ( const c8 attributeName,
core::vector3df  value 
) [virtual]

Implements IAttributes.

void clear (  )  [virtual]

Implements IAttributes.

bool drop (  )  [inline, inherited]

Drops the object. Decrements the reference counter by one. Returns true, if the object was deleted. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

bool existsAttribute ( const c8 attributeName  )  [virtual]

Implements IAttributes.

s32 findAttribute ( const c8 attributeName  )  [virtual]

Implements IAttributes.

void getAttributeAsBinaryData ( s32  index,
void *  outData,
s32  maxSizeInBytes 
) [virtual]

Gets an attribute as binary data

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

void getAttributeAsBinaryData ( const c8 attributeName,
void *  outData,
s32  maxSizeInBytes 
) [virtual]

Gets an attribute as binary data

Parameters:
attributeName,: Name of the attribute to get.

Implements IAttributes.

bool getAttributeAsBool ( s32  index  )  [virtual]

Gets an attribute as boolean value

Implements IAttributes.

bool getAttributeAsBool ( const c8 attributeName  )  [virtual]

Gets an attribute as boolean value

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

video::SColor getAttributeAsColor ( s32  index  )  [virtual]

Gets an attribute as color

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

video::SColor getAttributeAsColor ( const c8 attributeName  )  [virtual]

Gets an attribute as color

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

video::SColorf getAttributeAsColorf ( s32  index  )  [virtual]

Gets an attribute as floating point color

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

video::SColorf getAttributeAsColorf ( const c8 attributeName  )  [virtual]

Gets an attribute as floating point color

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

s32 getAttributeAsEnumeration ( s32  index,
const char *const *  enumerationLiteralsToUse 
) [virtual]

Gets an attribute as enumeration

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

const char * getAttributeAsEnumeration ( s32  index  )  [virtual]

Gets an attribute as enumeration

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

s32 getAttributeAsEnumeration ( const c8 attributeName,
const char *const *  enumerationLiteralsToUse 
) [virtual]

Gets an attribute as enumeration

Parameters:
attributeName,: Name of the attribute to get.
enumerationLiteralsToUse,: Use these enumeration literals to get the index value instead of the set ones. This is useful when the attribute list maybe was read from an xml file, and only contains the enumeration string, but no information about its index.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

const char * getAttributeAsEnumeration ( const c8 attributeName  )  [virtual]

Gets an attribute as enumeration

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

f32 getAttributeAsFloat ( s32  index  )  [virtual]

Gets an attribute as float value

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

f32 getAttributeAsFloat ( const c8 attributeName  )  [virtual]

Gets an attribute as float value

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

s32 getAttributeAsInt ( s32  index  )  [virtual]

Gets an attribute as integer value

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

s32 getAttributeAsInt ( const c8 attributeName  )  [virtual]

Gets an attribute as integer value

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

core::stringc getAttributeAsString ( s32  index  )  [virtual]

Returns attribute value as string by index.

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

void getAttributeAsString ( const c8 attributeName,
char *  target 
) [virtual]

Gets an attribute as string.

Parameters:
attributeName,: Name of the attribute to get.
target,: Buffer where the string is copied to.

Implements IAttributes.

core::stringc getAttributeAsString ( const c8 attributeName  )  [virtual]

Gets an attribute as string.

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute() or 0 if attribute is not set.

Implements IAttributes.

video::ITexture * getAttributeAsTexture ( s32  index  )  [virtual]

Gets an attribute as texture reference

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

video::ITexture * getAttributeAsTexture ( const c8 attributeName  )  [virtual]

Gets an attribute as texture reference

Parameters:
attributeName,: Name of the attribute to get.

Implements IAttributes.

core::vector3df getAttributeAsVector3d ( s32  index  )  [virtual]

Gets an attribute as floating point color

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

core::vector3df getAttributeAsVector3d ( const c8 attributeName  )  [virtual]

Gets an attribute as floating point color

Parameters:
attributeName,: Name of the attribute to get.
Returns:
Returns value of the attribute previously set by setAttribute()

Implements IAttributes.

s32 getAttributeCount (  )  [virtual]

Implements IAttributes.

void getAttributeEnumerationLiteralsOfEnumeration ( s32  index,
core::array< core::stringc > &  outLiterals 
) [virtual]

Gets the list of enumeration literals of an enumeration attribute

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

void getAttributeEnumerationLiteralsOfEnumeration ( const c8 attributeName,
core::array< core::stringc > &  outLiterals 
) [virtual]

Gets the list of enumeration literals of an enumeration attribute

Parameters:
attributeName,: Name of the attribute to get.

Implements IAttributes.

const c8 * getAttributeName ( s32  index  )  [virtual]

Returns attribute name by index.

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

IAttribute * getAttributeP ( const c8 attributeName  )  [protected]

E_ATTRIBUTE_TYPE getAttributeType ( s32  index  )  [virtual]

Returns attribute type by index.

Parameters:
index,: Index value, must be between 0 and getAttributeCount()-1.

Implements IAttributes.

E_ATTRIBUTE_TYPE getAttributeType ( const c8 attributeName  )  [virtual]

Returns the type of an attribute

Parameters:
attributeName,: Name for the attribute

Implements IAttributes.

const c8* getDebugName (  )  const [inline, inherited]

Returns the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Returns:
Returns a string, previously set by setDebugName();

void grab (  )  [inline, inherited]

Grabs the object. Increments the reference counter by one. Someone who calls grab() to an object, should later also call drop() to it. If an object never gets as much drop() as grab() calls, it will never be destroyed. The IrrUnknown class provides a basic reference counting mechanism with its methods grab() and drop(). Most objects of the Irrlicht Engine are derived from IrrUnknown, and so they are reference counted.

When you create an object in the Irrlicht engine, calling a method which starts with 'create', an object is created, and you get a pointer to the new object. If you no longer need the object, you have to call drop(). This will destroy the object, if grab() was not called in another part of you program, because this part still needs the object. Note, that you only need to call drop() to the object, if you created it, and the method had a 'create' in it.

A simple example:

If you want to create a texture, you may want to call an imaginable method IDriver::createTexture. You call ITexture* texture = driver->createTexture(dimension2d<s32>(128, 128)); If you no longer need the texture, call texture->drop(). If you want to load a texture, you may want to call imaginable method IDriver::loadTexture. You do this like ITexture* texture = driver->loadTexture("example.jpg"); You will not have to drop the pointer to the loaded texture, because the name of the method does not start with 'create'. The texture is stored somewhere by the driver.

bool read ( irr::io::IXMLReader reader,
bool  readCurrentElementOnly = false 
) [virtual]

Reads attributes from a xml file.

Parameters:
readCurrentElementOnly,: If set to true, reading only works if current element has the name 'attributes'. IF set to false, the first appearing list attributes are read.

Implements IAttributes.

void readAttributeFromXML ( io::IXMLReader reader  )  [protected]

void setAttribute ( s32  index,
video::ITexture texture 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
const char *  enumValue,
const char *const *  enumerationLiterals 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
void *  data,
s32  dataSizeInBytes 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
core::vector3df  v 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
video::SColorf  color 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
video::SColor  color 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
f32  value 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
s32  value 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
bool  value 
) [virtual]

Implements IAttributes.

void setAttribute ( s32  index,
const c8 value 
) [virtual]

Sets an attribute value as string.

Parameters:
attributeName,: Name for the attribute

Implements IAttributes.

void setAttribute ( const c8 attributeName,
video::ITexture texture 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
const char *  enumValue,
const char *const *  enumerationLiterals 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
void *  data,
s32  dataSizeInBytes 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
core::vector3df  v 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
video::SColorf  color 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
video::SColor  color 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
f32  value 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
s32  value 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
bool  value 
) [virtual]

Implements IAttributes.

void setAttribute ( const c8 attributeName,
const c8 value 
) [virtual]

Sets an attribute value as string.

Parameters:
attributeName,: Name for the attribute
value,: Value for the attribute. Set this to 0 to delete the attribute

Implements IAttributes.

void setDebugName ( const c8 newName  )  [inline, protected, inherited]

Sets the debug name of the object. The Debugname may only be set and changed by the object itself. This method should only be used in Debug mode.

Parameters:
newName,: New debug name to set.

bool write ( io::IXMLWriter writer  )  [virtual]

Implements IAttributes.


Field Documentation

core::array<IAttribute*> Attributes [protected]

video::IVideoDriver* Driver [protected]

char tmpBuffer [static, protected]


Generated on Fri Apr 27 14:47:13 2007 for IrrSpintz by  doxygen 1.5.1-p1