BAttributes Class Reference

#include <BAttributes.h>

Inheritance diagram for BAttributes:

Inheritance graph
[legend]

List of all members.


Detailed Description

A collection of BAttribute objects.

Public Member Functions

void Add (const BAttribute &attr)
 Adds a BAttribute to this BAttributes.
void Add (const BString &name, const BVariant &val)
 Adds a BAttribute to this BAttributes.
 BAttributes (const BAttributes &attrs)
 Copy constructor.
 BAttributes ()
 Default constructor, which creates an empty collection.
void Clear (void)
 Removes all BAttribute objects from this BAttributes.
virtual size_t ComputeSize (void) const
 Computes the size of the BByteArray required to store this object.
virtual void FromByteArray (const BByteArray &bytes, size_t &startPos)
 Initializes an instance of this object from a BByteArray.
const BVariantGet (const BString &name) const
 Gets the value of the BAttribute with the specified name in this BAttributes.
BVariantGet (const BString &name)
 Gets the value of the BAttribute with the specified name in this BAttributes.
BAttributeGetAt (size_t index)
 Gets the BAttribute at the specified index in this BAttributes.
const BAttributeGetAt (size_t index) const
 Gets the BAttribute at the specified index in this BAttributes.
size_t GetCount (void) const
 Gets the number of BAttribute objects in this BAttributes.
BString GetNameAt (size_t index) const
 Gets the name of the BAttribute at the specified index in this BAttributes.
BVariantGetValueAt (size_t index)
 Gets the value of the BAttribute at the specified index in this BAttributes.
const BVariantGetValueAt (size_t index) const
 Gets the value of the BAttribute at the specified index in this BAttributes.
bool HasAttribute (const BAttribute &attr) const
 Indicates whether or not this BAttributes contains the specified BAttribute.
bool HasAttribute (const BString &name, const BVariant &val) const
 Indicates whether or not this BAttributes contains a BAttribute with the specified name and the specified value.
bool HasAttribute (const BString &name) const
 Indicates whether or not this BAttributes contains a BAttribute with the specified name.
BAttributesoperator= (const BAttributes &rhs)
 Assignment operator.
void Remove (size_t index)
 Remove a BAttribute from this collection.
void Remove (const BString &name)
 Remove a BAttribute from this collection.
void Reserve (size_t size)
 Reserves space in the collection for the specified number of objects.
void SetReadCache (bool val)
virtual BByteArray ToByteArray (void) const
 Stores this object in a BByteArray.
virtual ~BAttributes ()
 Destructor.

Constructor & Destructor Documentation

BAttributes (  )  [inline]

Default constructor, which creates an empty collection.

BAttributes ( const BAttributes attrs  ) 

Copy constructor.

Parameters:
attrs The BAttributes object to copy.

virtual ~BAttributes (  )  [inline, virtual]

Destructor.


Member Function Documentation

void Add ( const BAttribute attr  ) 

Adds a BAttribute to this BAttributes.

Parameters:
attr The BAttribute to be added.

void Add ( const BString name,
const BVariant val 
)

Adds a BAttribute to this BAttributes.

A new BAttribute will be constructed with the specified name and value.

Parameters:
name The name of the BAttribute.
val The value of the BAttribute.

void Clear ( void   )  [inline]

Removes all BAttribute objects from this BAttributes.

virtual size_t ComputeSize ( void   )  const [virtual]

Computes the size of the BByteArray required to store this object.

Returns:
The size of the BByteArray.

Implements BByteStreamable.

virtual void FromByteArray ( const BByteArray bytes,
size_t &  startPos 
) [virtual]

Initializes an instance of this object from a BByteArray.

Parameters:
bytes The BByteArray containing the byte representation for this object.
startPos The position in the BByteArray where the byte representation begins. This value will be updated to point to the byte past the end of this object in the byte array.

Implements BByteStreamable.

const BVariant& Get ( const BString name  )  const

Gets the value of the BAttribute with the specified name in this BAttributes.

Parameters:
name The name of the desired BAttribute value.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute with the specified name in this BAttributes.

BVariant& Get ( const BString name  ) 

Gets the value of the BAttribute with the specified name in this BAttributes.

Parameters:
name The name of the desired BAttribute value.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute with the specified name in this BAttributes.

BAttribute& GetAt ( size_t  index  ) 

Gets the BAttribute at the specified index in this BAttributes.

Parameters:
index The zero-based index of the desired BAttribute.
Returns:
The BAttribute at the specified index in this BAttributes.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute at the specified index in this BAttributes.

const BAttribute& GetAt ( size_t  index  )  const

Gets the BAttribute at the specified index in this BAttributes.

Parameters:
index The zero-based index of the desired BAttribute.
Returns:
The BAttribute at the specified index in this BAttributes.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute at the specified index in this BAttributes.

size_t GetCount ( void   )  const [inline]

Gets the number of BAttribute objects in this BAttributes.

Returns:
The number of BAttribute objects in this collection.

BString GetNameAt ( size_t  index  )  const

Gets the name of the BAttribute at the specified index in this BAttributes.

Parameters:
index The zero-based index of the desired BAttribute name.
Returns:
The name of the BAttribute at the specified index in this BAttributes.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute at the specified index in this BAttributes.

BVariant& GetValueAt ( size_t  index  )  [inline]

Gets the value of the BAttribute at the specified index in this BAttributes.

Parameters:
index The zero-based index of the desired BAttribute value.
Returns:
The value of the BAttribute at the specified index in this BAttributes.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute at the specified index in this BAttributes.

const BVariant& GetValueAt ( size_t  index  )  const [inline]

Gets the value of the BAttribute at the specified index in this BAttributes.

Parameters:
index The zero-based index of the desired BAttribute value.
Returns:
The value of the BAttribute at the specified index in this BAttributes.
Exceptions:
BAttributeDataException This exception will be thrown if there does not exist a BAttribute at the specified index in this BAttributes.

bool HasAttribute ( const BAttribute attr  )  const

Indicates whether or not this BAttributes contains the specified BAttribute.

Parameters:
attr The BAttribute to check for containment.
Returns:
True if this BAttributes contains the specified BAttribute and false otherwise.

bool HasAttribute ( const BString name,
const BVariant val 
) const

Indicates whether or not this BAttributes contains a BAttribute with the specified name and the specified value.

Parameters:
name The name to check for containment.
val The value to check for containment.
Returns:
True if this BAttributes contains a BAttribute with the specified name and value and false otherwise.

bool HasAttribute ( const BString name  )  const

Indicates whether or not this BAttributes contains a BAttribute with the specified name.

Parameters:
name The name to check for containment.
Returns:
True if this BAttributes contains a BAttribute with the specified name and false otherwise.

BAttributes& operator= ( const BAttributes rhs  )  [inline]

Assignment operator.

Parameters:
rhs The BAttributes whose value will be copied into this one.
Returns:
A reference to this BAttributes object.

void Remove ( size_t  index  ) 

Remove a BAttribute from this collection.

If there does not exist a BAttribute at the specified index in this BAttributes, an exception will be thrown.

Parameters:
index The zero-based index of BAttribute to be removed.
Exceptions:
BAttributeDataException This exception will be thrown if the specified index does not correspond to an element in this BAttributes collection.

void Remove ( const BString name  ) 

Remove a BAttribute from this collection.

If there does not exist a BAttribute in this BAttributes with the specified name, then this BAttributes will not be changed.

Parameters:
name The name of the BAttribute to be removed.

void Reserve ( size_t  size  )  [inline]

Reserves space in the collection for the specified number of objects.

Parameters:
size The number of objects to reserve space for.

void SetReadCache ( bool  val  )  [inline]

virtual BByteArray ToByteArray ( void   )  const [virtual]

Stores this object in a BByteArray.

Returns:
A BByteArray that stores the contents of this object.

Implements BByteStreamable.


The documentation for this class was generated from the following file:

GeoTranslate 5.0 From Blue Marble Geographics