rwsf::ArrayBody<T> rwsf::XmlOlBody rwsf::BodyBase
#include <rw/rwsf/soapworx/ArrayBody.h>
All generated SOAP array bodies derive from rwsf::ArrayBody<T> instantiated on the type of element contained in the array.
rwsf::ArrayBody implements multidimensional arrays by instantiating on a rwsf::SoapArray (for example, a two dimensional SoapArray has the structure rwsf::ArrayBody<rwsf::SoapArray<contained type>> ) and maintaining dimension information internally.
rwsf::ArrayBody implements the handle/body idiom in which rwsf::ArrayHandle is the handle. The handle passes all public methods to the body, which contains an instance of rwsf::SoapArray, the class that includes the container functionality.
Instances of rwsf::ArrayBody in turn pass methods to the rwsf::SoapArray instance.
NOTE -- This class is not created directly, but instantiated through its handle rwsf::ArrayHandle.
For information on the parent class rwsf::XmlOlHandle, see its entry in the HydraExpress XML Binding Reference Guide.
rwsf::ArrayHandle, rwsf::SoapArray
typedef rwsf::SoapArray<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;
~ArrayBody<T>();
Destructor.
iterator begin(); const_iterator begin() const;
Returns an iterator positioned at the first element of the array, a rwsf::SoapArray.
iterator end(); const_iterator end() const;
Returns a past-the-end valued iterator of the array.
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, or the array. The return value points to the inserted key.
reference operator()(size_type idx); const_reference operator() (size_type idx) const;
Returns a reference to the idxth element of the array. 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 the array. 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 ArrayBody<T>& rwc) const;
Calls the destructor on all elements of the array, and replaces them by copying all elements of rwc.
bool operator!=(const ArrayBody<T>& rwc) const;
Returns true if the array 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.
void append(const_reference item);
Adds item to the end of the collection, or the array.
reference at(size_type idx); const_reference at(size_type idx) const;
Returns a reference to the idxth element of the array. 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() const_reference back() const
Returns a reference to the last element.
void clear();
Clears the collection by removing all items from the array. Each item will have its destructor called.
bool contains(const_reference key) const;
Returns true if there exists an element t in the array 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 the array.
bool find(const_reference key, value_type& val) const;
If there exists an element t in the array 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 the rwsf::SoapArray instance member.
size_type index(const_reference key) const;
Returns the position of the first item t in the array 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 the rwsf::SoapArray instance member. 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 the rwsf::SoapArray instance member.
size_type occurrencesOf(const_reference key) const;
Returns the number of elements t in the array 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 the rwsf::SoapArray instance member.
bool remove(const_reference key);
Removes the first element t in the array 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 the array 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 the rwsf::SoapArray instance member. 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 the array 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.
ArrayBody<T>();
Default constructor.
ArrayBody<T>(size_type dims);
Constructs an array of size dims.
ArrayBody<T>(size_type n, size_type dims);
Constructs an array of n elements of size dims.
ArrayBody<T>(const rwsf::SoapArray<T>& array);
Constructs an array of type rwsf::SoapArray.
container_type& impl() const container_type& impl() const
Returns the array, a rwsf::SoapArray.
std::vector<size_t>& getDimensions() const std::vector<size_t>& getDimensions() const
Returns a vector containing the size of each dimension in the array. If the array is int[2,3,4], then the returned vector contains 2, 3 and 4 in that order. Any dimension without a size is set to 0. For example, a one-dimension array returns a vector with a single element whose value is the upper bound of the array or 0 if there is no upper bound (defined as int[]).
void parseDimensions(const std::string& arrayType)
Parses the dimension string in the XML SOAP Array definition and sets the array dimensions in "this".
virtual XmlOLBodyBase::XmlOLTypeCategory XmlOLBodyTypeCategory() const
Returns the array, a SOAP array.
©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.