次の方法で共有


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

collection_adapter::difference_type (STL/CLR)

2 つの要素間の距離を表す、符号付きの型です。

collection_adapter::iterator (STL/CLR)

被制御シーケンスの反復子の型です。

collection_adapter::key_type (STL/CLR)

ディクショナリ内のキーの種類。

collection_adapter::mapped_type (STL/CLR)

ディクショナリの値の型。

collection_adapter::reference (STL/CLR)

要素への参照の型です。

collection_adapter::size_type (STL/CLR)

2 つの要素間の距離を表す、符号付きの型です。

collection_adapter::value_type (STL/CLR)

要素の型。

メンバー関数

Description

collection_adapter::base (STL/CLR)

ラップされた BCL インターフェイスを指定します。

collection_adapter::begin (STL/CLR)

被制御シーケンスの先頭を指定します。

collection_adapter::collection_adapter (STL/CLR)

アダプター オブジェクトを構築します。

collection_adapter::end (STL/CLR)

被制御シーケンスの末尾を指定します。

collection_adapter::size (STL/CLR)

要素の数をカウントします。

collection_adapter::swap (STL/CLR)

2 つのコンテナーのコンテンツを交換します。

[演算子]

Description

collection_adapter::operator= (STL/CLR)

保存された BCL ハンドルを置き換えます。

解説

STL/CLR のコンテナーとして BCL コンテナーを処理するには、このテンプレート クラスを使用します。collection_adapter は、要素のシーケンスを制御する BCL インターフェイスへのハンドルを格納します。collection_adapter のオブジェクト X は、要素を参照するために使用する X.end() 、注文に入力反復子 X.begin() のペアを返します。特化の一部は、被制御シーケンスの継続時間を確認するに X.size() を書き込むことができます。

必要条件

ヘッダー: <cliext とアダプター>

名前空間: の cliext

参照

関連項目

range_adapter (STL/CLR)

make_collection (STL/CLR)