IlsMvArray
 
IlsMvArray
Category 
Dynamic view-related class
Inheritance Path 
IlsMvUserType
IlsMvArray
Description 
This class is used to define arrays. As a user type, it can be sent from a server to a component or from a component to a server. As a user type, this type is also available under the name MvArray to be compliant with the JavaTM API naming conventions.
Libraries 
<mvserver> and <mvcomp>
Header File 
#include <ilserver/mvarray.h>
Synopsis 
class IlsMvArray : public IlsMvUserType {
public:
IlsMvArray(unsigned int allocSize=0);
IlsMvArray(const IlsMvArray&);
 
unsigned int add(const IlsMvValue& v,IlsBoolean atEnd=IlsTrue);
unsigned int addNoCopy(IlsMvValue& v,IlsBoolean atEnd=IlsTrue);
void reset(IlsBoolean freeArray=IlsFalse);
void remove(int index, IlsBoolean freeArray = IlsFalse);
virtual IlsString asString(IlsString defaultVal=(char*)0) const;
static const MvArray& Null();
Accessors
const IlsMvValue& get(unsigned int index) const;
IlsMvValue& get(unsigned int index);
int getIndex(const IlsMvValue&)const;
int getMaxIndex()const;
unsigned int getSize()const;
Operators
MvArray& operator =(const MvArray&);
IlsMvValue& operator [](unsigned int index);
const IlsMvValue& operator [](unsigned int index)const;
virtual IlsBoolean operator ==(const IlsMvUserType& v) const;
virtual IlsBoolean operator ==(const MvArray& v) const;
virtual IlsBoolean operator !=(const IlsMvUserType& v) const;
virtual IlsBoolean operator !=(const MvArray& v) const;
unsigned int operator <<(const IlsMvValue& v);
IlsBoolean operator >>(const IlsMvValue& v);
};
Constructors 
IlsMvArray(unsigned int allocSize=0);
This constructor creates an array with the default size allocSize.
IlsMvArray(const MvArray&);
This is a copy constructor.
Member Functions 
unsigned int add(const IlsMvValue& v,IlsBoolean atEnd=IlsTrue);
This member function adds an element to the array. The parameter v is the element to be added. When the parameter atEnd is set to IlsFalse, the element is not appended at the end of the array but at the first free index. This function returns the index of the added element.
unsigned int addNoCopy(IlsMvValue& v,IlsBoolean atEnd=IlsTrue);
This member function adds an element to the array without copying v. The parameter v is the element to be added. When the parameter atEnd is set to IlsFalse, the element is not appended at the end of the array but at the first free index.
void reset(IlsBoolean freeArray=IlsFalse);
This member function sets the size of the array to 0. When the freeArray parameter is set to IlsTrue, the values contained in the array are freed.
void remove(int index, IlsBoolean freeArray = IlsFalse);
This member function removes the value at the position specified by the index parameter from the array. When the freeArr parameter is set to IlsTrue, the contained values are freed.
[virtual] IlsString asString(IlsString defaultVal=(char*)0) const;
This virtual member function returns this array as a string. The defaultVal parameter is the default value when an error is encountered during string generation.
[static] const MvArray& Null();
This static member function returns an empty instance of MvArray.
Accessors
const IlsMvValue& get(unsigned int index) const;
This member function returns a const reference to the value at the position specified by the index parameter in the array.
IlsMvValue& get(unsigned int index);
This member function returns a const reference to the value at the position specified by the index argument in the array.
int getIndex(const IlsMvValue&)const;
This member function returns the index of the specified value, or -1 if the specified value is not found.
int getMaxIndex()const;
This member function returns the index of the last element in the array or -1 if the array is empty.
unsigned int getSize()const;
This member function returns the number of elements contained in the array.
Operators 
MvArray& operator =(const MvArray&);
This operator assigns an address to the handle pointer of the invoking array.
IlsMvValue& operator [](unsigned int index);
This operator resizes the array if the index argument is greater than the maximum index. This operator returns a reference to the value corresponding to the specified index.
const IlsMvValue& operator [](unsigned int index) const;
This operator returns a const reference to the value corresponding to the specified index. It returns an empty IlsMvValue if the value of the index argument is out of range.
[virtual] IlsBoolean operator ==(const IlsMvUserType& v) const;
[virtual] IlsBoolean operator ==(const MvArray& v) const;
These virtual operators return IlsTrue if and only if the argument v refers to the same implementation object as the invoking array.
[virtual] IlsBoolean operator !=(const IlsMvUserType& v) const;
[virtual] IlsBoolean operator !=(const MvArray& v) const;
These virtual operators return IlsTrue if and only if the argument v does not refer to the same implementation object as the invoking array.
unsigned int operator <<(const IlsMvValue& v);
This operator 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 operator >>(const IlsMvValue& v);
This operator removes the first occurrence of item from the array. It returns IlsTrue if the operation was successful; otherwise, it returns IlsFalse.
See Also 
IlsMvValue, IlsString

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