IT_Bus::ArrayT< T > Class Template Reference

#include <it_bus/array_t.h>

Inheritance diagram for IT_Bus::ArrayT< T >:

IT_Bus::SequenceComplexType IT_Bus::ComplexType IT_Bus::AnyType IT_Bus::ImplementationDetails List of all members.

Detailed Description

template<typename T>
class IT_Bus::ArrayT< T >

Array implementation template class.

An array is the C++ representation used for the following XML schema:

      <xsd:complexType name="MyArray">
          <xsd:sequence>
              <xsd:element name="item" type="xsd:int" minOccurs="0"
                              maxOccurs="unbounded"/>
          </xsd:sequence>
      </xsd:complexType>
 

An array supports the same operations as a vector and can be treated as such. It may also be implicitly cast to a vector. When created using the default constructor the array will have zero elements rather than MIN_OCCURS element.

Note that specifying a non-existent (index >= size()) element using the subscript operator has undefined behaviour.

Definition at line 35 of file array_t.h.

Public Member Functions

 ArrayT ()
 Default constructor.
 operator const IT_Vector () const
 Cast operator to obtain array as a const vector.
 operator IT_Vector ()
 Cast operator to obtain array as a vector.
IT_Vector< T >::ConstReference operator[] (const size_t pos) const
 Returns a const reference to the specified element in the array.
IT_Vector< T >::Reference operator[] (const size_t pos)
 Returns a reference to the specified element in the array.
IT_Vector< T >::Iterator begin ()
 Returns an iterator that references the beginning of the array.
IT_Vector< T >::ConstIterator begin () const
 Returns a const iterator that references the beginning of the array.
IT_Vector< T >::Iterator end ()
 Returns an iterator that references a position past the end of the array.
IT_Vector< T >::ConstIterator end () const
 Returns a const iterator that references a position past the end of the array.
IT_Vector< T >::ReverseIterator rbegin ()
 Returns a reverse iterator which points to the last element in the array.
IT_Vector< T >::ConstReverseIterator rbegin () const
 Returns a const reverse iterator which points to the last element in the array.
IT_Vector< T >::ReverseIterator rend ()
 Returns a reverse iterator which points to just past the first element in the array.
IT_Vector< T >::ConstReverseIterator rend () const
 Returns a const reverse iterator which points to just past the first element in the array.
IT_Vector< T >::SizeType size () const
 Returns the number of items (elements) currently stored in the array.
IT_Vector< T >::SizeType get_size () const
 Returns the number of items (elements) currently stored in the array.
void set_size (typename IT_Vector< T >::SizeType sz)
 Sets the number of items (elements) currently stored in the array.
IT_Vector< T >::SizeType capacity () const
IT_Bool empty () const
 Returns a true value if the number of elements is zero, false otherwise.
IT_Vector< T >::Reference front ()
 Returns a reference to the first element in the array.
IT_Vector< T >::ConstReference front () const
 Returns a const reference to the first element in the array.
IT_Vector< T >::Reference back ()
 Returns a reference to the last element in the array.
IT_Vector< T >::ConstReference back () const
 Returns a const reference to the last element in the array.
void push_back (const T &item, IT_ExceptionHandler &=IT_EXCEPTION_HANDLER)
 Adds the item specified at the end of the array.
IT_Vector< T >::Iterator insert (typename IT_Vector< T >::Iterator pos, const T &item, IT_ExceptionHandler &eh=IT_EXCEPTION_HANDLER)
 Inserts the item specified at the indicated position in the array.
void insert (typename IT_Vector< T >::Iterator pos, typename IT_Vector< T >::SizeType n, const T &init_val=T(), IT_ExceptionHandler &eh=IT_EXCEPTION_HANDLER)
 Inserts the item specified (n) times at the indicated position in the array.
void insert (typename IT_Vector< T >::Iterator pos, const T *first, const T *last, IT_ExceptionHandler &eh=IT_EXCEPTION_HANDLER)
 Inserts the items specified from a source C++ array at the indicated position in the array.
void pop_back ()
 Removes the last item in the array.
IT_Vector< T >::Iterator erase (typename IT_Vector< T >::Iterator pos, IT_ExceptionHandler &eh=IT_EXCEPTION_HANDLER)
 Erases the item specified in the array.
IT_Vector< T >::Iterator erase (typename IT_Vector< T >::Iterator first, typename IT_Vector< T >::Iterator last, IT_ExceptionHandler &eh=IT_EXCEPTION_HANDLER)
 Erases the items specified in the array.
virtual IT_Bus::AnyTypecopy (const IT_Bus::AnyType &rhs)=0
 Returns a reference to an AnyType that is a copy of the AnyType parameter.


Member Function Documentation

template<typename T>
IT_Bus::ArrayT< T >::operator const IT_Vector (  )  const [inline]

Cast operator to obtain array as a const vector.

Returns:
The vector for the array.

Definition at line 52 of file array_t.h.

template<typename T>
IT_Bus::ArrayT< T >::operator IT_Vector (  )  [inline]

Cast operator to obtain array as a vector.

Returns:
The vector for the array.

Definition at line 63 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstReference IT_Bus::ArrayT< T >::operator[] ( const size_t  pos  )  const [inline]

Returns a const reference to the specified element in the array.

Note that specifying a non-existent (pos >= size()) element has undefined behaviour.

Parameters:
pos The position of the element to get the reference for. Note the position of first element is 0.
Returns:
A reference to the specified element.

Definition at line 80 of file array_t.h.

template<typename T>
IT_Vector<T>::Reference IT_Bus::ArrayT< T >::operator[] ( const size_t  pos  )  [inline]

Returns a reference to the specified element in the array.

Note that specifying a non-existent (pos >= size()) element has undefined behaviour.

Parameters:
pos The position of the element to get the reference for. Note the position of first element is 0.
Returns:
A reference to the specified element.

Definition at line 99 of file array_t.h.

template<typename T>
IT_Vector<T>::Iterator IT_Bus::ArrayT< T >::begin (  )  [inline]

Returns an iterator that references the beginning of the array.

Returns:
The iterator.

Definition at line 113 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstIterator IT_Bus::ArrayT< T >::begin (  )  const [inline]

Returns a const iterator that references the beginning of the array.

Returns:
The const iterator.

Definition at line 125 of file array_t.h.

template<typename T>
IT_Vector<T>::Iterator IT_Bus::ArrayT< T >::end (  )  [inline]

Returns an iterator that references a position past the end of the array.

Returns:
The iterator.

Definition at line 138 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstIterator IT_Bus::ArrayT< T >::end (  )  const [inline]

Returns a const iterator that references a position past the end of the array.

Returns:
The iterator.

Definition at line 151 of file array_t.h.

template<typename T>
IT_Vector<T>::ReverseIterator IT_Bus::ArrayT< T >::rbegin (  )  [inline]

Returns a reverse iterator which points to the last element in the array.

Returns:
The iterator.

Definition at line 164 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstReverseIterator IT_Bus::ArrayT< T >::rbegin (  )  const [inline]

Returns a const reverse iterator which points to the last element in the array.

Returns:
The iterator.

Definition at line 177 of file array_t.h.

template<typename T>
IT_Vector<T>::ReverseIterator IT_Bus::ArrayT< T >::rend (  )  [inline]

Returns a reverse iterator which points to just past the first element in the array.

Returns:
The iterator.

Definition at line 190 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstReverseIterator IT_Bus::ArrayT< T >::rend (  )  const [inline]

Returns a const reverse iterator which points to just past the first element in the array.

Returns:
The iterator.

Definition at line 203 of file array_t.h.

template<typename T>
IT_Vector<T>::SizeType IT_Bus::ArrayT< T >::size (  )  const [inline]

Returns the number of items (elements) currently stored in the array.

SizeType is an unsigned integral value.

Returns:
The number of items.

Definition at line 216 of file array_t.h.

template<typename T>
IT_Vector<T>::SizeType IT_Bus::ArrayT< T >::get_size (  )  const [inline]

Returns the number of items (elements) currently stored in the array.

SizeType is an unsigned integral value.

Returns:
The number of items.

Definition at line 229 of file array_t.h.

template<typename T>
void IT_Bus::ArrayT< T >::set_size ( typename IT_Vector< T >::SizeType  sz  )  [inline]

Sets the number of items (elements) currently stored in the array.

SizeType is an unsigned integral value. New elements will have an unitialized value.

Parameters:
size The number of items.

Definition at line 243 of file array_t.h.

template<typename T>
IT_Bool IT_Bus::ArrayT< T >::empty (  )  const [inline]

Returns a true value if the number of elements is zero, false otherwise.

Returns:
true iff number of elements is zero.

Definition at line 265 of file array_t.h.

template<typename T>
IT_Vector<T>::Reference IT_Bus::ArrayT< T >::front (  )  [inline]

Returns a reference to the first element in the array.

Note using front() on an empty array has undefined behaviour.

Returns:
A reference to the first element.

Definition at line 278 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstReference IT_Bus::ArrayT< T >::front (  )  const [inline]

Returns a const reference to the first element in the array.

Note using front() on an empty array has undefined behaviour.

Returns:
Const reference to the first element.

Definition at line 291 of file array_t.h.

template<typename T>
IT_Vector<T>::Reference IT_Bus::ArrayT< T >::back (  )  [inline]

Returns a reference to the last element in the array.

Note using back() on an empty array has undefined behaviour.

Returns:
A reference to the last element.

Definition at line 304 of file array_t.h.

template<typename T>
IT_Vector<T>::ConstReference IT_Bus::ArrayT< T >::back (  )  const [inline]

Returns a const reference to the last element in the array.

Note using back() on an empty array has undefined behaviour.

Returns:
Const reference to the last element.

Definition at line 317 of file array_t.h.

template<typename T>
void IT_Bus::ArrayT< T >::push_back ( const T &  item,
IT_ExceptionHandler &  = IT_EXCEPTION_HANDLER 
) [inline]

Adds the item specified at the end of the array.

Parameters:
item The item to add to the end of the array.
eh An optional exception handler to catch errors.

Definition at line 330 of file array_t.h.

template<typename T>
IT_Vector<T>::Iterator IT_Bus::ArrayT< T >::insert ( typename IT_Vector< T >::Iterator  pos,
const T &  item,
IT_ExceptionHandler &  eh = IT_EXCEPTION_HANDLER 
) [inline]

Inserts the item specified at the indicated position in the array.

Parameters:
pos The position at which to insert the item.
item The item to add to the end of the array.
eh An optional exception handler to catch errors.

Definition at line 347 of file array_t.h.

template<typename T>
void IT_Bus::ArrayT< T >::insert ( typename IT_Vector< T >::Iterator  pos,
typename IT_Vector< T >::SizeType  n,
const T &  init_val = T(),
IT_ExceptionHandler &  eh = IT_EXCEPTION_HANDLER 
) [inline]

Inserts the item specified (n) times at the indicated position in the array.

Parameters:
pos The position at which to insert the item.
n The number of times to insert the array item.
init_val The item to add to the end of the array.
eh An optional exception handler to catch errors.

Definition at line 367 of file array_t.h.

template<typename T>
void IT_Bus::ArrayT< T >::insert ( typename IT_Vector< T >::Iterator  pos,
const T *  first,
const T *  last,
IT_ExceptionHandler &  eh = IT_EXCEPTION_HANDLER 
) [inline]

Inserts the items specified from a source C++ array at the indicated position in the array.

Parameters:
pos The position at which to insert the items.
first The first item in the source C++ array to insert.
last The last item in the source C++ array to insert.
eh An optional exception handler to catch errors.

Definition at line 388 of file array_t.h.

template<typename T>
IT_Vector<T>::Iterator IT_Bus::ArrayT< T >::erase ( typename IT_Vector< T >::Iterator  pos,
IT_ExceptionHandler &  eh = IT_EXCEPTION_HANDLER 
) [inline]

Erases the item specified in the array.

Parameters:
pos The item to remove.
eh An optional exception handler to catch errors.

Definition at line 416 of file array_t.h.

template<typename T>
IT_Vector<T>::Iterator IT_Bus::ArrayT< T >::erase ( typename IT_Vector< T >::Iterator  first,
typename IT_Vector< T >::Iterator  last,
IT_ExceptionHandler &  eh = IT_EXCEPTION_HANDLER 
) [inline]

Erases the items specified in the array.

Parameters:
first The first item to remove.
last The last item to remove.
eh An optional exception handler to catch errors.

Definition at line 433 of file array_t.h.

template<typename T>
virtual IT_Bus::AnyType& IT_Bus::ArrayT< T >::copy ( const IT_Bus::AnyType rhs  )  [pure virtual]

Returns a reference to an AnyType that is a copy of the AnyType parameter.

Derived classes override this method, providing an appropriate implementation. In this base class, this method is not supported; an exception is always thrown.

Parameters:
AnyType to be copied.
Returns:
A reference to AnyType.
Exceptions:
IT_Bus::Exception with message "Copy not supported"

Reimplemented from IT_Bus::AnyType.

Implemented in IT_Policy::OperatorContentType, IT_ContextAttributes::SOAPAttachmentPartInfoArray, IT_Bus_Services::IT_SessionManager::ServiceEndpointList, IT_Bus_Services::IT_SessionManager::EndpointList, IT_Bus_Managed::LoggingDetails, and IT_Bus_Managed::ServicesDetails.


Generated on Tue Mar 20 15:27:57 2007 for Artix by  doxygen 1.5.1-p1