|
| Caster () |
| Default constructor. Leaves the type undefined. More...
|
|
| Caster (const Caster &c) |
| Copy constructor. Copies the type.
|
|
void | link (void *p, const std::type_info &t) |
|
template<class T > |
void | link (T *p) |
|
template<class T > |
void | link (T &p) |
|
void | setType (const std::type_info &t) |
| Calls setType<T>() for which typeid(T) = t. More...
|
|
template<class F > |
void | setType () |
| Sets pointers to the type-dependent conversion functions.
|
|
virtual bool | requestType (const std::type_info &t) |
| Utility for derived classes, which may be able to adapt memory array type as well.
|
|
void | unsetType () |
| calls void setType<void>().
|
|
const std::type_info & | getType () const |
| Returns type_info of the current type.
|
|
bool | typeIsSet () const |
|
size_t | getElementSize () const |
| Returns the size of the base type (size of an element, not of element array).
|
|
template<class T > |
void | put (void *p, const T &x) const |
| Default conversion (for unconventional types). Uses std::stringstream for conversion.
|
|
template<class T > |
void | put (const T &x) const |
| Write to internal pointer using put(this->ptr, x).
|
|
void | put (void *p, const char *x) const |
|
void | put (const char *x) const |
| Write to internal pointer, calls put(this->ptr, x).
|
|
template<class T > |
T | get (const void *p) const |
| Default implementation throws an error. See specialized implementation below.
|
|
template<class T > |
T | get () const |
|
void | translate (const Caster &c, const void *ptrC, void *ptr) const |
| Convert from str pointer and Caster.
|
|
void | translate (const Caster &c) const |
| Convert from str Caster.
|
|
bool | compare (const void *ptr, const Caster &c, const void *cPtr) const |
|
std::istream & | fromStream (std::istream &istr, const void *p) const |
|
std::ostream & | toOStream (std::ostream &ostr, const void *p) const |
| Write data to output stream.
|
|
std::ostream & | toOStream (std::ostream &ostr) const |
| Write data to output stream.
|
|
template<> |
void | link (Caster &c) |
|
template<> |
void | put (void *p, const bool &x) const |
|
template<> |
void | put (void *p, const char &x) const |
|
template<> |
void | put (void *p, const unsigned char &x) const |
|
template<> |
void | put (void *p, const int &x) const |
|
template<> |
void | put (void *p, const unsigned int &x) const |
|
template<> |
void | put (void *p, const long &x) const |
|
template<> |
void | put (void *p, const unsigned long &x) const |
|
template<> |
void | put (void *p, const float &x) const |
|
template<> |
void | put (void *p, const double &x) const |
|
template<> |
bool | get (const void *p) const |
|
template<> |
char | get (const void *p) const |
|
template<> |
unsigned char | get (const void *p) const |
|
template<> |
short | get (const void *p) const |
|
template<> |
unsigned short | get (const void *p) const |
|
template<> |
int | get (const void *p) const |
|
template<> |
unsigned int | get (const void *p) const |
|
template<> |
long | get (const void *p) const |
|
template<> |
unsigned long | get (const void *p) const |
|
template<> |
float | get (const void *p) const |
|
template<> |
double | get (const void *p) const |
|
|
template<class T , class F > |
static void | putT (void *p, const T &x) |
| Convert input of base type to internally applied base type.
|
|
template<class T > |
static void | putToVoidT (void *p, const T &x) |
| Void - does nothing, regardless of input type.
|
|
template<class T > |
static void | putToStringT (void *p, const T &x) |
| A handler for converting input to a std::string. More...
|
|
template<class T > |
static void | putToCasterT (void *p, const T &x) |
|
template<class T , class F > |
static T | getT (const void *p) |
| The main handler converting input to output. More...
|
|
template<class T > |
static T | getFromVoidT (const void *p) |
| This default implementation is for integral numeric types, returns zero. Specialisation for floats returns NAN.
|
|
template<class T > |
static T | getFromStringT (const void *p) |
| The main handler converting input to output.
|
|
template<class F > |
static void | translateT (const Caster &c, const void *ptrC, void *ptr) |
| Casts from ptrC to ptr. More...
|
|
template<class F > |
static bool | compareT (const void *ptr, const Caster &c, const void *cPtr) |
| Checks equality through base type casting. More...
|
|
template<class F > |
static std::ostream & | toOStreamT (std::ostream &ostr, const void *p) |
| Output.
|
|
template<class F > |
static std::ostream & | toOStreamFloats (std::ostream &ostr, const void *p) |
|
template<class F > |
static std::istream & | fromStreamT (std::istream &istr, const void *p) |
| Output.
|
|
template<> |
void | translateT (const Caster &c, const void *ptrC, void *ptr) |
|
template<> |
void | translateT (const Caster &c, const void *ptrC, void *ptr) |
|
template<> |
double | getFromVoidT (const void *p) |
| Specialisation for floats returns NAN.
|
|
template<> |
float | getFromVoidT (const void *p) |
|
template<> |
bool | compareT (const void *ptr, const Caster &c, const void *cPtr) |
| Semantics: no data, hence no bytes to be compared. More...
|
|
template<> |
std::ostream & | toOStreamT (std::ostream &ostr, const void *p) |
| Append nothing to the stream.
|
|
template<> |
std::ostream & | toOStreamT (std::ostream &ostr, const void *p) |
| Append 'true' or false to the stream.
|
|
template<> |
std::ostream & | toOStreamT (std::ostream &ostr, const void *p) |
| Append to the stream.
|
|
template<> |
std::ostream & | toOStreamT (std::ostream &ostr, const void *p) |
|
template<> |
std::ostream & | toOStreamT (std::ostream &ostr, const void *p) |
|
|
void(* | putBool )(void *p, const bool &x) |
|
void(* | putInt )(void *p, const int &x) |
|
void(* | putChar )(void *p, const char &x) |
|
void(* | putUChar )(void *p, const unsigned char &x) |
|
void(* | putUInt )(void *p, const unsigned int &x) |
|
void(* | putShort )(void *p, const short &x) |
|
void(* | putUShort )(void *p, const unsigned short &x) |
|
void(* | putLong )(void *p, const long &x) |
|
void(* | putULong )(void *p, const unsigned long &x) |
|
void(* | putFloat )(void *p, const float &x) |
|
void(* | putDouble )(void *p, const double &x) |
|
char(* | getChar )(const void *p) |
|
unsigned char(* | getUChar )(const void *p) |
|
int(* | getInt )(const void *p) |
|
unsigned int(* | getUInt )(const void *p) |
|
short(* | getShort )(const void *p) |
|
unsigned short(* | getUShort )(const void *p) |
|
long(* | getLong )(const void *p) |
|
unsigned long(* | getULong )(const void *p) |
|
float(* | getFloat )(const void *p) |
|
double(* | getDouble )(const void *p) |
|
bool(* | getBool )(const void *p) |
|
void(* | translatePtr )(const Caster &c, const void *ptrC, void *ptr) |
| Convert from str pointer and Caster.
|
|
bool(* | comparePtr )(const void *, const Caster &c, const void *) = nullptr |
|
std::ostream &(* | toOStreamPtr )(std::ostream &ostr, const void *p) |
| Write to stream.
|
|
std::istream &(* | fromStreamPtr )(std::istream &istr, const void *p) = nullptr |
|
const std::type_info * | type |
| Current type.
|
|
size_t | byteSize |
| Size of target memory (target object) in bytes.
|
|