Runtime variant used by the script-facing (Squirrel) streams. The C++ core is templated (Observer<T>/Observable<T>/Subject<T>); the module binds a Value-typed specialization so scripts can push nil/int/float/bool/ string/ptr. 更多...
#include <Rx.h>
Public 类型 | |
| enum class | Type { Nil , Int , Float , Bool , String , Ptr } |
Public 成员函数 | |
| bool | isNil () const |
| Type predicates. | |
| bool | isInt () const |
| bool | isFloat () const |
| bool | isBool () const |
| bool | isString () const |
| bool | isPtr () const |
| int64_t | toInt () const |
| Converters (throw eve::Exception on type mismatch). | |
| double | toFloat () const |
| bool | toBool () const |
| std::string | toString () const |
| bool | equals (const Value &o) const |
| Value equality across the supported types. | |
静态 Public 成员函数 | |
| static Value | makeNil () |
| Constructs a nil value. | |
| static Value | makeInt (int64_t v) |
| Constructs an integer value. | |
| static Value | makeFloat (double v) |
| Constructs a floating-point value. | |
| static Value | makeBool (bool v) |
| Constructs a boolean value. | |
| static Value | makeString (std::string v) |
| Constructs a string value (takes ownership). | |
| static Value | makePtr (void *v) |
| Constructs a pointer value (borrowed, not owned). | |
Public 属性 | |
| Type | type = Type::Nil |
| int64_t | i = 0 |
| double | f = 0 |
| bool | b = false |
| std::string | s |
| void * | p = nullptr |
详细描述
Runtime variant used by the script-facing (Squirrel) streams. The C++ core is templated (Observer<T>/Observable<T>/Subject<T>); the module binds a Value-typed specialization so scripts can push nil/int/float/bool/ string/ptr.
成员枚举类型说明
◆ Type
|
strong |
成员函数说明
◆ equals()
| bool eve::rx::Value::equals | ( | const Value & | o | ) | const |
◆ isBool()
◆ isFloat()
◆ isInt()
◆ isNil()
◆ isPtr()
◆ isString()
◆ makeBool()
|
inlinestatic |
◆ makeFloat()
|
inlinestatic |
◆ makeInt()
|
inlinestatic |
◆ makeNil()
|
inlinestatic |
◆ makePtr()
|
inlinestatic |
◆ makeString()
|
inlinestatic |
Constructs a string value (takes ownership).
被这些函数引用 ssq::detail::popValue() , 以及 eve::rx::Rx::pump().
◆ toBool()
| bool eve::rx::Value::toBool | ( | ) | const |
◆ toFloat()
| double eve::rx::Value::toFloat | ( | ) | const |
◆ toInt()
| int64_t eve::rx::Value::toInt | ( | ) | const |
◆ toString()
| std::string eve::rx::Value::toString | ( | ) | const |
类成员变量说明
◆ b
| bool eve::rx::Value::b = false |
◆ f
| double eve::rx::Value::f = 0 |
◆ i
| int64_t eve::rx::Value::i = 0 |
◆ p
◆ s
| std::string eve::rx::Value::s |
◆ type
被这些函数引用 equals(), isBool(), isFloat(), isInt(), isNil(), isPtr(), isString(), makeBool(), makeFloat(), makeInt(), makePtr(), makeString(), toBool(), toFloat(), toInt() , 以及 toString().
该类的文档由以下文件生成: