Public Member Functions | Data Fields | Protected Attributes | Static Protected Attributes

Nytro::Core::Base Class Reference

The base class for all high level classes in the engine
inherit from this class all the classes that need properties or are themselves base classes for other objects. More...

#include <nyBase.h>

Inheritance diagram for Nytro::Core::Base:
Inheritance graph
[legend]

Public Member Functions

 Base ()
 Base (Base &rBase)
virtual ~Base ()
virtual EResult copy (Base *pFrom)
 copy all object data from another Base derived object
virtual Baseclone ()
 clone this class and return the clone
virtual EResult preCache ()
 called when this object must precache its internal data
virtual EResult loadFromStream (Stream *pStream)
 serialize the object, load from a stream
virtual EResult saveToStream (Stream *pStream)
 serialize the object, save to a stream
void setPropertiesFromXmlElements (XmlElement *pPropertiesParent)
 set properties from an xml parent element, with <property name="SomeProperty" value="some value"> child elements
void setAttributesFromXmlElements (XmlElement *pAttributesParent)
 set attributes from an xml parent element, with <attribute name="SomeAttr" value="some value"> child elements
void savePropertiesToXmlDocument (XmlDocument *pDoc)
 save properties to XML document
void saveAttributesToXmlDocument (XmlDocument *pDoc)
 save attributes to XML document
void copyPropertiesFrom (Base *pOther)
 copy properties from another Base class properties
bool getPropertyByName (const char *pName, Property *pProp)
void setPropertyValue (const char *pName, voidptr pData)
 set a property's value by property name
void setPropertyValue (uint32 aIndex, voidptr pData)
 set a property's value by property index
void setPropertyValueFromText (const char *pName, const char *pData)
 set a property's value by property name from text, it will convert the text into the property's type, for example boolean has text values 'yes' and 'no'
void setPropertyValueFromText (uint32 aIndex, const char *pData)
 set a property's value by property index from text, it will convert the text into the property's type, for example boolean has text values 'yes' and 'no'
void getPropertyValue (const char *pName, voidptr pData)
void getPropertyValue (uint32 aIndex, voidptr pData)
void getPropertyValueAsText (const char *pName, string &rText)
void getPropertyValueAsText (uint32 aIndex, string &rText)
string getPropertyValueAsText (const char *pName)
string getPropertyValueAsText (uint32 aIndex)
EResult savePropertiesToStream (Stream *pStream, bool bFullInfo=false)
 save the properties, raw data to the specified pStream stream
EResult loadPropertiesFromStream (Stream *pStream, bool bFullInfo=false)
 load the properties, raw data from the specified pStream stream
virtual void onPropertyValueChanged (voidptr pPropertyData)
 called when a property value was changed
virtual void onFormatGetPropertyValue (voidptr pPropertyData, string &rOutValue)
 called when the property value is returned as text, set rOutValue to custom formatted the value this method is called only when a property has the ePropertyFlag_CustomValueFormat set
virtual void onFormatSetPropertyValue (voidptr pPropertyData, const char *pInValue)
 called when the property is set from a text value, so you can modify directly the value from text this method is called only when a property has the ePropertyFlag_CustomValueFormat set
string & getName ()
virtual const char * getClassName ()
 RTTI - get the class name of this object, static pointer to a constant text.
string & getFileName ()
uint32 getId ()
ESuperClassId getSuperClassId ()
uint32 getType ()
bool isValid ()
virtual uint32 getUsedMemory ()
virtual uint32 getPropertyCount ()
map< string, string > & getAttributes ()
string getAttribute (const char *pAttrName)
virtual EResult setName (const char *pNewValue)
virtual EResult setNumberedName (const char *pNewValue)
 set the name of the object appending its id number: eg.
virtual EResult setFileName (const char *pNewValue)
 set the objects's file name, from which its data was loaded/saved
virtual EResult setId (uint32 aNewValue)
 set the object's unique ID
virtual EResult setSuperClassId (ESuperClassId aNewValue)
 set object's super class ID, see nyCommon.h for ID values
virtual EResult setType (uint32 aNewValue)
 set user defined type
virtual void setValid (bool bValue)
 set true if this node is valid
virtual EResult setUsedMemory (uint32 aNewValue)
 set the amount of used memory used by this object
virtual void setAttribute (const char *pAttrName, const char *pValue)
 set an attribute's value, if pValue is NULL, the attribute will be deleted
virtual void renameAttribute (const char *pAttrName, const char *pNewName)
 rename an attribute
virtual void deleteAttribute (const char *pAttrName)
 delete an attribute
virtual void setUserData (voidptr pData)
 set custom user data pointer
voidptr getUserData ()

Data Fields

 NYTRO_CLASS_HAS_PROPERTIES

Protected Attributes

string m_name
string m_fileName
map< string, string > m_attributes
bool m_bValid
uint32 m_id
uint32 m_type
uint32 m_usedMemory
uint32 m_propertyCount
ESuperClassId m_superClassId
voidptr m_pUserData

Static Protected Attributes

static uint32 m_instanceCount

Detailed Description

The base class for all high level classes in the engine
inherit from this class all the classes that need properties or are themselves base classes for other objects.

Definition at line 42 of file nyBase.h.


Constructor & Destructor Documentation

Nytro::Core::Base::Base (  ) 
Nytro::Core::Base::Base ( Base rBase  ) 
virtual Nytro::Core::Base::~Base (  )  [virtual]

Member Function Documentation

virtual Base* Nytro::Core::Base::clone (  )  [virtual]
virtual EResult Nytro::Core::Base::copy ( Base pFrom  )  [virtual]
void Nytro::Core::Base::copyPropertiesFrom ( Base pOther  ) 

copy properties from another Base class properties

virtual void Nytro::Core::Base::deleteAttribute ( const char *  pAttrName  )  [virtual]

delete an attribute

string Nytro::Core::Base::getAttribute ( const char *  pAttrName  ) 
Returns:
an attribute's value
map<string,string>& Nytro::Core::Base::getAttributes (  ) 
Returns:
the attributes map list, useful for runtime properties set/get
virtual const char* Nytro::Core::Base::getClassName (  )  [virtual]

RTTI - get the class name of this object, static pointer to a constant text.

string& Nytro::Core::Base::getFileName (  ) 
Returns:
the filename of the data loaded into this object
uint32 Nytro::Core::Base::getId (  ) 
Returns:
the object's unique ID
string& Nytro::Core::Base::getName (  ) 
Returns:
the name of this object
bool Nytro::Core::Base::getPropertyByName ( const char *  pName,
Property pProp 
)
Returns:
a property by its name into the specified pProp location
virtual uint32 Nytro::Core::Base::getPropertyCount (  )  [virtual]
Returns:
the class' property count
void Nytro::Core::Base::getPropertyValue ( const char *  pName,
voidptr  pData 
)
Returns:
a property's value by property name into the pData location, the pData must point to a valid object specified by the property's type
Parameters:
pName the name of the property
pData the value data, depends on the property type
void Nytro::Core::Base::getPropertyValue ( uint32  aIndex,
voidptr  pData 
)
Returns:
a property's value by property index into the pData location, the pData must point to a valid object specified by the property's type
Parameters:
aIndex the index of the property
pData the value data, depends on the property type
void Nytro::Core::Base::getPropertyValueAsText ( const char *  pName,
string &  rText 
)
Returns:
a property's value by property name into as text, formatted specifically by the property's type
Parameters:
pName the name of the property
rText the destination string reference
void Nytro::Core::Base::getPropertyValueAsText ( uint32  aIndex,
string &  rText 
)
Returns:
a property's value by property index into as text, formatted specifically by the property's type
Parameters:
aIndex the index of the property
rText the destination string reference
string Nytro::Core::Base::getPropertyValueAsText ( const char *  pName  ) 
Returns:
a property's value by property name as text, formatted specifically by the property's type
Parameters:
pName the name of the property
string Nytro::Core::Base::getPropertyValueAsText ( uint32  aIndex  ) 
Returns:
a property's value by property index, as text, formatted specifically by the property's type
Parameters:
pIndex the index of the property
ESuperClassId Nytro::Core::Base::getSuperClassId (  ) 
Returns:
the object's superclass ID, see nyCommon.h for the super class IDs
uint32 Nytro::Core::Base::getType (  ) 
Returns:
the object's user defined type
virtual uint32 Nytro::Core::Base::getUsedMemory (  )  [virtual]
Returns:
the total used memory by the object
voidptr Nytro::Core::Base::getUserData (  ) 
Returns:
custom user data pointer
bool Nytro::Core::Base::isValid (  ) 
Returns:
true if the node is valid
virtual EResult Nytro::Core::Base::loadFromStream ( Stream pStream  )  [virtual]

serialize the object, load from a stream

Reimplemented from Nytro::Core::Serializable.

EResult Nytro::Core::Base::loadPropertiesFromStream ( Stream pStream,
bool  bFullInfo = false 
)

load the properties, raw data from the specified pStream stream

Parameters:
pStream the stream
bFullInfo used to store additional data, so when a property is deleted, the object will still load the other properties correctly
virtual void Nytro::Core::Base::onFormatGetPropertyValue ( voidptr  pPropertyData,
string &  rOutValue 
) [virtual]

called when the property value is returned as text, set rOutValue to custom formatted the value this method is called only when a property has the ePropertyFlag_CustomValueFormat set

virtual void Nytro::Core::Base::onFormatSetPropertyValue ( voidptr  pPropertyData,
const char *  pInValue 
) [virtual]

called when the property is set from a text value, so you can modify directly the value from text this method is called only when a property has the ePropertyFlag_CustomValueFormat set

virtual void Nytro::Core::Base::onPropertyValueChanged ( voidptr  pPropertyData  )  [virtual]

called when a property value was changed

Parameters:
 

Reimplemented in Nytro::Game::PropertyValueFlowGraphNode.

virtual EResult Nytro::Core::Base::preCache (  )  [virtual]

called when this object must precache its internal data

virtual void Nytro::Core::Base::renameAttribute ( const char *  pAttrName,
const char *  pNewName 
) [virtual]

rename an attribute

void Nytro::Core::Base::saveAttributesToXmlDocument ( XmlDocument pDoc  ) 

save attributes to XML document

EResult Nytro::Core::Base::savePropertiesToStream ( Stream pStream,
bool  bFullInfo = false 
)

save the properties, raw data to the specified pStream stream

Parameters:
pStream the stream
bFullInfo used to store additional data, so when a property is deleted, the object will still load the other properties correctly
void Nytro::Core::Base::savePropertiesToXmlDocument ( XmlDocument pDoc  ) 

save properties to XML document

virtual EResult Nytro::Core::Base::saveToStream ( Stream pStream  )  [virtual]

serialize the object, save to a stream

Reimplemented from Nytro::Core::Serializable.

virtual void Nytro::Core::Base::setAttribute ( const char *  pAttrName,
const char *  pValue 
) [virtual]

set an attribute's value, if pValue is NULL, the attribute will be deleted

void Nytro::Core::Base::setAttributesFromXmlElements ( XmlElement pAttributesParent  ) 

set attributes from an xml parent element, with <attribute name="SomeAttr" value="some value"> child elements

virtual EResult Nytro::Core::Base::setFileName ( const char *  pNewValue  )  [virtual]

set the objects's file name, from which its data was loaded/saved

virtual EResult Nytro::Core::Base::setId ( uint32  aNewValue  )  [virtual]

set the object's unique ID

virtual EResult Nytro::Core::Base::setName ( const char *  pNewValue  )  [virtual]
Returns:
the name of the object
virtual EResult Nytro::Core::Base::setNumberedName ( const char *  pNewValue  )  [virtual]

set the name of the object appending its id number: eg.

Light01

Parameters:
pNewValue is the base name, example: "Light", name will be set as Light01
void Nytro::Core::Base::setPropertiesFromXmlElements ( XmlElement pPropertiesParent  ) 

set properties from an xml parent element, with <property name="SomeProperty" value="some value"> child elements

void Nytro::Core::Base::setPropertyValue ( const char *  pName,
voidptr  pData 
)

set a property's value by property name

Parameters:
pName the name of the property
pData the value data, depends on the property type
void Nytro::Core::Base::setPropertyValue ( uint32  aIndex,
voidptr  pData 
)

set a property's value by property index

Parameters:
aIndex the index of the property
pData the value data, depends on the property type
void Nytro::Core::Base::setPropertyValueFromText ( uint32  aIndex,
const char *  pData 
)

set a property's value by property index from text, it will convert the text into the property's type, for example boolean has text values 'yes' and 'no'

Parameters:
aIndex the index of the property
pData the value data, depends on the property type
void Nytro::Core::Base::setPropertyValueFromText ( const char *  pName,
const char *  pData 
)

set a property's value by property name from text, it will convert the text into the property's type, for example boolean has text values 'yes' and 'no'

Parameters:
pName the name of the property
pData the value data, depends on the property type
virtual EResult Nytro::Core::Base::setSuperClassId ( ESuperClassId  aNewValue  )  [virtual]

set object's super class ID, see nyCommon.h for ID values

virtual EResult Nytro::Core::Base::setType ( uint32  aNewValue  )  [virtual]

set user defined type

virtual EResult Nytro::Core::Base::setUsedMemory ( uint32  aNewValue  )  [virtual]

set the amount of used memory used by this object

virtual void Nytro::Core::Base::setUserData ( voidptr  pData  )  [virtual]

set custom user data pointer

virtual void Nytro::Core::Base::setValid ( bool  bValue  )  [virtual]

set true if this node is valid


Field Documentation

map<string,string> Nytro::Core::Base::m_attributes [protected]

Definition at line 190 of file nyBase.h.

bool Nytro::Core::Base::m_bValid [protected]

Definition at line 191 of file nyBase.h.

string Nytro::Core::Base::m_fileName [protected]

Definition at line 189 of file nyBase.h.

Definition at line 192 of file nyBase.h.

Reimplemented in Nytro::Graphics::GeometryInstanceBuffer.

Definition at line 197 of file nyBase.h.

string Nytro::Core::Base::m_name [protected]

Reimplemented in Nytro::Network::NetClientInfo.

Definition at line 189 of file nyBase.h.

Definition at line 192 of file nyBase.h.

Definition at line 198 of file nyBase.h.

Definition at line 196 of file nyBase.h.

Definition at line 192 of file nyBase.h.

Definition at line 192 of file nyBase.h.


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

© Copyright 7thFACTOR Entertainment - All rights reserved