Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions

User-defined array class that inherits from IlsMvUserType. More...

#include <ilserver/mvarray.h>

Inheritance diagram for MvArray:
IlsMvUserType MvKeyValueTable

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...
 
IlsMvValueget (unsigned int index)
 Returns a reference to the value at the position specified by index in the array. More...
 
const IlsMvValueget (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...
 
MvArrayoperator= (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...
 
IlsMvValueoperator[] (unsigned int index)
 Returns a reference to the value corresponding to the specified index. More...
 
const IlsMvValueoperator[] (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 IlsMvUserTypeasValue (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 IlsLogfileprint (IlsLogfile &) const
 Called in trace mode to display a value whose type is user-defined. More...
 
virtual IlsMvMessageilsEncode (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 MvArrayNull ()
 Returns an empty MvArray.
 
- Static Public Member Functions inherited from IlsMvUserType
static IlsMvUserTypeIlsDecode (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.
 

Detailed Description

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.

See also
IlsMvArray, IlsMvValue, IlsString.

Constructor & Destructor Documentation

◆ MvArray()

MvArray::MvArray ( unsigned int  allocSize = 0)

Constructor with a default array size.

Parameters
allocSizeThe default size of the array.

Member Function Documentation

◆ add()

unsigned int MvArray::add ( const IlsMvValue v,
IlsBoolean  atEnd = IlsTrue 
)

Adds an element to the array.

Parameters
vThe element to be added.
atEndWhen set to IlsFalse, the element is not added to the end of the array but to the first free index.
Returns
The index of the added element.

◆ addNoCopy()

unsigned int MvArray::addNoCopy ( IlsMvValue v,
IlsBoolean  atEnd = IlsTrue 
)

Adds an element to the array without copying v.

Parameters
vThe element to be added.
atEndWhen set to IlsFalse, the element is not added to the end of the array but to the first free index.
Returns
The index of the added element.

◆ asString()

virtual IlsString MvArray::asString ( IlsString  defaultVal = (char *) 0) const
virtual

Returns this array as a string.

Parameters
defaultValThe default value if an error is encountered during string generation.
Returns
the array as a string

Reimplemented from IlsMvUserType.

◆ get() [1/2]

IlsMvValue& MvArray::get ( unsigned int  index)

Returns a reference to the value at the position specified by index in the array.

Parameters
indexindex in the array
Returns
reference to the value at the position specified by index

◆ get() [2/2]

const IlsMvValue& MvArray::get ( unsigned int  index) const

Returns a const reference to the value at the position specified by index in the array.

Parameters
indexindex in the array
Returns
const reference to the value at the position specified by index

◆ getIndex()

int MvArray::getIndex ( const IlsMvValue v) const

Returns the index of the specified value.

Parameters
vvalue
Returns
-1 if the specified value is not found.

◆ getMaxIndex()

int MvArray::getMaxIndex ( ) const

Returns the index of the last element in the array.

Returns
-1 if the array is empty.

◆ operator<<()

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.

◆ operator>>()

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.

◆ operator[]() [1/2]

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.

◆ operator[]() [2/2]

const IlsMvValue& MvArray::operator[] ( unsigned int  index) const

Returns a const reference to the value corresponding to the specified index.

Parameters
indexindex in the array
Returns
a void MvValue if the index is out of range

◆ remove()

void MvArray::remove ( int  index,
IlsBoolean  freeArray = IlsFalse 
)

Removes the value at the position specified by index from the array.

Parameters
indexThe index of the element to be removed.
freeArrayWhen set to IlsTrue, the contained values will be freed.

◆ reset()

void MvArray::reset ( IlsBoolean  freeArray = IlsFalse)

Sets the size of the array to 0.

Parameters
freeArrayWhen set to IlsTrue, the values contained in the array are freed.