collection_adapter (STL/CLR)
A template class that describes a simple STL/CLR container object. The container object wraps a Base Class Library (BCL) interface, and returns an iterator pair that you use to manipulate the controlled sequence.
template<typename Coll>
ref class collection_adapter;
template<>
ref class collection_adapter<
System::Collections::ICollection>;
template<>
ref class collection_adapter<
System::Collections::IEnumerable>;
template<>
ref class collection_adapter<
System::Collections::IList>;
template<>
ref class collection_adapter<
System::Collections::IDictionary>;
template<typename Value>
ref class collection_adapter<
System::Collections::Generic::ICollection<Value>>;
template<typename Value>
ref class collection_adapter<
System::Collections::Generic::IEnumerable<Value>>;
template<typename Value>
ref class collection_adapter<
System::Collections::Generic::IList<Value>>;
template<typename Key,
typename Value>
ref class collection_adapter<
System::Collections::Generic::IDictionary<Key, Value>>;
Parameters
- Coll
The type of the wrapped collection.
Specializations
Specialization |
Description |
---|---|
IEnumerable |
Sequences through elements. |
ICollection |
Maintains a group of elements. |
IList |
Maintains an ordered group of elements. |
IDictionary |
Maintain a set of {key, value} pairs. |
IEnumerable<Value> |
Sequences through typed elements. |
ICollection<Value> |
Maintains a group of typed elements. |
IList<Value> |
Maintains an ordered group of typed elements. |
IDictionary<Value> |
Maintains a set of typed {key, value} pairs. |
Members
Type Definition |
Description |
---|---|
The type associated with the signed distance between two elements. |
|
The iterator type associated with the controlled sequence. |
|
The dictionary key type. |
|
The dictionary value type. |
|
The type associated with a reference to an element. |
|
The type associated with a signed distance between two elements. |
|
The element type. |
Member Function |
Description |
---|---|
Designates the wrapped BCL interface. |
|
Designates the beginning of the controlled sequence. |
|
Constructs an adapter object. |
|
Designates the end of the controlled sequence. |
|
Counts the number of elements. |
|
Swaps the contents of two containers. |
Operator |
Description |
---|---|
Replaces the stored BCL handle. |
Remarks
The collection_adapter stores a handle to a BCL interface, which in turn controls a sequence of elements. A collection_adapter object X returns a pair of input iterators X.begin() and X.end() that you use to visit the elements, in order. Some of the specializations also let you write X.size() to determine the length of the controlled sequence. You use this template class to manipulate BCL containers much like STL/CLR containers.
Requirements
Header: <cliext/adapter>
Namespace: cliext