#include <LuaUserData.hpp>
Public Member Functions | |
| LuaUserData (size_t size) | |
| LuaUserData (const LuaUserData &other) | |
| const LuaUserData & | operator= (const LuaUserData &rhs) |
| size_t | getSize () const |
| void * | getData () |
Returns a pointer to the data stored in this LuaUserData. | |
| const void * | getData () const |
| bool | operator> (const LuaUserData &rhs) const |
| bool | operator< (const LuaUserData &rhs) const |
| bool | operator== (const LuaUserData &rhs) const |
| bool | operator!= (const LuaUserData &rhs) const |
The "different than" operator for LuaUserData. | |
Private Attributes | |
| size_t | size_ |
The number of bytes stored "in" data_. | |
| boost::scoped_array< char > | data_ |
A (smart) pointer to the data owned by this LuaUserData. | |
LuaValue when it holds userdata. LuaUserData has no counterpart in a Lua state. It is simply a block of memory that can be (via a LuaValue and a LuaState) stored in or read from a userdata in Lua state. Definition at line 45 of file LuaUserData.hpp.
| Diluculum::LuaUserData::LuaUserData | ( | size_t | size | ) | [explicit] |
Constructs a LuaUserData, allocating size bytes of memory. This memory is initially filled with garbage. And this memory is automatically freed when the LuaUserData is destroyed.
| Diluculum::LuaUserData::LuaUserData | ( | const LuaUserData & | other | ) |
The copy constructor. The newly constructed LuaUserData will have its own block of memory, with the same contents as the other. In other words, this constructor allocates and copies memory.
| const void* Diluculum::LuaUserData::getData | ( | ) | const [inline] |
Returns a const pointer to the data stored in this LuaUserData.
Definition at line 79 of file LuaUserData.hpp.
References data_.
| void* Diluculum::LuaUserData::getData | ( | ) | [inline] |
Returns a pointer to the data stored in this LuaUserData.
Definition at line 74 of file LuaUserData.hpp.
References data_.
Referenced by Diluculum::LuaValue::asObjectPtr().
| size_t Diluculum::LuaUserData::getSize | ( | ) | const [inline] |
Returns the size, in bytes, of the data stored in this LuaUserData.
Definition at line 71 of file LuaUserData.hpp.
References size_.
| bool Diluculum::LuaUserData::operator!= | ( | const LuaUserData & | rhs | ) | const |
The "different than" operator for LuaUserData.
| bool Diluculum::LuaUserData::operator< | ( | const LuaUserData & | rhs | ) | const |
The "less than" operator for LuaUserData.
LuaUserDatas, the decision on which one is lesser is somewhat arbitrary. The criterion is similar to the described for the "greater than" operator. | const LuaUserData& Diluculum::LuaUserData::operator= | ( | const LuaUserData & | rhs | ) |
Assigns a LuaUserData to this one. The memory currently allocated for this will be freed, new memory will be allocated, and the data stored in rhs will be copied to this.
| bool Diluculum::LuaUserData::operator== | ( | const LuaUserData & | rhs | ) | const |
The "equal to" operator for LuaUserData.
LuaUserDatas are considered equal if the data they store have the same size and the same contents. | bool Diluculum::LuaUserData::operator> | ( | const LuaUserData & | rhs | ) | const |
The "greater than" operator for LuaUserData.
LuaUserDatas, the decision on which one is greater is somewhat arbitrary. Here, the userdata with larger size() is considered greater. If both are equal, the decision is based on the contents of the stored data.
boost::scoped_array<char> Diluculum::LuaUserData::data_ [private] |
A (smart) pointer to the data owned by this LuaUserData.
Definition at line 113 of file LuaUserData.hpp.
Referenced by getData().
size_t Diluculum::LuaUserData::size_ [private] |
The number of bytes stored "in" data_.
Definition at line 110 of file LuaUserData.hpp.
Referenced by getSize().
1.5.9