#include <rw/rwsf/soapworx/SoapArray.h>
An instance of rwsf::SoapArray is contained in rwsf::ArrayBody, from which all generated SOAP arrays derive. All methods from the generated array handle are passed to the rwsf::SoapArray body, and then on to the instance of rwsf::SoapArray that provides the typical container methods for the array.
The value type must have operator== defined. This requirement is imposed by the Standard C++ Library.
rwsf::ArrayHandle, rwsf::ArrayBody
Class vector<T,A> is the C++-standard collection that serves as the underlying implementation for this class.
typedef std::vector<T> container_type; typedef typename container_type::iterator iterator; typedef typename container_type::const_iterator const_iterator; typedef typename container_type::size_type size_type; typedef typename container_type::value_type value_type; typedef typename container_type::reference reference; typedef typename container_type::const_reference const_reference;
SoapArray<T>();
Default constructor. Constructs an empty array.
SoapArray<T>(const container_type& t);
Constructs an array by copying all elements of t.
SoapArray<T>(const SoapArray<T>& t);
Copy constructor.
SoapArray<T>(size_type n, const T& val);
Constructs an array with n elements, each initialized to val.
SoapArray<T>(const T* first, const T* last);
Constructs an array by copying elements from the array of Ts pointed to by first, up to, but not including, the element pointed to by last.
SoapArray<T>(size_type n);
Constructs an empty vector with a capacity of n elements.
~SoapArray<T>();
Destructor.
SoapArray<T>& operator=(const SoapArray<T>& rwc);
Calls the destructor on all elements of self and replaces them by copying all elements of rwc.
reference operator()(size_type idx); const_reference operator() (size_type idx) const;
Returns a reference to the idxth element of self. Index idx should be between 0 and one less then the number of entries, otherwise the results are undefined. No bounds checking is performed.
reference operator[](size_type idx) const_reference operator[](size_type idx) const;
Returns a reference to the idxth element of self. Index idx must be between 0 and one less then the number of entries in self, otherwise the function throws an exception of type rwsf::OutOfBoundsException.
bool operator==(const SoapArray<T>& rwc) const;
Returns true if self compares equal to rwc, otherwise returns false. Two collections are equal if both have the same number of entries, and iterating through both collections produces, in turn, individual elements that compare equal to each other.
bool operator!=(const SoapArray<T>& rwc) const;
Returns true if self is not equal to rwc, otherwise returns false. Two collections are equal if both have the same number of entries, and iterating through both collections produces, in turn, individual elements that compare equal to each other.
iterator begin(); const_iterator begin() const;
Returns an iterator positioned at the first element of self.
iterator end(); const_iterator end() const;
Returns a past-the-end valued iterator of self.
iterator insert(iterator it, const_reference key);
Adds the item key before position it in the array. The return value points to the position it.
iterator insert(const_reference key);
Adds the item key to the end of the collection.
void append(const_reference item);
Adds item to the end of the collection.
reference at(size_type idx); const_reference at(size_type idx) const;
Returns a reference to the ith element of self. Index idx must be between 0 and one less then the number of entries in self, otherwise the function throws an exception of type rwsf::OutOfBoundsException.
reference back()
Returns a reference to the last element.
const_reference back() const
Returns a constant reference to the last element.
void clear();
Clears the collection by removing all items from self. Each item will have its destructor called.
bool contains(const_reference key) const;
Returns true if there exists an element t in self such that the expression(t == key) is true, otherwise returns false.
bool empty() const
Returns true if the size is zero.
size_type entries() const;
Returns the number of elements in self.
bool find(const_reference key, value_type& val) const;
If there exists an element t in self such that the expression (t == key) is true, assigns t to val and returns true. Otherwise, returns false and leaves the value of val unchanged.
reference first(); const_reference first() const;
Returns a reference to the first element of self.
container_type& impl() const container_type& impl() const
Returns the array body, a std::vector.
size_type index(const_reference key) const;
Returns the position of the first item t in self such that (t == key), or returns rwsf_NPOS if no such item exists.
void insertAt(size_type index, const_reference item);
Inserts item in front of the item at position index in self. This position must be between 0 and the number of entries in the collection, otherwise the function throws an exception of type rwsf::OutOfBoundsException.
bool isEmpty() const;
Returns true if there are no items in the collection, false otherwise.
reference last(); const_reference last() const;
Returns a reference to the last item in the collection.
size_type length() const;
Returns the number of elements in self.
size_type occurrencesOf(const_reference key) const;
Returns the number of elements t in self such that the expression (t == key) is true.
void prepend(const_reference item);
Adds the item a to the beginning of the collection.
void push_back(const_reference item)
Inserts a copy of item to the end of self.
bool remove(const_reference key);
Removes the first element t in self such that the expression (t == key) is true and returns true. Returns false if there is no such element.
size_type removeAll(const_reference key);
Removes all elements t in self such that the expression (t == key) is true. Returns the number of items removed.
value_type removeAt(size_type index);
Removes and returns the item at position index in self. This position must be between 0 and one less then the number of entries in the collection, otherwise the function throws an exception of type rwsf::OutOfBoundsException.
value_type removeFirst();
Removes and returns the first item in the collection.
value_type removeLast();
Removes and returns the last item in the collection.
size_type replaceAll(const_reference oldVal, const_reference newVal);
Replaces all elements t in self such that the expression (t == oldVal) is true with newVal. Returns the number of items replaced.
void resize(size_t n);
Modify the capacity of the vector to be at least as large as n. The function has no effect if the capacity is already as large as n.
size_type size() const
Returns the number of elements.
©2004-2007 Copyright Quovadx, Inc. All Rights Reserved.
Quovadx and Rogue Wave are registered trademarks of Quovadx, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.