#include <typeless.h>
Inheritance diagram for Typeless:
The operations provided here should either be supported by all types, or they should have a guard routine such as isnumeric() below. Binary routines (e.g. operator<) are only guaranteed to be supported between two identical underlying types. Other combinations may also be supported; if they are not a runtime error should be generated (an assertion or error exit).
Definition at line 27 of file typeless.h.
Public Types | |
typedef Typeless | self |
typedef long double | exprtype |
Unified return type for numeric values. | |
Public Methods | |
virtual string | stringrep (String::StreamFormat format=String::StreamFormat()) const=0 |
Returns a string representation of the current value of this object. | |
virtual string | prettyprint (String::StreamFormat format=String::StreamFormat()) const |
Returns a string representation of the current value of this object, with extra formatting suitable for user-visible values, if appropriate (e.g. | |
virtual string | typestring () const |
Returns a string representation of the datatype of this object. | |
virtual bool | operator< (const Typeless &o) const=0 |
virtual bool | operator> (const Typeless &o) const=0 |
virtual bool | operator== (const Typeless &o) const |
virtual bool | operator!= (const Typeless &o) const |
virtual Typeless & | set (const Typeless &o)=0 |
virtual bool | isnumeric () const |
Returns true if this is a type for which numericvalue() is defined. | |
virtual exprtype | numericvalue () const |
If the type is numeric, return it as exprtype; else return 0. | |
virtual Typeless * | parse (const StringParser &parser, const string &s) const=0 |
Returns the result of parsing the given string with the given parser. | |
virtual Typeless * | clone () const=0 |
Constructs an identical copy of self and returns it. | |
virtual Typeless * | duplicate () const=0 |
Same as clone except that the result is guaranteed to have an independent copy of the underlying value. |
|
Returns a string representation of the current value of this object, with extra formatting suitable for user-visible values, if appropriate (e.g. quotes around strings). Unless overridden by a particular class, this is the same as stringrep(). Reimplemented in Polymorph< string >. Definition at line 40 of file typeless.h. References stringrep(). Referenced by ParameterDefinition< T >::stringrep(). |
|
Returns a string representation of the datatype of this object. The value is not guaranteed to be anything particularly useful, one cannot count on any implementation more specific than the one here. Reimplemented in PolymorphBase< T >, and PolymorphBase< string >. Definition at line 47 of file typeless.h. Referenced by ParameterDefinition< T >::definition_matches(). |