#include <gcvalue.h>
Public Member Functions | |
GCValue () | |
GCValue (const GCValue &value) | |
GCValue (VALUE v) | |
GCValue (bool b) | |
constructs the corresponding ruby boolean | |
GCValue (const std::string &str) | |
constructs a new ruby string object | |
GCValue (const char *str) | |
constructs a new ruby string object | |
GCValue (float f) | |
constructs a new ruby float object | |
GCValue (int i) | |
constructs a new riby int object | |
~GCValue () | |
void | operator= (const GCValue &value) |
void | operator= (const VALUE &value) |
VALUE | Get () |
returns the stored ruby VALUE | |
void | Set (VALUE v) |
sets the setored value to v. | |
bool | IsNil () |
returns true if the stored value equals QNil | |
bool | GetInt (int &value) |
tries to convert the stored value to an integer value, returns true on success | |
bool | GetFloat (float &value) |
tries to convert the stored value to a float value, returns true on success | |
bool | GetBool (bool &value) |
tries to convert the stored value to a bool value, returns true on success | |
bool | GetString (std::string &value) |
tries to convert the stored value to a string, returns true on success | |
Protected Member Functions | |
void | GC_Unregister () |
unregisters the stored VALUE from the ruby garbage collector, i.e marks mValue no longer as busy | |
void | GC_Register () |
registers the stored VALUE to the ruby garbage collector, i.e. | |
Protected Attributes | |
VALUE | mValue |
the wrapped ruby VALUE |
It is responsible to register and unregister the wrapped value as busy with the ruby garbage collector. The ruby garbage collector might be transparently invoked on any call to ruby. If a returned VALUE must stay valid during a series of ruby function calls you should use this wrapper. A simple use case is a VALUE returned from ruby that is used as an argument in a subsequent function call. This wrapper also provides some helpers to access and convert the stored value.
Definition at line 40 of file gcvalue.h.
|
Definition at line 28 of file gcvalue.cpp. References mValue. |
|
Definition at line 33 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
Definition at line 39 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
constructs the corresponding ruby boolean
Definition at line 45 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
constructs a new ruby string object
|
|
constructs a new ruby string object
Definition at line 57 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
constructs a new ruby float object
Definition at line 63 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
constructs a new riby int object
Definition at line 69 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
Definition at line 75 of file gcvalue.cpp. References GC_Unregister(). Here is the call graph for this function: ![]() |
|
registers the stored VALUE to the ruby garbage collector, i.e. marks it as busy Definition at line 199 of file gcvalue.cpp. References IsNil(), and mValue. Referenced by Set(). Here is the call graph for this function: ![]() |
|
unregisters the stored VALUE from the ruby garbage collector, i.e marks mValue no longer as busy
Definition at line 191 of file gcvalue.cpp. References IsNil(), and mValue. Referenced by Set(), and ~GCValue(). Here is the call graph for this function: ![]() |
|
returns the stored ruby VALUE
Definition at line 92 of file gcvalue.cpp. References mValue. Referenced by getObject(), newObject(), selectCall(), selectObject(), and thisCall(). |
|
tries to convert the stored value to a bool value, returns true on success
Definition at line 131 of file gcvalue.cpp. References IsNil(), and mValue. Here is the call graph for this function: ![]() |
|
tries to convert the stored value to a float value, returns true on success
Definition at line 120 of file gcvalue.cpp. References IsNil(), and mValue. Here is the call graph for this function: ![]() |
|
tries to convert the stored value to an integer value, returns true on success
Definition at line 109 of file gcvalue.cpp. References IsNil(), and mValue. Here is the call graph for this function: ![]() |
|
tries to convert the stored value to a string, returns true on success
Definition at line 153 of file gcvalue.cpp. References IsNil(), and mValue. Here is the call graph for this function: ![]() |
|
returns true if the stored value equals QNil
Definition at line 104 of file gcvalue.cpp. References mValue. Referenced by GC_Register(), GC_Unregister(), GetBool(), GetFloat(), GetInt(), and GetString(). |
|
Definition at line 86 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
Definition at line 80 of file gcvalue.cpp. Here is the call graph for this function: ![]() |
|
sets the setored value to v. Any previously stored value is properly unregistered Definition at line 97 of file gcvalue.cpp. References GC_Register(), GC_Unregister(), and mValue. Referenced by GCValue(), and operator=(). Here is the call graph for this function: ![]() |
|
the wrapped ruby VALUE
Definition at line 111 of file gcvalue.h. Referenced by GC_Register(), GC_Unregister(), GCValue(), Get(), GetBool(), GetFloat(), GetInt(), GetString(), IsNil(), operator=(), and Set(). |