IlsMvUserType
 
IlsMvUserType
Category 
Dynamic view-related type
Inheritance Path 
IlsMvUserType
Description 
This class is the base class for all user-defined types. It enables you to assign such types to runtime attributes of server object types or to runtime attributes of representation object types. See the macro ILS_USERTYPE_DECL/ILS_USERTYPE_DEF for details on how to declare such a type.
This class also lets you pass values of any types to functions that take the type IlsMvValue as a parameter, such as the virtual callbacks to member functions in the IlsRpObject class and the function IlsMvComponent::execUserAsyncCallback.
Libraries 
<mvserver> and <mvcomp>
Header File 
#include <ilserver/mvvalue.h>
Synopsis 
class IlsMvUserType {
protected:
IlsMvUserType(){}
public:
virtual ~IlsMvUserType(){}
Controlled Conversion
virtual IlsBoolean asBoolean
(IlsBoolean defaultVal=IlsFalse) const;
virtual char asChar(char defaultVal=0) const;
virtual long asLong(long defaultVal=0) const;
virtual float asFloat(float defaultVal=0.0) const;
virtual double asDouble(double defaultVal=0.0) const;
virtual IlsString asString
(IlsString defaultVal=(char*)0) const;
virtual IlsMvRef asObjectRef
(IlsMvRef defaultVal=(IlsRpObjectId)0) const;
virtual IlsMvUserType* asValue(IlsMvDataType typeId,
IlsMvUserType* defaultVal=0) const ;
Comparison Operators
virtual IlsBoolean operator ==(const IlsMvUserType& v) const;
virtual IlsBoolean operator !=(const IlsMvUserType& v) const;
virtual IlsBoolean operator <(const IlsMvUserType&) const;
virtual IlsBoolean operator >(const IlsMvUserType&) const;
virtual IlsBoolean operator <=(const IlsMvUserType&) const;
virtual IlsBoolean operator >=(const IlsMvUserType&) const;
virtual IlsBoolean operator !() const;
Unparsing
virtual IlsLogfile& print(IlsLogfile&) const;
Encoding/Decoding
virtual IlsMvMessage& ilsEncode(IlsMvMessage&)const=0;
static IlsMvUserType* IlsDecode(IlsMvMessage&);
};
Constructor 
IlsMvUserType();
The default constructor of the class is protected.
Destructor 
virtual ~IlsMvUserType()
The destructor of the class is virtual.
Member Functions 
Controlled Conversion
[virtual] IlsBoolean asBoolean(IlsBoolean defaultVal=IlsFalse) const;
This virtual member function is called by IlsMvValue::asBoolean when the instance of IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] char asChar(char defaultVal=0) const;
This virtual member function is called by IlsMvValue::asChar when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] long asLong(long defaultVal=0) const;
This virtual member function is called by IlsMvValue::asLong when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] float asFloat(float defaultVal=0.0) const;
This virtual member function is called by IlsMvValue::asFloat when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] double asDouble(double defaultVal=0.0) const;
This virtual member function is called by IlsMvValue::asDouble when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] IlsString asString(IlsString defaultVal=(char*)0) const;
This virtual member function is called by IlsMvValue::asString when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] IlsMvRef asObjectRef(IlsMvRef defaultVal=(IlsRpObjectId)0) const;
This virtual member function is called by IlsMvValue::asObjectRef when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. It returns defaultVal. It can be overridden.
[virtual] IlsMvUserType* asValue(IlsMvDataType typeId,
IlsMvUserType* defaultVal=0) const;
This virtual member function is called by Rogue Wave Server when it needs to convert a user type value into another user type. This function returns the null pointer but can be overridden.
Unparsing
[virtual] IlsLogfile& print(IlsLogfile&) const;
This virtual member function is called in trace mode to display a value whose type is user-defined. It as no effect. but can be overridden.
Encoding/Decoding
[virtual] IlsMvMessage& ilsEncode(IlsMvMessage&)const=0;
This pure virtual member function is called to encode a value whose type is user-defined in an instance of IlsMvMessage. It must be overridden. Declaring the macro ILS_USERTYPE_DECL in a derived class implicitly overrides this member function.
[static] IlsMvUserType* IlsDecode(IlsMvMessage&);
This static member function is called by Server to extract a user-type value from a message. It first extracts the name of the user type, then looks for a decoding function declared for this type. This decoding function is implicitly declared by the macro ILS_USERTYPE_DEF associated with each user type deriving from IlsMvUserType. If the decoding function is found, it is used to extract the user type value.Otherwise, the message is assigned with the failure status (see IlsMvMessage::setFail).
This function returns the message.
Comparison Operators
[virtual] IlsBoolean operator ==(const IlsMvUserType& v) const;
This virtual operator is called by the operator IlsMvValue::operator == when the object and the argument to which it applies contain user-defined type values. It returns IlsFalse and can be overridden.
[virtual] IlsBoolean operator !=(const IlsMvUserType& v) const;
This virtual operator is called by the operator IlsMvValue::operator != when the object and the argument to which it applies contain user-defined type values. It returns IlsTrue and can be overridden.
[virtual] IlsBoolean operator <(const IlsMvUserType&) const;
This virtual operator is called by the operator IlsMvValue::operator < when the object and the argument to which it applies contain user-defined type values. It returns IlsFalse and can be overridden.
[virtual] IlsBoolean operator >(const IlsMvUserType&) const;
This virtual operator is called by the operator IlsMvValue::operator > when the object and the argument to which it applies contain user-defined type values. It returns IlsFalse and can be overridden.
[virtual] IlsBoolean operator <=(const IlsMvUserType&) const;
This virtual operator is called by the operator IlsMvValue::operator <= when the object and the argument to which it applies contain user-defined type values. It returns IlsFalse and can be overridden.
[virtual] IlsBoolean operator >=(const IlsMvUserType&) const;
This virtual operator is called by the operator IlsMvValue::operator <= when the object and the argument to which it applies contain user-defined type values. It returns IlsFalse and can be overridden.
[virtual] IlsBoolean operator !() const;
This virtual operator is called by the operator IlsMvValue::operator != when the object and the argument to which it applies contain user-defined type values. It returns IlsTrue and can be overridden.
See Also 
IlsMvComponent, IlsMvMessage, IlsMvValue, IlsRpObject, ILS_USERTYPE_DECL/ILS_USERTYPE_DEF

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.