- Attribute value list class
#include <ECS/AttrValueList.hh>
class ECS_AttrValueList
{
public:
_ECSAIO_PRIVAPI ECS_AttrValueList();
_ECSAIO_PRIVAPI ECS_AttrValueList(int32 length);
_ECSAIO_PRIVAPI ECS_AttrValueList(ECS_AttrValueList const& other);
ECS_AttrValueList const& operator=(ECS_AttrValueList const& other);
_ECSAIO_PRIVAPI virtual ~ECS_AttrValueList();
virtual ostream& print(ostream& os) const;
_ECSAIO_PRIVAPI int32 size() const;
_ECSAIO_PRIVAPI EV_AttrType typeOfNthItem(int32 index) const;
_ECSAIO_PRIVAPI const int32* getInteger(int32 index) const;
_ECSAIO_PRIVAPI const real64* getReal(int32 index) const;
_ECSAIO_PRIVAPI const bool* getBool(int32 index) const;
_ECSAIO_PRIVAPI const EV_Time* getTime(int32 index) const;
_ECSAIO_PRIVAPI const EV_Duration* getDuration(int32 index) const;
_ECSAIO_PRIVAPI const char* getString(int32 index) const;
_ECSAIO_PRIVAPI const u_int32* getOid(int32 index) const;
_ECSAIO_PRIVAPI int32 getOidLength(int32 index) const;
_ECSAIO_PRIVAPI ECS_AttrValueList getList(int32 index) const;
_ECSAIO_PRIVAPI ECS_AttrValueList getTuple(int32 index) const;
_ECSAIO_PRIVAPI int32 setValue(int32 index, int32 value);
_ECSAIO_PRIVAPI int32 setValue(int32 index, real64 value);
_ECSAIO_PRIVAPI int32 setBooleanValue(int32 index, bool value);
_ECSAIO_PRIVAPI int32 setValue(int32 index, const EV_Time& value);
_ECSAIO_PRIVAPI int32 setValue
(
int32 index,
const EV_Duration& value
);
_ECSAIO_PRIVAPI int32 setValue(int32 index, const char* value);
_ECSAIO_PRIVAPI int32 setValue
(
int32 index,
const u_int32*& oid,
int32 oidLength
);
_ECSAIO_PRIVAPI int32 setNullValue(int32 index);
_ECSAIO_PRIVAPI int32 setListValue
(
int32 index,
ECS_AttrValueList& value
);
_ECSAIO_PRIVAPI int32 setTupleValue
(
int32 index,
ECS_AttrValueList& value
);
protected:
ECS_AttrValueList(const EV_AttrValue& data);
const EV_AttrValue* getData() const;
void setData(EV_AttrValue* data);
};
Concrete
ECS Application Developers
This is an attribute value list class. Instances of this class can contain an ordered heterogeneous collection of data. This class provides type safe methods for access to that data.
The index of the first item in the list or tuple is 1.
The getValue methods require that the correct method for the type being accessed be called. This can be determined using the typeOfNthItem() method. All get methods return const pointers to internal storage. This storage must not be deleted. If the index is not valid or the item is not of the correct type 0 will be returned.
The setValue methods will determine the type of the item being set from the type of the value passed in. Where this is not possible (e.g. list or tuple), type-specific variants of the method must be used (e.g. setListvalue(), setTupleValue()).
If the index specified is beyond the end of the list, then items of type EV_NULL will be inserted in all the intermediate locations and the value will be inserted at the specified index.
_ECSAIO_PRIVAPI ECS_AttrValueList();
This constructs an empty list.
_ECSAIO_PRIVAPI ECS_AttrValueList(int32 length);
Note: Every element of the tuple must be initialized using setValue() calls. If this is not done, then attempts to copy or otherwise use the tuple will fail.
_ECSAIO_PRIVAPI ECS_AttrValueList(ECS_AttrValueList const& other);
ECS_AttrValueList const& operator=(ECS_AttrValueList const& other);
_ECSAIO_PRIVAPI virtual ~ECS_AttrValueList();
virtual ostream& print(ostream& os) const;
os.
These methods provide access to the contents of the list or tuple.
_ECSAIO_PRIVAPI int32 size() const;
_ECSAIO_PRIVAPI EV_AttrType typeOfNthItem(int32 index) const;
EV_NONE is returned.
_ECSAIO_PRIVAPI const int32* getInteger(int32 index) const;
If the index is not valid or the value at the specified index is not an integer then 0 is returned.
_ECSAIO_PRIVAPI const real64* getReal(int32 index) const;
If the index is not valid or the value at the specified index is not a real number then 0 is returned.
_ECSAIO_PRIVAPI const bool* getBool(int32 index) const;
If the index is not valid or the value at the specified index is not a Boolean then 0 is returned.
_ECSAIO_PRIVAPI const EV_Time* getTime(int32 index) const;
If the index is not valid or the value at the specified index is not a time then 0 is returned.
_ECSAIO_PRIVAPI const EV_Duration* getDuration(int32 index) const;
If the index is not valid or the value at the specified index is not a duration then 0 is returned.
_ECSAIO_PRIVAPI const char* getString(int32 index) const;
If the index is not valid or the value at the specified index is not a string then 0 is returned.
_ECSAIO_PRIVAPI const u_int32* getOid(int32 index) const;
If the index is not valid or the value at the specified index is not an object identifier then 0 is returned.
The method getOidLength must be used to determine the number of elements in the oid.
_ECSAIO_PRIVAPI int32 getOidLength(int32 index) const;
If the index is not valid or the value at the specified index is not an object identifier then -1 is returned.
_ECSAIO_PRIVAPI ECS_AttrValueList getList(int32 index) const;
If the index is not valid or the value at the specified index is not a list then the list returned will have a size of 0.
_ECSAIO_PRIVAPI ECS_AttrValueList getTuple(int32 index) const;
If the index is not valid or the value at the specified index is not a tuple then the list returned will have a size of 0.
_ECSAIO_PRIVAPI int32 setValue(int32 index, int32 value);
_ECSAIO_PRIVAPI int32 setValue(int32 index, real64 value);
_ECSAIO_PRIVAPI int32 setBooleanValue(int32 index, bool value);
_ECSAIO_PRIVAPI int32 setValue(int32 index, const EV_Time& value);
_ECSAIO_PRIVAPI int32 setValue(int32 index, const EV_Duration& value);
_ECSAIO_PRIVAPI int32 setValue(int32 index, const char* value);
_ECSAIO_PRIVAPI int32 setValue
(
int32 index,
const u_int32*& oid,
int32 oidLength
);
_ECSAIO_PRIVAPI int32 setNullValue(int32 index);
_ECSAIO_PRIVAPI int32 setListValue
(
int32 index,
ECS_AttrValueList& value
);
_ECSAIO_PRIVAPI int32 setTupleValue
(
int32 index,
ECS_AttrValueList& value
);
None
None
ECS
1.5
1998/04/03
Hewlett-Packard Company
Copyright (c) 1997 Hewlett-Packard Company. All Rights Reserved.