![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "lib/variant-o.hpp"
A variant wrapper (typesafe union) capable of holding a value of any of a bounded collection of types.
The value is stored in a local buffer directly within the object and may be accessed by a typesafe visitation.
| TYPES | collection of possible types to be stored in this variant object |
| Access | policy how to access the stored value |
Definition at line 244 of file variant-o.hpp.
Public Member Functions | |
| void | reset () |
| template<typename SRC > | |
| VariantO & | operator= (SRC src) |
| store a copy of the given argument within the variant holder buffer, thereby typically casting or converting the given source type to the best suited (base) type (out of the collection of possible types for this VariantO instance) | |
| template<typename TAR > | |
| TAR | get () |
| retrieve current content of the variant, trying to cast or convert it to the given type. | |
Private Types | |
| typedef variant::Holder< TYPES > | Holder |
| typedef Holder::Deleter | Deleter |
Private Attributes | |
| Holder::Storage | holder_ |
| storage: buffer holding either an "empty" marker, or an instance of one of the configured payload types | |
Additional Inherited Members | |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
|
private |
Definition at line 248 of file variant-o.hpp.
|
private |
Definition at line 249 of file variant-o.hpp.
|
inline |
Definition at line 258 of file variant-o.hpp.
Referenced by BuilderTool::forgetWrapper().
Here is the caller graph for this function:
|
inline |
store a copy of the given argument within the variant holder buffer, thereby typically casting or converting the given source type to the best suited (base) type (out of the collection of possible types for this VariantO instance)
Definition at line 268 of file variant-o.hpp.
|
inline |
retrieve current content of the variant, trying to cast or convert it to the given type.
Actually, the function access(T&) on the Access-policy (template param) is invoked with the type currently stored in the holder buffer. May return NULL if conversion fails.
Definition at line 284 of file variant-o.hpp.
Referenced by BuilderTool::getPlacement(), BuilderTool::getPtr(), and WrappedStandardExeBuilder::invokeOriginalBuilder().
Here is the caller graph for this function:
|
private |
storage: buffer holding either an "empty" marker, or an instance of one of the configured payload types
Definition at line 254 of file variant-o.hpp.
Inheritance diagram for VariantO< TYPES, Access >:
Collaboration diagram for VariantO< TYPES, Access >: