UGDK
|
#include <luadata.h>
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) |
LangWrapper * | wrapper () 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 () |
ugdk::script::lua::LuaData::LuaData | ( | LuaWrapper * | wrapper, |
DataID | id | ||
) | [inline] |
void ugdk::script::lua::LuaData::AddToBuffer | ( | ) | [virtual] |
Reimplemented from ugdk::script::VirtualData.
VirtualData::Ptr ugdk::script::lua::LuaData::Execute | ( | const std::vector< Ptr > & | args | ) |
VirtualData::Ptr ugdk::script::lua::LuaData::GetAttribute | ( | Ptr | key | ) | [virtual] |
Tries to get a attribute with the given name from this object.
Implements ugdk::script::VirtualData.
DataID ugdk::script::lua::LuaData::id | ( | ) | const [inline] |
void ugdk::script::lua::LuaData::RemoveFromBuffer | ( | ) | [inline, virtual] |
Reimplemented from ugdk::script::VirtualData.
VirtualData::Ptr ugdk::script::lua::LuaData::SetAttribute | ( | Ptr | key, |
Ptr | value | ||
) | [virtual] |
Implements ugdk::script::VirtualData.
void* ugdk::script::lua::LuaData::unsafe_data | ( | ) | const [inline, virtual] |
Implements ugdk::script::VirtualData.
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.
bool ugdk::script::lua::LuaData::UnwrapBoolean | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
int ugdk::script::lua::LuaData::UnwrapInteger | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
LuaData::List ugdk::script::lua::LuaData::UnwrapList | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
LuaData::Map ugdk::script::lua::LuaData::UnwrapMap | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
double ugdk::script::lua::LuaData::UnwrapNumber | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
const char * ugdk::script::lua::LuaData::UnwrapString | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
LuaData::Vector ugdk::script::lua::LuaData::UnwrapVector | ( | ) | const [virtual] |
Implements ugdk::script::VirtualData.
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(...);
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. |
Implements ugdk::script::VirtualData.
void ugdk::script::lua::LuaData::WrapBoolean | ( | bool | boolean | ) | [virtual] |
Implements ugdk::script::VirtualData.
void ugdk::script::lua::LuaData::WrapInteger | ( | int | number | ) | [virtual] |
Implements ugdk::script::VirtualData.
void ugdk::script::lua::LuaData::WrapNumber | ( | double | number | ) | [virtual] |
Implements ugdk::script::VirtualData.
LangWrapper* ugdk::script::lua::LuaData::wrapper | ( | ) | const [inline, virtual] |
Implements ugdk::script::VirtualData.
void ugdk::script::lua::LuaData::WrapString | ( | const char * | str | ) | [virtual] |
Implements ugdk::script::VirtualData.