A template class that can represent a value or be empty (NULL). More...
#include <SEmptyable.hpp>
Public Member Functions | |
SEmptyable (T val) | |
Constructor with initial value. | |
SEmptyable () | |
Default constructor. Initializes the object in an empty state. | |
bool | isEmpty () const |
Checks if the object is empty. | |
bool | operator== (const SEmptyable &right) const |
Equality operator with another SEmptyable object. | |
bool | operator== (const T &right) const |
Equality operator with a value of type T. | |
bool | operator!= (const SEmptyable &right) const |
Inequality operator with another SEmptyable object. | |
bool | operator!= (const T &right) const |
Inequality operator with a value of type T. | |
bool | operator< (const SEmptyable &right) const |
Less-than operator with another SEmptyable object. | |
bool | operator< (const T &right) const |
Less-than operator with a value of type T. | |
SEmptyable & | operator= (const SEmptyable &right) |
Assignment operator from another SEmptyable object. | |
SEmptyable & | operator= (const T &val) |
Assignment operator from a value of type T. | |
operator T () const | |
Conversion operator to type T. | |
void | reset () |
Resets the object to an empty state. | |
A template class that can represent a value or be empty (NULL).
This class allows a variable to either hold a value of type T
or be in an empty state.
T | The type of the value to be stored. |
Definition at line 15 of file SEmptyable.hpp.
|
inline |
Constructor with initial value.
val | The initial value to store. |
Definition at line 22 of file SEmptyable.hpp.
|
inline |
Default constructor. Initializes the object in an empty state.
Definition at line 31 of file SEmptyable.hpp.
|
inline |
Checks if the object is empty.
Definition at line 40 of file SEmptyable.hpp.
|
inline |
Conversion operator to type T.
Definition at line 165 of file SEmptyable.hpp.
|
inline |
Inequality operator with another SEmptyable object.
right | The SEmptyable object to compare with. |
Definition at line 86 of file SEmptyable.hpp.
|
inline |
Inequality operator with a value of type T.
right | The value to compare with. |
Definition at line 96 of file SEmptyable.hpp.
|
inline |
Less-than operator with another SEmptyable object.
right | The SEmptyable object to compare with. |
Definition at line 106 of file SEmptyable.hpp.
|
inline |
Less-than operator with a value of type T.
right | The value to compare with. |
Definition at line 126 of file SEmptyable.hpp.
|
inline |
Assignment operator from another SEmptyable object.
right | The SEmptyable object to assign from. |
Definition at line 141 of file SEmptyable.hpp.
|
inline |
Assignment operator from a value of type T.
val | The value to assign. |
Definition at line 153 of file SEmptyable.hpp.
|
inline |
Equality operator with another SEmptyable object.
right | The SEmptyable object to compare with. |
Definition at line 50 of file SEmptyable.hpp.
|
inline |
Equality operator with a value of type T.
right | The value to compare with. |
Definition at line 71 of file SEmptyable.hpp.
|
inline |
Resets the object to an empty state.
Definition at line 174 of file SEmptyable.hpp.