Generic struct
#include <GenericTypeWrapper.h>
Generic is used to capture type string and the following primitives: double, integer, bool. Once captured, it has methods to convert to the appropriate type. Currently only getDouble() and getString() are implemented. Generic is not instantiable and is used for polymorphic behaviors. Only sub-classes can be constructed.
Contents
Derived classes
Public static functions
- static auto wrapPrimitive(std::string data) -> Generic*
- Parses string data and subsequently constructs a sub-class instance on the heap of the parsed type (string, double, integer, bool).
Public functions
Function documentation
static Generic* Generic:: wrapPrimitive(std::string data)
Parses string data and subsequently constructs a sub-class instance on the heap of the parsed type (string, double, integer, bool).
Parameters | |
---|---|
data | data, as a string, to be parsed. |
Returns | Generic* |
GenericType Generic:: type() const virtual
Returns the type the generic is storing.
Returns | enum STRING, DOUBLE, INTEGER, BOOL. |
---|