nArg Class Reference
[Nebula Kernel]
#include <narg.h>
Detailed Description
nArg encapsulates a typed argument (float, int, bool, string or object pointer) into an uniform C++ class.(C) 2002 RadonLabs GmbH
Definition at line 21 of file narg.h.
Public Types | |
| enum | Type { Void, Int, Float, String, Bool, Object, List, Float4, Matrix44 } |
Public Member Functions | |
| nArg () | |
| the default constructor | |
| nArg (const nArg &rhs) | |
| the copy constructor | |
| ~nArg () | |
| the destructor | |
| void | Delete () |
| delete contents (sets type to Void) | |
| void | Copy (const nArg &rhs) |
| copy content | |
| void | Copy (va_list *marker) |
| copy from va_list | |
| bool | operator== (const nArg &rhs) const |
| the equals operator | |
| nArg & | operator= (const nArg &rhs) |
| assignment operator | |
| void | Reset (char c) |
| Set type corresponding to data type character and reset arg contents. | |
| void | SetI (int i) |
| set content to an integer | |
| void | SetB (bool b) |
| set content to a bool | |
| void | SetF (float f) |
| set content to a float | |
| void | SetS (const char *s) |
| set content to a string | |
| void | SetO (void *) |
| set content to an (object) pointer | |
| void | SetL (nArg *_l, int len) |
| Set content to an array of nArgs. | |
| void | SetF4 (const nFloat4 &f4) |
| set to float4 | |
| void | SetV4 (const vector4 &v4) |
| set to float4, as vector4 | |
| void | SetV3 (const vector3 &v3) |
| set to float4, as vector3 | |
| void | SetM44 (const matrix44 &m44) |
| set to matrix44 | |
| Type | GetType () const |
| get the content data type | |
| int | GetI () const |
| get int content | |
| bool | GetB () const |
| get bool content | |
| float | GetF () const |
| get float content | |
| const char * | GetS () const |
| get string content | |
| void * | GetO () const |
| get object pointer content | |
| int | GetL (nArg *&) const |
| Get an array of nArgs. | |
| const nFloat4 & | GetF4 () const |
| get float4 content | |
| const vector4 & | GetV4 () const |
| get content as vector4 | |
| const vector3 & | GetV3 () const |
| get content as vector3 | |
| const matrix44 & | GetM44 () const |
| get matrix44 content | |
Static Public Member Functions | |
| static bool | IsValidArg (char c) |
| check if the provided data type character is a valid argument | |
| static bool | IsVoid (char c) |
| check if the provided data type character is void | |
Member Enumeration Documentation
|
|
|
Constructor & Destructor Documentation
|
|
the default constructor The default constructor will initialize the arg type to Void |
|
|
the copy constructor The copy constructor simply calls nArg::Copy()
|
|
|
the destructor
|
Member Function Documentation
|
|
delete contents (sets type to Void) Delete content, sets type to Void. |
|
|
copy content Copy contents. Only calls delete if necessary to avoid memory allocation overhead.
|
|
|
copy from va_list Copy contents from variable argument list marker. The type of the variable is known by the this->type.
|
|
|
the equals operator Checks whether data type and contents of the object are identical. |
|
|
assignment operator
|
|
|
Set type corresponding to data type character and reset arg contents.
|
|
|
set content to an integer Sets the contents to an integer, and sets the arg type to Int.
|
|
|
set content to a bool Sets the contents to a bool value, and set the arg type to Bool.
|
|
|
set content to a float Sets the contents to a float value, and sets the arg type to Float.
|
|
|
set content to a string Sets the contents to a string, and sets the arg type to String. The string is duplicated internally.
|
|
|
set content to an (object) pointer Sets the contents to an object pointer, and sets the arg type to Object. The pointer is NOT safe (if the object is destroyed, the pointer points to Nirvana).
|
|
||||||||||||
|
Set content to an array of nArgs. Sets the contents to an array of other nArgs, and sets the arg type to List. The array is NOT duplicated.
|
|
|
set to float4 Set the content to a float4 value. |
|
|
set to float4, as vector4 Set the content to a Float4 value, with vector4 as parameter. |
|
|
set to float4, as vector3 Set the content to a vector3 value. |
|
|
set to matrix44 Set the content to a matrix44 value. |
|
|
get the content data type Returns the argument type of the object, which is one of Void - unitialized Int Bool Float List Float4 Matrix44
|
|
|
get int content Returns the integer content of the object. Throws assertion if not set to an integer.
|
|
|
get bool content Returns the bool content of the object. Throws assertion if not set to a bool.
|
|
|
get float content Returns the float content of the object. Throws assertion if not set to a float.
|
|
|
get string content Returns the string content of the object. Throws assertion if not set to a string.
|
|
|
get object pointer content Returns the object pointer content of the object. Throws assertion if not set to an object pointer.
|
|
|
Get an array of nArgs. Returns the nArg array content of the object. Throws assertion if not set to a list.
|
|
|
get float4 content Return float4 content. |
|
|
get content as vector4 Return float4 content as vector4 |
|
|
get content as vector3 Return float4 content as vector3 |
|
|
get matrix44 content Return matrix44 content. |
|
|
check if the provided data type character is a valid argument
|
|
|
check if the provided data type character is void
|
The documentation for this class was generated from the following file: