Category: adaptors |
Component type: type |
The transform_view
template represents objects that
reference one container, and that have methods for accessing its
elements. The properties of any transform_view
instance
depend on the properties of the container template
parameter. The interface of transform_view
adapts itself
[1] to the referenced container, if this is one of
Container provides a Container
interface, a transform_view
referencing Forward
Containers provides a Forward Container interface while a Random
Access Container provides a Random Access Conatiner interface, or
Sequence interface.
The transform_view
presents transformed values,
depending on the transformation template parameter.
Transformation is only applied in presenting the elements, the
container's elements themselves are not altered.
The properties of the order of elements are the same as those provided by the underlying container, as is the validity of more than one active iterators at any one time.
A transform_view
owns its referenced container, if
its base template parameter is aggregated_ownership,
it
merely references its container, if the base template
parameter is referenced_ownership.
Parameter |
Description |
Default |
container |
The view's container type: the type of container referenced by this view |
|
transformation |
The view's transformation type: the type of the transformation used to transform the container's elements |
|
|
The view's const tag: either |
|
T |
The view's value type: the type of elements referenced by this view. |
transformation::result_type |
base |
The view's ownership type: the base class that determines if the view references or owns the container |
referenced_ownership |
Defined in the header transform_view.hpp.
transformation
's
operator()
has to be a const member.
Member |
Where defined |
Description |
|
The type |
|
|
The type of the referenced container. |
|
|
The type of the transformation. |
|
|
Pointer to |
|
|
|
|
|
|
|
|
An unsigned integral type. |
|
|
A signed integral type. |
|
|
Iterator used to iterate through the view. |
|
|
Const iterator used to iterate through the view. |
|
|
Iterator used to iterate backwards through the view. |
|
|
Const iterator used to iterate backwards through the view. |
|
|
Returns an iterator pointing to the begin of the view. |
|
|
Returns an iterator pointing to the end of the view. |
|
|
Returns a const_iterator pointing to the begin of the view. |
|
|
Returns a const_iterator pointing to the end of the view. |
|
|
Valid for reversible
container's only. Returns a |
|
|
Valid for reversible
container's only. Returns a |
|
|
Valid for reversible
container's only. Returns a |
|
|
Valid for reversible
container's only. Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Call pop_front on the underlying container. |
|
|
Call pop_back on the underlying container. |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns the size of the view. |
|
|
Returns the largest possible size of the view. |
|
|
true if the view's size is 0. |
|
|
Creates an empty view. |
|
|
Creates a view of given container. |
|
|
Swaps the two views. Iterators are invalidated by this operation. For referencing views, the containers themselves are not swapped. |
|
|
Tests two views for equality. This is a global function, not a member function. Views may be equal even if their referenced containers are not. |
|
|
Lexicographical comparison. This is a global function, not a member function. |
[1] Since in general the transformation results in
temporary objects, non const references as return value of e.g. front
are useless. Instead, reference
is defined to be the
same as value_type
here. Whether and how altering the
elements of the view affects the elements of the referenced contianer
depends on the template parameter const_tag
and the
transformation.
VTL Home
Copyright
© 1999 Konrad-Zuse-Zentrum für Informationstechnik Berlin &
Gary Powell All Rights Reserved.