Represents the result of an evaluation. More...
#include <value.h>
Public Types | |
enum | ValueType { NULL_VALUE = 0, ERROR_VALUE = 1<<0, UNDEFINED_VALUE = 1<<1, BOOLEAN_VALUE = 1<<2, INTEGER_VALUE = 1<<3, REAL_VALUE = 1<<4, RELATIVE_TIME_VALUE = 1<<5, ABSOLUTE_TIME_VALUE = 1<<6, STRING_VALUE = 1<<7, CLASSAD_VALUE = 1<<8, LIST_VALUE = 1<<9, NULL_VALUE = 0, ERROR_VALUE = 1<<0, UNDEFINED_VALUE = 1<<1, BOOLEAN_VALUE = 1<<2, INTEGER_VALUE = 1<<3, REAL_VALUE = 1<<4, RELATIVE_TIME_VALUE = 1<<5, ABSOLUTE_TIME_VALUE = 1<<6, STRING_VALUE = 1<<7, CLASSAD_VALUE = 1<<8, LIST_VALUE = 1<<9 } |
Value types. More... | |
enum | NumberFactor { NO_FACTOR = 0, B_FACTOR = 1, K_FACTOR = 2, M_FACTOR = 3, G_FACTOR = 4, T_FACTOR = 5, NO_FACTOR = 0, B_FACTOR = 1, K_FACTOR = 2, M_FACTOR = 3, G_FACTOR = 4, T_FACTOR = 5 } |
Number factors. More... | |
enum | ValueType { NULL_VALUE = 0, ERROR_VALUE = 1<<0, UNDEFINED_VALUE = 1<<1, BOOLEAN_VALUE = 1<<2, INTEGER_VALUE = 1<<3, REAL_VALUE = 1<<4, RELATIVE_TIME_VALUE = 1<<5, ABSOLUTE_TIME_VALUE = 1<<6, STRING_VALUE = 1<<7, CLASSAD_VALUE = 1<<8, LIST_VALUE = 1<<9, NULL_VALUE = 0, ERROR_VALUE = 1<<0, UNDEFINED_VALUE = 1<<1, BOOLEAN_VALUE = 1<<2, INTEGER_VALUE = 1<<3, REAL_VALUE = 1<<4, RELATIVE_TIME_VALUE = 1<<5, ABSOLUTE_TIME_VALUE = 1<<6, STRING_VALUE = 1<<7, CLASSAD_VALUE = 1<<8, LIST_VALUE = 1<<9 } |
Value types. More... | |
enum | NumberFactor { NO_FACTOR = 0, B_FACTOR = 1, K_FACTOR = 2, M_FACTOR = 3, G_FACTOR = 4, T_FACTOR = 5, NO_FACTOR = 0, B_FACTOR = 1, K_FACTOR = 2, M_FACTOR = 3, G_FACTOR = 4, T_FACTOR = 5 } |
Number factors. More... | |
Public Member Functions | |
Value () | |
Constructor. | |
Value (const Value &value) | |
Copy Constructor. | |
~Value () | |
Destructor. | |
Value & | operator= (const Value &value) |
Assignment operator. | |
void | Clear (void) |
void | CopyFrom (const Value &v) |
void | SetBooleanValue (bool b) |
void | SetRealValue (double r) |
void | SetIntegerValue (int i) |
void | SetUndefinedValue (void) |
void | SetErrorValue (void) |
void | SetListValue (ExprList *l) |
void | SetClassAdValue (ClassAd *c) |
void | SetStringValue (const std::string &str) |
void | SetStringValue (const char *str) |
void | SetAbsoluteTimeValue (abstime_t secs) |
void | SetRelativeTimeValue (time_t secs) |
void | SetRelativeTimeValue (double secs) |
ValueType | GetType () const |
bool | IsBooleanValue (bool &b) const |
bool | IsBooleanValue () const |
bool | IsBooleanValueEquiv (bool &b) const |
bool | IsIntegerValue (int &i) const |
bool | IsIntegerValue () const |
bool | IsRealValue (double &r) const |
bool | IsRealValue () const |
bool | IsStringValue (std::string &str) const |
bool | IsStringValue (const char *&str) const |
bool | IsStringValue (char *str, int len) const |
bool | IsStringValue (int &size) const |
bool | IsStringValue () const |
bool | IsListValue (const ExprList *&l) const |
bool | IsListValue (ExprList *&l) |
bool | IsListValue () const |
bool | IsClassAdValue (const ClassAd *&c) const |
bool | IsClassAdValue (ClassAd *&c) |
bool | IsClassAdValue () const |
bool | IsUndefinedValue () const |
bool | IsErrorValue () const |
bool | IsExceptional () const |
bool | IsNumber () const |
bool | IsNumber (int &i) const |
bool | IsNumber (double &r) const |
bool | IsAbsoluteTimeValue () const |
bool | IsAbsoluteTimeValue (abstime_t &secs) const |
bool | IsRelativeTimeValue () const |
bool | IsRelativeTimeValue (double &secs) const |
bool | IsRelativeTimeValue (time_t &secs) const |
bool | SameAs (const Value &otherValue) const |
Value () | |
Constructor. | |
Value (const Value &value) | |
Copy Constructor. | |
~Value () | |
Destructor. | |
Value & | operator= (const Value &value) |
Assignment operator. | |
void | Clear (void) |
void | CopyFrom (const Value &v) |
void | SetBooleanValue (bool b) |
void | SetRealValue (double r) |
void | SetIntegerValue (int i) |
void | SetUndefinedValue (void) |
void | SetErrorValue (void) |
void | SetListValue (ExprList *l) |
void | SetClassAdValue (ClassAd *c) |
void | SetStringValue (const std::string &str) |
void | SetStringValue (const char *str) |
void | SetAbsoluteTimeValue (abstime_t secs) |
void | SetRelativeTimeValue (time_t secs) |
void | SetRelativeTimeValue (double secs) |
ValueType | GetType () const |
bool | IsBooleanValue (bool &b) const |
bool | IsBooleanValue () const |
bool | IsBooleanValueEquiv (bool &b) const |
bool | IsIntegerValue (int &i) const |
bool | IsIntegerValue () const |
bool | IsRealValue (double &r) const |
bool | IsRealValue () const |
bool | IsStringValue (std::string &str) const |
bool | IsStringValue (const char *&str) const |
bool | IsStringValue (char *str, int len) const |
bool | IsStringValue (int &size) const |
bool | IsStringValue () const |
bool | IsListValue (const ExprList *&l) const |
bool | IsListValue (ExprList *&l) |
bool | IsListValue () const |
bool | IsClassAdValue (const ClassAd *&c) const |
bool | IsClassAdValue (ClassAd *&c) |
bool | IsClassAdValue () const |
bool | IsUndefinedValue () const |
bool | IsErrorValue () const |
bool | IsExceptional () const |
bool | IsNumber () const |
bool | IsNumber (int &i) const |
bool | IsNumber (double &r) const |
bool | IsAbsoluteTimeValue () const |
bool | IsAbsoluteTimeValue (abstime_t &secs) const |
bool | IsRelativeTimeValue () const |
bool | IsRelativeTimeValue (double &secs) const |
bool | IsRelativeTimeValue (time_t &secs) const |
bool | SameAs (const Value &otherValue) const |
Static Public Attributes | |
static const double | ScaleFactor [] |
Values of number multiplication factors. | |
Friends | |
class | Literal |
class | ClassAd |
class | ExprTree |
bool | operator== (const Value &value1, const Value &value2) |
std::ostream & | operator<< (std::ostream &stream, Value &value) |
bool | operator== (const Value &value1, const Value &value2) |
std::ostream & | operator<< (std::ostream &stream, Value &value) |
Represents the result of an evaluation.
enum Value::NumberFactor |
enum Value::NumberFactor |
enum Value::ValueType |
Value types.
enum Value::ValueType |
Value types.
void Value::Clear | ( | void | ) |
Discards the previous value and sets the value to UNDEFINED
void Value::Clear | ( | void | ) |
Discards the previous value and sets the value to UNDEFINED
void Value::CopyFrom | ( | const Value & | v | ) |
Copies the value of another value object.
v | The value copied from. |
void Value::CopyFrom | ( | const Value & | v | ) |
Copies the value of another value object.
v | The value copied from. |
ValueType Value::GetType | ( | ) | const [inline] |
ValueType Value::GetType | ( | ) | const [inline] |
bool Value::IsAbsoluteTimeValue | ( | ) | const [inline] |
Checks if the value is an absolute time value.
bool Value::IsAbsoluteTimeValue | ( | abstime_t & | secs | ) | const [inline] |
Checks if the value is an absolute time value.
secs | - Absolute time literal (Number of seconds since the UNIX epoch,timezone offset). |
bool Value::IsAbsoluteTimeValue | ( | ) | const |
Checks if the value is an absolute time value.
bool Value::IsAbsoluteTimeValue | ( | abstime_t & | secs | ) | const |
Checks if the value is an absolute time value.
secs | - Absolute time literal (Number of seconds since the UNIX epoch,timezone offset). |
bool Value::IsBooleanValue | ( | bool & | b | ) | const [inline] |
Checks if the value is boolean.
b | The boolean value if the value is boolean. |
bool Value::IsBooleanValue | ( | ) | const [inline] |
Checks if the value is boolean.
bool Value::IsBooleanValue | ( | ) | const [inline] |
Checks if the value is boolean.
bool Value::IsBooleanValue | ( | bool & | b | ) | const [inline] |
Checks if the value is boolean.
b | The boolean value if the value is boolean. |
bool Value::IsBooleanValueEquiv | ( | bool & | b | ) | const |
Checks if the value is boolean or something considered equivalent by implicit conversion (e.g. a number), if old ClassAd evaluation semantics are being used. If they're not being used, this method behaves like IsBooleanValue().
b | The boolean value if return is true. |
bool Value::IsBooleanValueEquiv | ( | bool & | b | ) | const |
Checks if the value is boolean or something considered equivalent by implicit conversion (e.g. a number), if old ClassAd evaluation semantics are being used. If they're not being used, this method behaves like IsBooleanValue().
b | The boolean value if return is true. |
bool Value::IsClassAdValue | ( | const ClassAd *& | c | ) | const [inline] |
bool Value::IsClassAdValue | ( | ClassAd *& | c | ) | [inline] |
bool Value::IsClassAdValue | ( | ) | const [inline] |
bool Value::IsClassAdValue | ( | const ClassAd *& | c | ) | const [inline] |
bool Value::IsClassAdValue | ( | ClassAd *& | c | ) | [inline] |
bool Value::IsClassAdValue | ( | ) | const [inline] |
bool Value::IsErrorValue | ( | void | ) | const [inline] |
Checks if the value is the error value.
bool Value::IsErrorValue | ( | ) | const [inline] |
Checks if the value is the error value.
bool Value::IsExceptional | ( | void | ) | const [inline] |
Checks if the value is exceptional.
bool Value::IsExceptional | ( | ) | const [inline] |
Checks if the value is exceptional.
bool Value::IsIntegerValue | ( | int & | i | ) | const [inline] |
Checks if the value is integral.
i | The integer value if the value is integer. |
bool Value::IsIntegerValue | ( | ) | const [inline] |
Checks if the value is integral.
bool Value::IsIntegerValue | ( | ) | const [inline] |
Checks if the value is integral.
bool Value::IsIntegerValue | ( | int & | i | ) | const [inline] |
Checks if the value is integral.
i | The integer value if the value is integer. |
bool Value::IsListValue | ( | ) | const [inline] |
bool Value::IsListValue | ( | const ExprList *& | l | ) | const [inline] |
Checks if the value is an expression list.
l | The expression list if the value is an expression list. |
bool Value::IsListValue | ( | ExprList *& | l | ) | [inline] |
bool Value::IsListValue | ( | const ExprList *& | l | ) | const [inline] |
Checks if the value is an expression list.
l | The expression list if the value is an expression list. |
bool Value::IsListValue | ( | ) | const [inline] |
bool Value::IsListValue | ( | ExprList *& | l | ) | [inline] |
bool Value::IsNumber | ( | double & | r | ) | const |
Checks if the value is numerical. If the value is an integer, it is promoted to a real.
r | The real value of the value if the value is a number. |
bool Value::IsNumber | ( | ) | const [inline] |
Checks if the value is numerical.
bool Value::IsNumber | ( | int & | i | ) | const |
Checks if the value is numerical. If the value is a real, it is converted to an integer through truncation.
i | The integer value of the value if the value is a number. |
bool Value::IsNumber | ( | int & | i | ) | const |
Checks if the value is numerical. If the value is a real, it is converted to an integer through truncation.
i | The integer value of the value if the value is a number. |
bool Value::IsNumber | ( | ) | const |
Checks if the value is numerical.
bool Value::IsNumber | ( | double & | r | ) | const |
Checks if the value is numerical. If the value is an integer, it is promoted to a real.
r | The real value of the value if the value is a number. |
bool Value::IsRealValue | ( | double & | r | ) | const [inline] |
Checks if the value is real.
r | The real value if the value is real. |
bool Value::IsRealValue | ( | ) | const [inline] |
Checks if the value is real.
bool Value::IsRealValue | ( | double & | r | ) | const [inline] |
Checks if the value is real.
r | The real value if the value is real. |
bool Value::IsRealValue | ( | ) | const [inline] |
Checks if the value is real.
bool Value::IsRelativeTimeValue | ( | ) | const |
Checks if the value is a relative time value.
bool Value::IsRelativeTimeValue | ( | ) | const [inline] |
Checks if the value is a relative time value.
bool Value::IsRelativeTimeValue | ( | double & | secs | ) | const [inline] |
Checks if the value is a relative time value.
secs | Number of seconds |
bool Value::IsRelativeTimeValue | ( | double & | secs | ) | const |
Checks if the value is a relative time value.
secs | Number of seconds |
bool Value::IsStringValue | ( | std::string & | str | ) | const |
Checks if the value is a string.
str | A reference to a string object, which is filled with the string value. |
bool Value::IsStringValue | ( | char * | str, | |
int | len | |||
) | const |
Checks if the value is a string and provides a copy of it in a buffer you provide
str | A buffer to hold the string value. | |
len | The size of the buffer. |
bool Value::IsStringValue | ( | ) | const [inline] |
Checks if the value is a string.
bool Value::IsStringValue | ( | int & | size | ) | const [inline] |
Returns length of the string instead of the string
size | This is filled in with the size of the string |
bool Value::IsStringValue | ( | const char *& | str | ) | const |
Checks if the value is a string.
str | A reference to a C string, which will point to the string value. This pointer must not be deallocated or tampered with. |
bool Value::IsStringValue | ( | std::string & | str | ) | const [inline] |
Checks if the value is a string.
str | A reference to a string object, which is filled with the string value. |
bool Value::IsStringValue | ( | const char *& | str | ) | const [inline] |
Checks if the value is a string.
str | A reference to a C string, which will point to the string value. This pointer must not be deallocated or tampered with. |
bool Value::IsStringValue | ( | char * | str, | |
int | len | |||
) | const [inline] |
Checks if the value is a string and provides a copy of it in a buffer you provide
str | A buffer to hold the string value. | |
len | The size of the buffer. |
bool Value::IsStringValue | ( | int & | size | ) | const [inline] |
Returns length of the string instead of the string
size | This is filled in with the size of the string |
bool Value::IsStringValue | ( | ) | const [inline] |
Checks if the value is a string.
bool Value::IsUndefinedValue | ( | void | ) | const [inline] |
Checks if the value is the undefined value.
bool Value::IsUndefinedValue | ( | ) | const [inline] |
Checks if the value is the undefined value.
void Value::SetAbsoluteTimeValue | ( | abstime_t | secs | ) |
Sets an absolute time value in seconds since the UNIX epoch, & the time zone it's measured in.
secs | - Absolute Time Literal(seconds since the UNIX epoch, timezone offset) . |
void Value::SetAbsoluteTimeValue | ( | abstime_t | secs | ) |
Sets an absolute time value in seconds since the UNIX epoch, & the time zone it's measured in.
secs | - Absolute Time Literal(seconds since the UNIX epoch, timezone offset) . |
void Value::SetBooleanValue | ( | bool | b | ) |
Sets a boolean value; previous value discarded.
b | The boolean value. |
void Value::SetBooleanValue | ( | bool | b | ) |
Sets a boolean value; previous value discarded.
b | The boolean value. |
void Value::SetClassAdValue | ( | ClassAd * | c | ) |
void Value::SetClassAdValue | ( | ClassAd * | c | ) |
void Value::SetErrorValue | ( | void | ) |
Sets the error value; previous value discarded.
void Value::SetErrorValue | ( | void | ) |
Sets the error value; previous value discarded.
void Value::SetIntegerValue | ( | int | i | ) |
Sets an integer value; previous value discarded.
i | The integer value. |
void Value::SetIntegerValue | ( | int | i | ) |
Sets an integer value; previous value discarded.
i | The integer value. |
void Value::SetListValue | ( | ExprList * | l | ) |
void Value::SetListValue | ( | ExprList * | l | ) |
void Value::SetRealValue | ( | double | r | ) |
Sets a real value; previous value discarded.
r | The real value. |
void Value::SetRealValue | ( | double | r | ) |
Sets a real value; previous value discarded.
r | The real value. |
void Value::SetRelativeTimeValue | ( | time_t | secs | ) |
Sets a relative time value.
secs | Number of seconds. |
void Value::SetRelativeTimeValue | ( | time_t | secs | ) |
Sets a relative time value.
secs | Number of seconds. |
void Value::SetStringValue | ( | const char * | str | ) |
Sets a string value; previous value discarded. The string is copied so you may feel free to delete the original if you wish.
str | The string value. |
void Value::SetStringValue | ( | const std::string & | str | ) |
Sets a string value; previous value discarded.
str | The string value. |
void Value::SetStringValue | ( | const std::string & | str | ) |
Sets a string value; previous value discarded.
str | The string value. |
void Value::SetStringValue | ( | const char * | str | ) |
Sets a string value; previous value discarded. The string is copied so you may feel free to delete the original if you wish.
str | The string value. |
void Value::SetUndefinedValue | ( | void | ) |
Sets the undefined value; previous value discarded.
void Value::SetUndefinedValue | ( | void | ) |
Sets the undefined value; previous value discarded.
const double Value::ScaleFactor [static] |
{ 1.0, 1.0, 1024.0, 1024.0*1024.0, 1024.0*1024.0*1024.0, 1024.0*1024.0*1024.0*1024.0 }
Values of number multiplication factors.