User-defined array class that inherits from IlsMvUserType.
More...
#include <ilserver/mvarray.h>
Public Member Functions | |
| MvArray (const MvArray &) | |
| Copy constructor. | |
| MvArray (unsigned int allocSize=0) | |
| Constructor with a default array size. More... | |
| ~MvArray () | |
| Destructor. | |
| unsigned int | add (const IlsMvValue &v, IlsBoolean atEnd=IlsTrue) |
| Adds an element to the array. More... | |
| unsigned int | addNoCopy (IlsMvValue &v, IlsBoolean atEnd=IlsTrue) |
| Adds an element to the array without copying v. More... | |
| virtual IlsString | asString (IlsString defaultVal=(char *) 0) const |
| Returns this array as a string. More... | |
| IlsMvValue & | get (unsigned int index) |
| Returns a reference to the value at the position specified by index in the array. More... | |
| const IlsMvValue & | get (unsigned int index) const |
| Returns a const reference to the value at the position specified by index in the array. More... | |
| int | getIndex (const IlsMvValue &v) const |
| Returns the index of the specified value. More... | |
| int | getMaxIndex () const |
| Returns the index of the last element in the array. More... | |
| unsigned int | getSize () const |
| Returns the number of elements contained in the array. | |
| virtual IlsBoolean | operator!= (const IlsMvUserType &v) const |
Returns IlsTrue if and only if v does not refer to the same implementation object as the invoking array. | |
| virtual IlsBoolean | operator!= (const MvArray &v) const |
Returns IlsTrue if and only if v does not refer to the same implementation object as the invoking array. | |
| unsigned int | operator<< (const IlsMvValue &v) |
| Adds an element at the end of the array and returns its index. More... | |
| MvArray & | operator= (const MvArray &) |
| Assigns an address to the handle pointer of the invoking array. | |
| virtual IlsBoolean | operator== (const IlsMvUserType &v) const |
Returns IlsTrue if and only if v refers to the same implementation object as the invoking array. | |
| virtual IlsBoolean | operator== (const MvArray &v) const |
Returns IlsTrue if and only if v refers to the same implementation object as the invoking array. | |
| IlsBoolean | operator>> (const IlsMvValue &v) |
| Removes the first occurrence of item from the array. More... | |
| IlsMvValue & | operator[] (unsigned int index) |
| Returns a reference to the value corresponding to the specified index. More... | |
| const IlsMvValue & | operator[] (unsigned int index) const |
| Returns a const reference to the value corresponding to the specified index. More... | |
| void | remove (int index, IlsBoolean freeArray=IlsFalse) |
| Removes the value at the position specified by index from the array. More... | |
| void | reset (IlsBoolean freeArray=IlsFalse) |
Sets the size of the array to 0. More... | |
Public Member Functions inherited from IlsMvUserType | |
| virtual | ~IlsMvUserType () |
| Virtual destructor. | |
| virtual IlsBoolean | asBoolean (IlsBoolean defaultVal=IlsFalse) const |
Called by IlsMvValue::asBoolean() when the instance of IlsMvValue to which it applies contains an object whose type is user-defined. More... | |
| virtual char | asChar (char defaultVal=0) const |
Called by IlsMvValue::asChar() when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. More... | |
| virtual long | asLong (long defaultVal=0) const |
Called by IlsMvValue::asLong() when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. More... | |
| virtual float | asFloat (float defaultVal=0.0) const |
Called by IlsMvValue::asFloat() when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. More... | |
| virtual double | asDouble (double defaultVal=0.0) const |
Called by IlsMvValue::asDouble() when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. More... | |
| virtual IlsMvRef | asObjectRef (IlsMvRef defaultVal=IlsMvRef()) const |
Called by IlsMvValue::asObjectRef() when the object of type IlsMvValue to which it applies contains an object whose type is user-defined. More... | |
| virtual IlsMvUserType * | asValue (IlsMvDataType typeId, IlsMvUserType *defaultVal=0) const |
| Called by Rogue Wave Server when it needs to convert a user type value into another user type. More... | |
| virtual IlsBoolean | operator< (const IlsMvUserType &) const |
Called by the operator IlsMvValue::operator<() when the object and the argument to which it applies contain user-defined type values. More... | |
| virtual IlsBoolean | operator> (const IlsMvUserType &) const |
Called by the operator IlsMvValue::operator>() when the object and the argument to which it applies contain user-defined type values. More... | |
| virtual IlsBoolean | operator<= (const IlsMvUserType &) const |
Called by the operator IlsMvValue::operator<=() when the object and the argument to which it applies contain user-defined type values. More... | |
| virtual IlsBoolean | operator>= (const IlsMvUserType &) const |
Called by the operator IlsMvValue::operator>=() when the object and the argument to which it applies contain user-defined type values. More... | |
| virtual IlsBoolean | operator! () const |
Called by the operator IlsMvValue::operator!() when the object and the argument to which it applies contain user-defined type values. More... | |
| virtual IlsLogfile & | print (IlsLogfile &) const |
| Called in trace mode to display a value whose type is user-defined. More... | |
| 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. More... | |
Static Public Member Functions | |
| static const MvArray & | Null () |
Returns an empty MvArray. | |
Static Public Member Functions inherited from IlsMvUserType | |
| static IlsMvUserType * | IlsDecode (IlsMvMessage &) |
| This static member function is called by Server to extract a user-type value from a message. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from IlsMvUserType | |
| IlsMvUserType () | |
| The default constructor of the class is protected. | |
User-defined array class that inherits from IlsMvUserType.
Library: mvserver
and mvcomp
This class is used to define arrays. It can be transmitted accross Rogue Wave Server components.
As a user type, this type typedefed to IlsMvArray is available under the name MvArray to be compliant with the Java API naming conventions.
IlsMvArray, IlsMvValue, IlsString. | MvArray::MvArray | ( | unsigned int | allocSize = 0 | ) |
Constructor with a default array size.
| allocSize | The default size of the array. |
| unsigned int MvArray::add | ( | const IlsMvValue & | v, |
| IlsBoolean | atEnd = IlsTrue |
||
| ) |
Adds an element to the array.
| v | The element to be added. |
| atEnd | When set to IlsFalse, the element is not added to the end of the array but to the first free index. |
| unsigned int MvArray::addNoCopy | ( | IlsMvValue & | v, |
| IlsBoolean | atEnd = IlsTrue |
||
| ) |
Adds an element to the array without copying v.
| v | The element to be added. |
| atEnd | When set to IlsFalse, the element is not added to the end of the array but to the first free index. |
Returns this array as a string.
| defaultVal | The default value if an error is encountered during string generation. |
Reimplemented from IlsMvUserType.
| IlsMvValue& MvArray::get | ( | unsigned int | index | ) |
Returns a reference to the value at the position specified by index in the array.
| index | index in the array |
| const IlsMvValue& MvArray::get | ( | unsigned int | index | ) | const |
Returns a const reference to the value at the position specified by index in the array.
| index | index in the array |
| int MvArray::getIndex | ( | const IlsMvValue & | v | ) | const |
Returns the index of the specified value.
| v | value |
-1 if the specified value is not found. | int MvArray::getMaxIndex | ( | ) | const |
Returns the index of the last element in the array.
-1 if the array is empty. | unsigned int MvArray::operator<< | ( | const IlsMvValue & | v | ) |
Adds an element at the end of the array and returns its index.
The element can be of any type inheriting from IlsMvValue, such as IlsString.
| IlsBoolean MvArray::operator>> | ( | const IlsMvValue & | v | ) |
Removes the first occurrence of item from the array.
It returns IlsTrue if the operation was successful; otherwise, it returns IlsFalse.
| IlsMvValue& MvArray::operator[] | ( | unsigned int | index | ) |
Returns a reference to the value corresponding to the specified index.
It resizes the array if the index is greater than the maximum index.
| const IlsMvValue& MvArray::operator[] | ( | unsigned int | index | ) | const |
Returns a const reference to the value corresponding to the specified index.
| index | index in the array |
| void MvArray::remove | ( | int | index, |
| IlsBoolean | freeArray = IlsFalse |
||
| ) |
Removes the value at the position specified by index from the array.
| index | The index of the element to be removed. |
| freeArray | When set to IlsTrue, the contained values will be freed. |
| void MvArray::reset | ( | IlsBoolean | freeArray = IlsFalse | ) |
Sets the size of the array to 0.
| freeArray | When set to IlsTrue, the values contained in the array are freed. |