![]() |
PIP 5.6.1
Platform-Independent Primitives
|
Lightweight strongly-typed variant for a single value. More...
#include <pivariantsimple.h>
Public Member Functions | |
| PIVariantSimple () | |
| Constructs an empty PIVariantSimple. | |
| PIVariantSimple (const PIVariantSimple &v) | |
| Constructs a copy of PIVariantSimple. | |
| ~PIVariantSimple () | |
| Destroys the stored value, if any. | |
| PIVariantSimple & | operator= (const PIVariantSimple &v) |
| Replaces this object with a copy of another PIVariantSimple. | |
| template<typename T > | |
| void | setValue (const T &v) |
Stores value v. More... | |
| template<typename T > | |
| T | value () const |
Returns the stored value as type T. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static PIVariantSimple | fromValue (const T &v) |
Creates PIVariantSimple initialized with value v. | |
Related Functions | |
(Note that these are not member functions.) | |
| #define | REGISTER_PIVARIANTSIMPLE(Type) |
| Registers a readable type name for PIVariantSimple. | |
Lightweight strongly-typed variant for a single value.
|
inline |
Stores value v.
Reuses the existing storage when the stored type already matches T.
|
inline |
Returns the stored value as type T.
Unlike PIVariant, this class checks the exact stored type. Returns the value only when the currently stored type matches T.