| コンテナ | |
| <boost/multi_index_container.hpp> | multi_index_containerを使用する |
| インデックス | |
| <boost/multi_index/ordered_index.hpp> | setやmapのように整列されたインデックスを使用する。 ordered_unique, ordered_non_unique |
| <boost/multi_index/hashed_index.hpp> | ハッシュをキーに持つインデックスを使用する。 hashed_unique, hashed_non_unique |
| <boost/multi_index/sequenced_index.hpp> | listのような順番にアクセスするインデックスを使用する。 sequenced |
| <boost/multi_index/random_access_index.hpp> | vectorのようなランダムアクセスが可能なインデックスを使用する。 random_access |
| ソート方法 | |
| <boost/multi_index/key_extractors.hpp> | 以下のヘッダ全てをインクルードする |
| <boost/multi_index/identity.hpp> | 要素のクラス(インスタンス)同士を比較する場合に必要 |
| <boost/multi_index/member> | 要素のフィールドを比較する場合に必要 |
| <boost/multi_index/mem_fun.hpp> | 要素のメンバ関数で比較する場合に必要 |
| <boost/multi_index/global_fun.hpp> | グローバルな関数で比較する場合に必要 |
| <boost/multi_index/composite_key.hpp> | 複数の条件で比較する( 参考 )場合に必要 |
template<
typename Value,
typename IndexSpecifierList=indexed_by<ordered_unique<identity<Value> > >,
typename Allocator=std::allocator<Value> >
class multi_index_container;| type | specifier | |
| key-based | ordered | ordered_unique |
| ordered_non_unique | ||
| hashed | hashed_unique | |
| hashed_non_unique | ||
| non key-based | sequenced | |
| random_access | ||
template<
typename KeyFromValue,
typename Compare=std::less<KeyFromValue::result_type>
>
struct (ordered_unique | ordered_non_unique);
template<
typename TagList,
typename KeyFromValue,
typename Compare=std::less<KeyFromValue::result_type>
>
struct (ordered_unique | ordered_non_unique);template<
typename KeyFromValue,
typename Hash=boost::hash<KeyFromValue::result_type>,
typename Pred=std::equal_to<KeyFromValue::result_type>
>
struct (hashed_unique | hashed_non_unique);
template<
typename TagList,
typename KeyFromValue,
typename Hash=boost::hash<KeyFromValue::result_type>,
typename Pred=std::equal_to<KeyFromValue::result_type>
>
struct (hashed_unique | hashed_non_unique);| - | - | テンプレート引数 | 制限 |
| - | - | Value | |
| - | - | Allocator | |
| - | - | TagList | |
| - | - | KeyFromValue | |
| - | - | Hash | |
| - | - | Pred | |
| - | 可視性 | ベースクラス | 機能 |
| - | 可視性 | 型名 | 元の型名 |
| - | public | key_type | KeyFromValue::result_type |
| - | public | value_type | Value |
| - | public | key_from_value | KeyFromValue |
| - | public | hasher | Hash |
| - | public | key_equal | Pred |
| - | public | ctor_args | tuple<size_type,key_from_value,hasher,key_equal> |
| - | public | allocator_type | Allocator |
| - | public | pointer | Allocator::pointer |
| - | public | const_pointer | Allocator::const_pointer |
| - | public | reference | Allocator::reference |
| - | public | const_reference | Allocator::const_reference |
| - | public | size_type | implementation defined |
| - | public | difference_type | implementation defined |
| - | public | iterator | implementation defined |
| - | public | const_iterator | implementation defined |
| - | public | local_iterator | implementation defined |
| - | public | const_local_iterator | implementation defined |
| 静的/仮想 | 可視性 | 関数 | 機能 |
| - | public | operator=() | |
| - | public | get_allocator() const | |
| - | public | empty() const | |
| - | public | size() const | |
| - | public | max_size() const | |
| - | public | begin() | |
| - | public | begin() const | |
| - | public | end() | |
| - | public | end() const | |
| - | public | cbegin() const | |
| - | public | cend() const | |
| - | public | iterator_to() | |
| - | public | iterator_to() const | |
| - | public | insert() | modifiers: |
| - | public | erase() | |
| - | public | replace() | |
| - | public | modify() | |
| - | public | modify_key() | |
| - | public | clear() | |
| - | public | swap() | |
| - | public | key_extractor() const | observers: |
| - | public | hash_function() const | |
| - | public | key_eq() const | |
| - | public | find() const | lookup: |
| - | public | count() const | |
| - | public | equal_range() const | |
| - | public | bucket_count() const | bucket interface: |
| - | public | max_bucket_count() const | |
| - | public | bucket_size() const | |
| - | public | bucket() const | |
| - | public | load_factor() const | hash policy: |
| - | public | max_load_factor() const | |
| - | public | rehash(size_type n) | |
| 静的 | 可視性 | フィールド | 用途 |
| クラス | 可視性 | 機能 | |
template<typename TagList=tag<> >
struct sequenced;template<typename TagList=tag<> >
struct random_access;template<typename T> struct identity;template<class Class,typename Type,Type Class::*PtrToMember>
struct member;
template<class Class,typename Type,std::size_t OffsetOfMember>
struct member_offset;
#define BOOST_MULTI_INDEX_MEMBER(Class,Type,MemberName) implementation definedtemplate<class Class,typename Type,Type (Class::*PtrToMemberFunction)() const>
struct const_mem_fun;
template<class Class, typename Type, Type (Class::*PtrToMemberFunction)()>
struct mem_fun;
template<
class Class, typename Type,
typename PtrToMemberFunctionType, PtrToMemberFunctionType PtrToMemberFunction
>
struct const_mem_fun_explicit;
template<
class Class,typename Type,
typename PtrToMemberFunctionType,PtrToMemberFunctionType PtrToMemberFunction
>
struct mem_fun_explicit;
#define BOOST_MULTI_INDEX_CONST_MEM_FUN(Class, Type, MemberFunName) \
implementation defined
#define BOOST_MULTI_INDEX_MEM_FUN(Class, Type, MemberFunName) \
implementation definedtemplate<class Value,typename Type,Type (*PtrToFunction)(Value)>
struct global_fun;template<typename Value,typename KeyFromValue0,...,typename KeyFromValuen>
struct composite_key;
template<typename CompositeKey>
struct composite_key_result;multi_index_container<
要素の型,
indexed_by<
0番目のインデックス, // 例えばsequenced<>
1番目のインデックス, // 例えばordered_unique<...>
...
>
>
typedef multi_index_container<
要素の型,
indexed_by<
sequenced<>, // 0番目のインデックス
ordered_unique<...> // 1番目のインデックス
...
>
> Container;
Container container;
...
Container::nth_index<0>::type& index0 = container.get<0>();
Container::nth_index<1>::type& index1 = container.get<1>();
...typedef multi_index_container<
要素の型,
indexed_by<
sequenced<tag<型A> >, // 0番目のインデックス
ordered_unique<tag<型B>, ...> // 1番目のインデックス
...
>
> Container;
Container container;
...
Container::index<型A>::type& index0 = container.get<型A>();
Container::index<型B>::type& index1 = container.get<型B>();
...