This class encapsulates the value of the runtime attributes attached to representation objects. More...
#include <ilserver/mvvalue.h>
Public Member Functions | |
Constructors/Destructors | |
IlsMvValue () | |
This default constructor creates an instance of IlsMvValue that contains no value. | |
IlsMvValue (IlsBoolean val) | |
This constructor creates an instance of IlsMvValue that contains the IlsBoolean value val. | |
IlsMvValue (char val) | |
This constructor creates an instance of IlsMvValue that contains the value val of type char . | |
IlsMvValue (int val) | |
This constructor creates an instance of IlsMvValue that contains the integer val, which was first converted to a long integer. | |
IlsMvValue (short val) | |
This constructor creates an instance of IlsMvValue that contains the short integer val, which was first converted to a long integer. | |
IlsMvValue (long val) | |
This constructor creates an instance of IlsMvValue that contains the value val of type long . | |
IlsMvValue (float val) | |
This constructor creates an instance of IlsMvValue that contains the value val of type float . | |
IlsMvValue (double val) | |
This constructor creates an instance of IlsMvValue that contains the value val of type double . | |
IlsMvValue (const char *val) | |
This constructor creates an instance of IlsMvValue that contains an IlsString whose value is a copy of the string provided as its argument. | |
IlsMvValue (const IlsString &sharedStr) | |
This constructor creates an instance of IlsMvValue that contains an IlsString whose value is shared with sharedStr. | |
IlsMvValue (IlsSvRef) | |
This constructor creates an instance of IlsMvValue that contains a copy of the val object, which references a server object. | |
IlsMvValue (IlsMvRef val) | |
This constructor creates an instance of IlsMvValue that contains a copy of the val object, which references a representation object. | |
IlsMvValue (const IlsMvUserType &val) | |
This constructor creates an instance of IlsMvValue that contains a pointer to the user value whose real type derives from IlsMvUserType . | |
IlsMvValue (const IlsMvValue &val) | |
Copy constructor. More... | |
IlsMvValue (const IlsMvFile &val) | |
This constructor creates an instance of IlsMvValue that contains a copy of the val object, which represents a file. | |
~IlsMvValue () | |
If the object contains a pointer to an IlsMvUserType , the destructor of the pointed object is invoked. | |
Assignment Operators | |
IlsMvValue & | operator= (const IlsMvValue &val) |
This operator assigns the value val to the object. More... | |
IlsMvValue & | operator= (IlsBoolean val) |
This operator assigns the IlsBoolean value val to the value contained in the object. | |
IlsMvValue & | operator= (char val) |
This operator assigns the value val of type char to the value contained in the object. | |
IlsMvValue & | operator= (short val) |
This operator assigns the value val of type short to the value contained in the object after it was converted to a long integer. | |
IlsMvValue & | operator= (int val) |
This operator assigns the value val of type int to the value contained in the object after it was converted to a long integer. | |
IlsMvValue & | operator= (long val) |
This operator assigns the value val of type long to the value contained in the object. | |
IlsMvValue & | operator= (float val) |
This operator assigns the value val of type float to the value contained in the object. | |
IlsMvValue & | operator= (double val) |
This operator assigns the value val of type double to the value contained in the object. | |
IlsMvValue & | operator= (const IlsString &) |
This operator assigns the string passed as its argument to the value contained in the object. | |
IlsMvValue & | operator= (const char *) |
This operator assigns a copy of the string passed as its parameter to the value contained in the object. | |
IlsMvValue & | operator= (IlsSvRef) |
This operator assigns the server object reference passed as its parameter to the value contained in the object. | |
IlsMvValue & | operator= (IlsMvRef) |
This operator assigns the object reference passed as its parameter to the value contained in the object. | |
IlsMvValue & | operator= (const IlsMvUserType &) |
This operator assigns the pointer to the value contained in the object. | |
IlsMvValue & | operator= (const IlsMvFile &) |
This operator assigns the file passed as its argument to the value contained in the object. | |
Conversion Operators | |
operator IlsBoolean () const | |
Returns the result of asBoolean(IlsFalse, IlsFalse) . | |
operator char () const | |
Returns the result of asChar(IlsFalse, 0) . | |
operator short () const | |
Returns the result of asLong(IlsFalse, 0) after it was converted to a short . | |
operator int () const | |
Returns the result of asLong(IlsFalse, 0) after it was converted to an integer. | |
operator long () const | |
Returns the result of asLong(IlsFalse, 0) . | |
operator float () const | |
Returns the result of asFloat(IlsFalse, 0.0) . | |
operator double () const | |
Returns the result of asDouble(IlsFalse, 0.0) . | |
operator IlsString () const | |
Returns the result of asString(IlsFalse, 0) . | |
operator IlsMvRef () const | |
Returns the result of asObjectRef(IlsFalse, 0) . | |
operator IlsSvRef () const | |
Returns the result of the conversion operator asSvObjectRef() . | |
operator IlsMvFile () const | |
Returns the result of the conversion operator asFile(IlsFalse, 0) . | |
operator IlsMvUserType * () const | |
Returns the pointer IlsMvUserType* if the value is of that type. Otherwise, it returns 0. | |
Controlled Conversion | |
IlsBoolean | asBoolean (IlsBoolean direct=IlsFalse, IlsBoolean defaultVal=0) const |
Returns the value contained in the object if that value is a IlsBoolean type. More... | |
char | asChar (IlsBoolean direct=IlsFalse, char defaultVal=0) const |
Returns the value contained in the object if that value is a character. More... | |
long | asLong (IlsBoolean direct=IlsFalse, long defaultVal=0) const |
Returns the value contained in the object if that value is a long integer. More... | |
float | asFloat (IlsBoolean direct=IlsFalse, float defaultVal=0.0) const |
Returns the value contained in the object if that value is of type float . More... | |
double | asDouble (IlsBoolean direct=IlsFalse, double defaultVal=0.0) const |
Returns the value contained in the object if that value is of type double . More... | |
IlsString | asString (IlsBoolean direct=IlsFalse, IlsString defaultVal=(char *) 0) const |
Returns the value contained in the object if that value is a character string. More... | |
IlsMvRef | asObjectRef (IlsBoolean direct=IlsFalse, IlsMvRef defaultVal=IlsMvRef()) const |
Returns the value contained in the object if that value is of type IlsMvRef . More... | |
IlsMvFile | asFile (IlsBoolean direct=IlsFalse, IlsMvFile defaultVal=IlsMvFile()) const |
Returns the value contained in the object if that value is of type IlsMvFile . More... | |
IlsSvRef | asSvObjectRef (IlsBoolean direct=IlsFalse, IlsSvRef defaultVal=IlsSvRef()) const |
Returns the server object reference contained in the object if that value is of type IlsSvRef . More... | |
Comparison Operators | |
IlsBoolean | operator== (const IlsMvValue &) const |
Compares whether the value contained in the current object is equal to the value contained in the object passed as its parameter once this value has been converted to the current type. More... | |
IlsBoolean | operator!= (const IlsMvValue &) const |
Returns the inverse of the equality operator documented above. | |
IlsBoolean | operator< (const IlsMvValue &) const |
Compares whether the value contained in the current object is smaller than the value contained in the object passed as its parameter once converted to the current type. More... | |
IlsBoolean | operator> (const IlsMvValue &) const |
Compares whether the value contained in the current object is greater than the value contained in the object passed as its parameter once that value has been converted to the current type. More... | |
IlsBoolean | operator<= (const IlsMvValue &) const |
Compares whether the value contained in the current object is smaller than or equal to the value contained in the object passed as its parameter once that value has been converted to the current type. More... | |
IlsBoolean | operator>= (const IlsMvValue &) const |
Compares whether the value contained in the current object is greater than or equal to the value contained in the object passed as its parameter once converted to the current type. More... | |
IlsBoolean | operator! () const |
Negation operator. More... | |
Accessors and Tests | |
IlsBoolean | isVoid () const |
Returns IlsTrue if there is no value contained. | |
IlsBoolean | isBoolean () const |
Returns IlsTrue if no value is contained in the object. | |
IlsBoolean | isChar () const |
Returns IlsTrue if the value contained in the object is of type char . | |
IlsBoolean | isLong () const |
Returns IlsTrue if the value contained in the object is of type long . | |
IlsBoolean | isFloat () const |
Returns IlsTrue if the value contained in the object is of type float . | |
IlsBoolean | isDouble () const |
Returns IlsTrue if the value contained in the object is of type double . | |
IlsBoolean | isString () const |
Returns IlsTrue if the value contained in the object is a character string. | |
IlsBoolean | isSvRef () const |
Returns IlsTrue if the value contained in the object is a reference to a server object. | |
IlsBoolean | isRef () const |
Returns IlsTrue if the value contained in the object is a reference to a representation object. | |
IlsBoolean | isHRef () const |
Returns IlsTrue if the value contained in the object is a hyper reference to a representation object. | |
IlsBoolean | isUserValue () const |
Returns IlsTrue if the value contained in the object is a pointer to an object that derives from IlsMvUserType . | |
IlsBoolean | isFile () const |
Returns IlsTrue if the value contained in the object is a file. | |
IlsMvDataType | getType () const |
Returns the type of the value contained in the object. | |
Friends | |
Insertion and Extraction Operators | |
ILSIMPORT_MVSVR IlsMvMessage & | operator<< (IlsMvMessage &, const IlsMvValue &) |
Inserts an IlsMvValue into an IlsMvMessage used to exchange information between the server and the application components. More... | |
ILSIMPORT_MVSVR IlsMvMessage & | operator>> (IlsMvMessage &, IlsMvValue &) |
Extracts an IlsMvValue from an IlsMvMessage . More... | |
This class encapsulates the value of the runtime attributes attached to representation objects.
Library: mvserver
and mvcomp
The Rogue Wave Server internal protocol uses this class to transmit attribute values between an object server and an application component. Values of type IlsMvValue
are also passed as parameters to the virtual callbacks to member functions in class IlsRpObject
and to the function IlsMvComponent::execUserAsyncCallback()
.
IlsMvComponent
, IlsMvUserType
, IlsRpAttrModel
, IlsRpObject
. IlsMvValue::IlsMvValue | ( | const IlsMvValue & | val | ) |
Copy constructor.
If the object contains a pointer to an IlsMvUserType
, the IlsMvUserType
instance is shared between the two IlsMvValues and its reference counter is increased.
IlsBoolean IlsMvValue::asBoolean | ( | IlsBoolean | direct = IlsFalse , |
IlsBoolean | defaultVal = 0 |
||
) | const |
Returns the value contained in the object if that value is a IlsBoolean
type.
Otherwise, it returns defaultVal
if the direct
argument is set to IlsTrue
. If this argument is set to IlsFalse
, the operator returns IlsTrue
if:
IlsAny
and different from 0.IlsMvRef
and different from 0.If the value is of type IlsMvUserType*
, it returns:
IlsMvUserType::asBoolean()
applied to the pointed object. char IlsMvValue::asChar | ( | IlsBoolean | direct = IlsFalse , |
char | defaultVal = 0 |
||
) | const |
Returns the value contained in the object if that value is a character.
Otherwise, if the direct
argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
char
if it is a Boolean or a numeric value.If the value is of type IlsMvUserType*
, it returns:
defaultVal
if there is no value contained in the object.double IlsMvValue::asDouble | ( | IlsBoolean | direct = IlsFalse , |
double | defaultVal = 0.0 |
||
) | const |
Returns the value contained in the object if that value is of type double
.
Otherwise, if the direct
argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
If the value is of type IlsMvUserType*
, it returns:
defaultVal
if there is no value contained in the object.IlsMvFile IlsMvValue::asFile | ( | IlsBoolean | direct = IlsFalse , |
IlsMvFile | defaultVal = IlsMvFile() |
||
) | const |
Returns the value contained in the object if that value is of type IlsMvFile
.
The value returned by this conversion operator varies as follows:
float IlsMvValue::asFloat | ( | IlsBoolean | direct = IlsFalse , |
float | defaultVal = 0.0 |
||
) | const |
Returns the value contained in the object if that value is of type float
.
Otherwise, if the direct
argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
If the value is of type IlsMvUserType*
, it returns:
defaultVal
if there is no value contained in the object.long IlsMvValue::asLong | ( | IlsBoolean | direct = IlsFalse , |
long | defaultVal = 0 |
||
) | const |
Returns the value contained in the object if that value is a long integer.
Otherwise, if the direct
argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
If the value is of type IlsMvUserType*
, it returns:
defaultVal
if there is no value contained in the object.IlsMvRef IlsMvValue::asObjectRef | ( | IlsBoolean | direct = IlsFalse , |
IlsMvRef | defaultVal = IlsMvRef() |
||
) | const |
Returns the value contained in the object if that value is of type IlsMvRef
.
Otherwise, if the direct argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
IlsMvUserType::asObjectRef()
applied to the pointed object.IlsString IlsMvValue::asString | ( | IlsBoolean | direct = IlsFalse , |
IlsString | defaultVal = (char *) 0 |
||
) | const |
Returns the value contained in the object if that value is a character string.
Otherwise, if the direct
argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
IlsTrue
or IlsFalse
depending on the value;sprintf()
with the following formats:d
if it is an integer
,l
if it a long
,f
if it is a float
or a double
,xl
if it is an IlsAny
,IlsMvUserType::asString()
applied to the pointed object.IlsSvRef IlsMvValue::asSvObjectRef | ( | IlsBoolean | direct = IlsFalse , |
IlsSvRef | defaultVal = IlsSvRef() |
||
) | const |
Returns the server object reference contained in the object if that value is of type IlsSvRef
.
Otherwise, if the direct argument is set to IlsTrue
, it returns defaultVal
. If this argument is set to IlsFalse
, the operator returns:
IlsMvUserType::asObjectRef()
applied to the pointed object.IlsBoolean IlsMvValue::operator! | ( | ) | const |
Negation operator.
This operator returns IlsTrue
if the value contained in the object is different from 0. If the value is of type IlsMvUserType
*, the test returns IlsFalse
if the pointer is null. Otherwise, it returns the result of the operator IlsMvUserType::operator!()
that is applied to the pointed object.
IlsBoolean IlsMvValue::operator< | ( | const IlsMvValue & | ) | const |
Compares whether the value contained in the current object is smaller than the value contained in the object passed as its parameter once converted to the current type.
Character strings are compared according to the alphabetical order.
If both values are of type IlsMvUserType
*, the test returns IlsTrue
if both pointers are null or IlsFalse
if one of the two pointers is null. Otherwise, it returns the result of the operator IlsMvUserType::operator<()
that is applied to the pointed objects.
IlsBoolean IlsMvValue::operator<= | ( | const IlsMvValue & | ) | const |
Compares whether the value contained in the current object is smaller than or equal to the value contained in the object passed as its parameter once that value has been converted to the current type.
Character strings are compared according to the alphabetical order.
If both values are of type IlsMvUserType
*, the test returns IlsTrue
if both pointers are null or IlsFalse
if one of the two pointers is null. Otherwise, it returns the result of the operator IlsMvUserType::operator <=()
that is applied to the pointed objects.
IlsMvValue& IlsMvValue::operator= | ( | const IlsMvValue & | val | ) |
This operator assigns the value val to the object.
If the object contains a pointer to an IlsMvUserType
, the IlsMvUserType
instance is shared between the two IlsMvValue
s and its reference counter is increased.
IlsBoolean IlsMvValue::operator== | ( | const IlsMvValue & | ) | const |
Compares whether the value contained in the current object is equal to the value contained in the object passed as its parameter once this value has been converted to the current type.
If both values are of type IlsMvUserType
*, the test returns IlsTrue
if both pointers are null or IlsFalse
if one of the two pointers is null. Otherwise, it returns the result of the operator IlsMvUserType::operator==()
that is applied to the pointed objects.
IlsBoolean IlsMvValue::operator> | ( | const IlsMvValue & | ) | const |
Compares whether the value contained in the current object is greater than the value contained in the object passed as its parameter once that value has been converted to the current type.
Character strings are compared according to the alphabetical order.
If both values are of type IlsMvUserType
*, the test returns IlsTrue
if both pointers are null or IlsFalse
if one of the two pointers is null. Otherwise, it returns the result of the operator IlsMvUserType::operator>()
that is applied to the pointed objects.
IlsBoolean IlsMvValue::operator>= | ( | const IlsMvValue & | ) | const |
Compares whether the value contained in the current object is greater than or equal to the value contained in the object passed as its parameter once converted to the current type.
Character strings are compared according to the alphabetical order.
If both values are of type IlsMvUserType
*, the test returns IlsTrue
if both pointers are null or IlsFalse
if one of the two pointers is null. Otherwise, it returns the result of the operator IlsMvUserType::operator> =()
that is applied to the pointed objects.
|
friend |
Inserts an IlsMvValue
into an IlsMvMessage
used to exchange information between the server and the application components.
If the value contained in an IlsMvValue
is an instance of a subclass of IlsMvUserType
, the virtual member function IlsMvUserType::ilsEncode()
is executed to encode this instance.
|
friend |
Extracts an IlsMvValue
from an IlsMvMessage
.
If the value contained in an IlsMvValue
is an instance of a subclass of IlsMvUserType
, the static member function IlsMvUserType::ilsDecode()
is executed to encode this instance.