collection_adapter (STL/CLR)
STL/CLR のコンテナーとして使用する .NET の収集をラップします。collection_adapter は、単純な STL/CLR コンテナー オブジェクトを記述するテンプレート クラスです。このコントロールは、基本クラス ライブラリの (BCL) インターフェイスをラップし、被制御シーケンスを処理するために使用する反復子のペアを返します。
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>>;
パラメーター
- Coll
ラップされたコレクションの型。
特化
特化 |
Description |
---|---|
IEnumerable |
要素によるシーケンス。 |
ICollection |
要素のグループを保持します。 |
IList |
要素の順序付けられているグループを保持します。 |
IDictionary |
一連のキー値、 {} ペアを保持します。 |
IEnumerable<値> |
入力された要素によるシーケンス。 |
ICollection<値> |
入力された要素のグループを保持します。 |
IList<値> |
入力された要素の順序付けられているグループを保持します。 |
IDictionary<値> |
一連の入力されたキー値、 {} ペアを保持します。 |
メンバー
型定義 |
Description |
---|---|
2 つの要素間の距離を表す、符号付きの型です。 |
|
被制御シーケンスの反復子の型です。 |
|
ディクショナリ内のキーの種類。 |
|
ディクショナリの値の型。 |
|
要素への参照の型です。 |
|
2 つの要素間の距離を表す、符号付きの型です。 |
|
要素の型。 |
メンバー関数 |
Description |
---|---|
ラップされた BCL インターフェイスを指定します。 |
|
被制御シーケンスの先頭を指定します。 |
|
アダプター オブジェクトを構築します。 |
|
被制御シーケンスの末尾を指定します。 |
|
要素の数をカウントします。 |
|
2 つのコンテナーのコンテンツを交換します。 |
[演算子] |
Description |
---|---|
保存された BCL ハンドルを置き換えます。 |
解説
STL/CLR のコンテナーとして BCL コンテナーを処理するには、このテンプレート クラスを使用します。collection_adapter は、要素のシーケンスを制御する BCL インターフェイスへのハンドルを格納します。collection_adapter のオブジェクト X は、要素を参照するために使用する X.end() 、注文に入力反復子 X.begin() のペアを返します。特化の一部は、被制御シーケンスの継続時間を確認するに X.size() を書き込むことができます。
必要条件
ヘッダー: <cliext とアダプター>
名前空間: の cliext