#include <SPL/Runtime/Type/Optional.h>
◆ value_type
◆ optional() [1/4]
◆ optional() [2/4]
◆ optional() [3/4]
◆ optional() [4/4]
◆ ~optional()
◆ isPresent()
Returns true if the optional is set to non-null, false if it is null
- Returns
- true if the optional is set to non-null, false if it is null
Implements SPL::Optional.
◆ setPresentWithDefaultValue()
Sets the underlying value of the optional to be a default initialized value of the underlying type T. Once this is done, isPresent() will return true unless the optional is later reset to null.
Implements SPL::Optional.
◆ value() [1/2]
◆ value() [2/2]
◆ getSerializedSize()
Get the size in bytes when serialized
- Returns
- size in bytes when serialized
Implements SPL::Optional.
◆ operator=()
◆ createValue()
Create a new value of the value type. The returned value handle is a wrapper for an object allocated on the heap. As a result, the caller is responsible for cleaning up the memory by calling ValueHandle::deleteValue()
- Returns
- value handle for the new element
Implements SPL::Optional.
◆ clone()
◆ getValue() [1/2]
If the optional isPresent(), return a handle the underlying value of type T wrapped by the optional. Otherwise a runtime exception occurs.
- Returns
- a handle to the underlying value wrapped by the optional
Implements SPL::Optional.
◆ getValue() [2/2]
If the optional isPresent(), return a const handle the underlying value of type T wrapped by the optional. Otherwise a runtime exception occurs.
- Returns
- a const handle to the underlying value wrapped by the optional
Implements SPL::Optional.
◆ getValueMetaType()
- Returns
- the metatype corresponding to the underlying value of type T
Implements SPL::Optional.
◆ swapWith()
Swaps the null-ness or wrapped value (if not null) of another Optional with this Optional's state, using intermediate copies as necessary.
Implements SPL::Optional.
◆ assignFrom()
Assigns the null-ness or wrapped value (if not null) of another Optional to this Optional's state. This will perform copying of any underlying value to preserve value semantics.
Implements SPL::Optional.
◆ equals()
Returns true if the type and either the null-ness or wrapped value (if not null) of the given Optional is the same as this optional. If the types of the Optionals do not match, a runtime exception occurs.
- Returns
- true if the type and either the null-ness or wrapped value (if not null) of the given Optional is the same as this optional. If the types of the Optionals do not match, a runtime exception occurs.
Implements SPL::Optional.
◆ setValue()
Sets the underlying value of the optional to be the same value as the one wrapped by the given const value handle. This performs a copy of the value pointed to by the handle so as to preserve value semantics.
Implements SPL::Optional.
◆ operator==()
◆ operator!=()
◆ clear() [1/2]
◆ serialize() [1/2]
◆ deserialize() [1/2]
template<class T >
void SPL::optional< T >::deserialize |
( |
std::istream & |
istr, |
|
|
bool |
withSuffix = false |
|
) |
|
|
|
virtual |
Deserialize (character)
- Parameters
-
istr |
input stream |
withSuffix |
if true then consume suffix, otherwise (false) assume no suffix is present |
Implements SPL::Optional.
◆ serialize() [2/2]
template<class T >
template<class BufferType >
Serialize (binary)
- Parameters
-
◆ deserialize() [2/2]
template<class T >
template<class BufferType >
Deserialize (binary)
- Parameters
-
◆ deserializeWithNanAndInfs()
template<class T >
void SPL::optional< T >::deserializeWithNanAndInfs |
( |
std::istream & |
istr, |
|
|
bool |
withSuffix = false |
|
) |
|
|
Deserialize with Inf and Nan (character)
- Parameters
-
istr |
input stream |
withSuffix |
if true then consume suffix, otherwise (false) assume no suffix is present |
◆ hashCode()
◆ clear() [2/2]
The documentation for this class was generated from the following file: