UGDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
ugdk::script::lua::LuaData Class Reference

#include <luadata.h>

Inheritance diagram for ugdk::script::lua::LuaData:
Inheritance graph
[legend]
Collaboration diagram for ugdk::script::lua::LuaData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LuaData (LuaWrapper *wrapper, DataID id)
 ~LuaData ()
void * Unwrap (const VirtualType &type, bool disown) const
 Tries to unwrap the data contained in this object using the given type.
const char * UnwrapString () const
bool UnwrapBoolean () const
int UnwrapInteger () const
double UnwrapNumber () const
Vector UnwrapVector () const
List UnwrapList () const
Map UnwrapMap () const
void Wrap (void *data, const VirtualType &type)
 Tries to wrap the given data with the given type.
void WrapString (const char *str)
void WrapBoolean (bool boolean)
void WrapInteger (int number)
void WrapNumber (double number)
LangWrapperwrapper () const
Ptr Execute (const std::vector< Ptr > &args)
Ptr GetAttribute (Ptr key)
 Tries to get a attribute with the given name from this object.
Ptr SetAttribute (Ptr key, Ptr value)
void * unsafe_data () const
DataID id () const
void UnsafePopValue ()
 Unsafely sets this LuaData objects data.
void UnsafePushValue ()
void AddToBuffer ()
void RemoveFromBuffer ()

Constructor & Destructor Documentation

ugdk::script::lua::LuaData::LuaData ( LuaWrapper wrapper,
DataID  id 
) [inline]

Member Function Documentation

Reimplemented from ugdk::script::VirtualData.

VirtualData::Ptr ugdk::script::lua::LuaData::Execute ( const std::vector< Ptr > &  args)

Tries to get a attribute with the given name from this object.

Implements ugdk::script::VirtualData.

Reimplemented from ugdk::script::VirtualData.

void* ugdk::script::lua::LuaData::unsafe_data ( ) const [inline, virtual]

Unsafely sets this LuaData objects data.

WARNING: Uses the lua value on the top of the stack.

void * ugdk::script::lua::LuaData::Unwrap ( const VirtualType type,
bool  disown 
) const [virtual]

Tries to unwrap the data contained in this object using the given type.

Implements ugdk::script::VirtualData.

double ugdk::script::lua::LuaData::UnwrapNumber ( ) const [virtual]
const char * ugdk::script::lua::LuaData::UnwrapString ( ) const [virtual]
void ugdk::script::lua::LuaData::Wrap ( void *  data,
const VirtualType type 
) [virtual]

Tries to wrap the given data with the given type.

Returns a new VirtualData::Ptr with the data wrapped upon success.

The VirtualData object returned by this method is NOT NECESSARILY the same as the one that called it. Thus a safe way to use this is like this:

VirtualData::Ptr vdata;
// ...
vdata = vdata->Wrap(...);

Parameters:
data- a void pointer to the data being wrapped.
type- a virtual type got from TypeRegistry<T>::type(), where T is the original declarated type of the data.
Returns:
A shared pointer to the wrapped data.
See also:
ugdk::script::TypeRegistry

Implements ugdk::script::VirtualData.

void ugdk::script::lua::LuaData::WrapBoolean ( bool  boolean) [virtual]
void ugdk::script::lua::LuaData::WrapInteger ( int  number) [virtual]
void ugdk::script::lua::LuaData::WrapNumber ( double  number) [virtual]
LangWrapper* ugdk::script::lua::LuaData::wrapper ( ) const [inline, virtual]
void ugdk::script::lua::LuaData::WrapString ( const char *  str) [virtual]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines