Server
API Reference Guide
Product Documentation:

Rogue Wave Server
Documentation Home
List of all members | Public Member Functions | Static Public Member Functions
MvKeyValueTable Class Reference

A key-value table class that can be transmited accross Rogue Wave Server components. More...

#include <ilserver/mvarray.h>

Inheritance diagram for MvKeyValueTable:
MvArray IlsMvUserType

Public Member Functions

 MvKeyValueTable ()
 Default constructor.
 
 MvKeyValueTable (const MvArray &orig)
 Constructor. More...
 
 MvKeyValueTable (const MvKeyValueTable &orig)
 Copy constructor.
 
IlsBoolean addItem (const IlsMvValue &key, const IlsMvValue &value)
 Adds a key-value association to the table. More...
 
int getItemIndex (const IlsMvValue &key) const
 Retrieves the index of the item that corresponds to the specified key.
 
const IlsMvValuegetItemValue (const IlsMvValue &key) const
 Retrieves the value of the item that corresponds to the specified key.
 
const IlsMvValuegetKey (unsigned int index) const
 Returns the key corresponding to the specified index.
 
const IlsMvValuegetValue (unsigned int index) const
 Returns the value corresponding to the specified index.
 
IlsBoolean hasItem (const IlsMvValue &key) const
 Returns IlsTrue if there is an association with the key in the table.
 
IlsBoolean removeItem (const IlsMvValue &key)
 Removes the association with the key from the table. More...
 
IlsBoolean setItemValue (const IlsMvValue &key, const IlsMvValue &value)
 Sets the specified key to the specified value. More...
 
- Public Member Functions inherited from MvArray
 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 MvKeyValueTableNull ()
 Returns an empty table.
 
- Static Public Member Functions inherited from MvArray
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

A key-value table class that can be transmited accross Rogue Wave Server components.

Library: mvserver
and mvcomp

This class associates a key with a value.The key and value are of the IlsMvValue type, thus allowing you to use this class in a wide variety of cases. All C++ basic types can be used for key and value. The IlsString, MvArray, and even MvKeyValueTable classes can also be used.

Constructor & Destructor Documentation

◆ MvKeyValueTable()

MvKeyValueTable::MvKeyValueTable ( const MvArray orig)

Constructor.

This constructor initializes the MvKeyValueTable instance with MvArray objects.

Parameters
origTo work properly as a key-value table, this instance of MvArray must contain items that are arrays made up of two items (a key and a value).

Member Function Documentation

◆ addItem()

IlsBoolean MvKeyValueTable::addItem ( const IlsMvValue key,
const IlsMvValue value 
)

Adds a key-value association to the table.

Returns
Returns IlsFalse if the key is already used in the table.

◆ removeItem()

IlsBoolean MvKeyValueTable::removeItem ( const IlsMvValue key)

Removes the association with the key from the table.

Returns
Returns IlsTrue if the association was in the table.

◆ setItemValue()

IlsBoolean MvKeyValueTable::setItemValue ( const IlsMvValue key,
const IlsMvValue value 
)

Sets the specified key to the specified value.

Returns
IlsTrue if the key is already in the table.