UNIVERS
15.3
UNIVERS base processing software API
|
#include <AnyValue.hpp>
Public Member Functions | |
AnyValue (AtomType at=INT_4, unsigned count=1, CategoryId catid=UC_NONE) | |
AnyValue (double val, CategoryId catid=UC_NONE) | |
AnyValue (int val, CategoryId catid=UC_NONE) | |
AnyValue (const DomainDef &dmn, void *rec_ptr=NULL) | |
AnyValue (const AnyValue &av) | |
AnyValue & | operator= (const AnyValue &av) |
virtual | ~AnyValue () |
void | new_def (AtomType at, unsigned count=1, CategoryId catid=UC_NONE) |
void | new_def (const AnyValue &av) |
AtomType | get_type () const |
unsigned | get_dim () const |
CategoryId | get_categ () const |
void | attach (void *val_ptr) |
void | detach () |
bool | is_changed () const |
void | changes () |
void | reset_changes () |
char | get_char (unsigned i=0) const |
Char2 | get_unicode (unsigned i=0) const |
double | get_float (unsigned i=0) const |
int | get_int (unsigned i=0) const |
operator char () const | |
operator float () const | |
operator double () const | |
operator short () const | |
operator int () const | |
operator long () const | |
BlobRef | get_blob_ref () const |
void | get_int1 (char *val) const |
void | get_int2 (short *val) const |
void | get_int4 (int *val) const |
void | get_real4 (float *val) const |
void | get_real8 (double *val) const |
void | get_char (char *val) const |
void | get_unicode (Char2 *val) const |
char * | get_alloc_int1 () const |
short * | get_alloc_int2 () const |
int * | get_alloc_int4 () const |
float * | get_alloc_real4 () const |
double * | get_alloc_real8 () const |
char * | get_alloc_char () const |
Char2 * | get_alloc_unicode () const |
void | set_char (char val, unsigned i=0) |
void | set_unicode (Char2 val, unsigned i=0) |
void | set_float (double val, unsigned i=0) |
void | set_int (int val, unsigned i=0) |
void | set_blob_ref (BlobRef val) |
void | set_int1 (const char *val) |
void | set_int2 (const short *val) |
void | set_int4 (const int *val) |
void | set_real4 (const float *val) |
void | set_real8 (const double *val) |
void | set_char (const char *val) |
void | set_unicode (const Char2 *val) |
virtual bool | operator== (const AnyValue &av) const |
bool | operator!= (const AnyValue &av) const |
virtual void | serialize (OutputStream &ost) const |
virtual void | deserialize (InputStream &ist) |
void | definition (bool f) |
virtual char * | check_string (const char *s, int *pDim=NULL) const |
virtual char * | from_string (const char *s) |
virtual char * | to_string () const |
bool | is_empty_value () const |
void | empty_value () |
void | print_self (FILE *stream=NULL, const char *szPre=NULL, const char *szPost=NULL) const |
Public Member Functions inherited from SerialThis | |
SerialThis () | |
SerialThis (InputStream &ist) | |
Public Member Functions inherited from TextRepres | |
TextRepres () | |
void | set_enlarge_dim_mode (bool bMayEnlarge) |
bool | get_enlarge_dim_mode () const |
operator char * () const | |
Static Public Member Functions | |
static Compar | compare (const AnyValue &av1, const AnyValue &av2) |
Additional Inherited Members | |
Protected Attributes inherited from TextRepres | |
bool | bEnlargeMode |
Any type value container. Just one scalar or vector item can be represented.
AnyValue::AnyValue | ( | AtomType | at = INT_4 , |
unsigned | count = 1 , |
||
CategoryId | catid = UC_NONE |
||
) |
Create default value of given type
AnyValue::AnyValue | ( | double | val, |
CategoryId | catid = UC_NONE |
||
) |
Create value of implicitly defined type
AnyValue::AnyValue | ( | const DomainDef & | dmn, |
void * | rec_ptr = NULL |
||
) |
Create shadow of given domain contents (auto attached in case of NULL!=rec_ptr)
AnyValue::AnyValue | ( | const AnyValue & | av | ) |
Create a copy of the value (not a shadow!!!)
|
virtual |
Destroy the value
void AnyValue::attach | ( | void * | val_ptr | ) |
Attach memory with true value storage (use the value from it)
|
inline |
Set changes flag
|
virtual |
Check the string for right parsing and return NULL in case of syntax error or pointer just after the last parsed character in case of success. Optional number may be returned if a dimension of parsed data may be needed.
Implements TextRepres.
Get the comparison result; for UNICODE and only equal/not-equal result has a meaning; for BlobRef operation compares only blob id, not contents
|
inline |
Turn on (by default) or off putting/getting value definition to/from the stream
|
virtual |
Get the value from the stream with definition
Reimplemented from SerialThis.
|
inline |
Detach true value storage
void AnyValue::empty_value | ( | ) |
Setup default empty value
|
virtual |
Convert text string to predefined value. ERROR__BAD_SYNTAX is thrown in case of syntax error. Returns the pointer to the first character that can't be parsed.
Implements TextRepres.
|
inline |
Return category of the value
|
inline |
Return dimension of the value
|
inline |
Return type of the value
|
inline |
Get status of changes
bool AnyValue::is_empty_value | ( | ) | const |
Check for empty value
void AnyValue::new_def | ( | AtomType | at, |
unsigned | count = 1 , |
||
CategoryId | catid = UC_NONE |
||
) |
Change value definition
|
inline |
Change value definition
bool AnyValue::operator!= | ( | const AnyValue & | av | ) | const |
Inverted operator== ().
Make a copy of the value without touching the type and dim. Minimum number of items is copied from source av to target.
|
virtual |
Return TRUE in case of two values are equal and FALSE otherwise.
void AnyValue::print_self | ( | FILE * | stream = NULL , |
const char * | szPre = NULL , |
||
const char * | szPost = NULL |
||
) | const |
Print contents to given stream adding leading and final strings. NULL means using stdout.
|
inline |
Reset status of changes, leads to FALSE at next call to is_changed()
|
virtual |
Put the value to the stream with definition
Reimplemented from SerialThis.
|
virtual |
Convert the value into text string. Dynamic string allocation takes place. Returned string must be free(). NULL means the value can't be converted to string for some reason.
Implements TextRepres.