Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Boost.MultiIndex Documentation - multi_index_container reference

Boost , , Boost.MultiIndex Documentation - Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Boost.MultiIndex multi_index_container reference



Contents

Header "boost/multi_index_container_fwd.hpp" synopsis

namespace boost{
namespace multi_index{
template<
  typename Value,
  typename IndexSpecifierList=indexed_by<ordered_unique<identity<Value> > >,
  typename Allocator=std::allocator<Value> >
class multi_index_container;
} // namespace boost::multi_index 
using multi_index::multi_index_container;
} // namespace boost

<multi_index_container_fwd.hpp>вперед объявляет шаблон класса<multi_index_container>и указывает его параметры по умолчанию.

Header "boost/multi_index_container.hpp" synopsis

#include <initializer_list>
namespace boost{
namespace multi_index{
template<typename Value,typename IndexSpecifierList,typename Allocator>
class multi_index_container;
// multi_index_container associated global class templates:
template<typename MultiIndexContainer,int N> struct nth_index;
template<typename MultiIndexContainer,typename Tag> struct index;
template<typename MultiIndexContainer,int N>
struct nth_index_iterator;                          // deprecated
template<typename MultiIndexContainer,int N>
struct nth_index_const_iterator;                    // deprecated
template<typename MultiIndexContainer,typename Tag>
struct index_iterator;                              // deprecated
template<typename MultiIndexContainer,typename Tag>
struct index_const_iterator;                        // deprecated
// multi_index_container global functions for index retrieval:
template<
  int N,typename Value,typename IndexSpecifierList,typename Allocator
>
typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type&
get(multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept;
template<
  int N,typename Value,typename IndexSpecifierList,typename Allocator
>
const typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type&
get(const multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept;
template<
  typename Tag,typename Value,typename IndexSpecifierList,typename Allocator
>
typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type&
get(multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept;
template<
  typename Tag,typename Value,typename IndexSpecifierList,typename Allocator
>
const typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type&
get(const multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept;
// multi_index_container global functions for projection of iterators:
template<
  int N,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type::iterator
project(
  multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it);
template<
  int N,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type::const_iterator
project(
  const multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it);
template<
  typename Tag,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type::iterator
project(
  multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it);
template<
  typename Tag,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type::const_iterator
project(
  const multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it);
// comparison:
// OP is any of ==,<,!=,>,>=,<=
template<
  typename Value1,typename IndexSpecifierList1,typename Allocator1,
  typename Value2,typename IndexSpecifierList2,typename Allocator2
>
bool operator OP(
  const multi_index_container<Value1,IndexSpecifierList1,Allocator1>& x,
  const multi_index_container<Value2,IndexSpecifierList2,Allocator2>& y);
// specialized algorithms:
template<typename Value,typename IndexSpecifierList,typename Allocator>
void swap(
  multi_index_container<Value,IndexSpecifierList,Allocator>& x,
  multi_index_container<Value,IndexSpecifierList,Allocator>& y);
} // namespace boost::multi_index 
using multi_index::multi_index_container;
using multi_index::get;
using multi_index::project;
} // namespace boost

Class template multi_index_container

Это основной компонент Boost. MultiIndex.<multi_index_container>представляет собой шаблон класса контейнеров, содержащий определенный пользователем списокиндексов. Эти индексы обеспечивают различные интерфейсы для управления элементами<multi_index_container>. Сама по себе<multi_index_container>обеспечивает только базовую функциональность для строительства и для доступа к удерживаемым индексам.

Тип<multi_index_container>инстанциируется с типом содержащихся элементов и непустым<MPL Forward Sequence>, определяющим, какие индексы соответствуют классу.

Для удобства использования все публичные методы и виды указанного первого индекса наследуются по<multi_index_container>. Сюда же относятся глобальные операторы и функции, связанные с индексом (vg. comparison и<swap>).

template<
  typename Value,
  typename IndexSpecifierList=indexed_by<ordered_unique<identity<Value> > >,
  typename Allocator=std::allocator<Value> >
class multi_index_container
{
public:
  // types:
  typedef implementation defined   ctor_args_list;
  typedef implementation defined   index_specifier_type_list;
  typedef implementation defined   index_type_list;
  typedef implementation defined   iterator_type_list;
  typedef implementation defined   const_iterator_type_list;
  typedef Allocator                allocator_type;
  // nested class templates:
  template<int N>
  struct nth_index                {typedef implementation defined type;};
  template<typename Tag>
  struct index                    {typedef implementation defined type;};
  template<int N>
  struct nth_index_iterator        // deprecated
  {typedef implementation defined type;};
  template<int N>
  struct nth_index_const_iterator  // deprecated
  {typedef implementation defined type;};
  template<typename Tag>
  struct index_iterator            // deprecated
  {typedef implementation defined type;};
  template<typename Tag>
  struct index_const_iterator      // deprecated
  {typedef implementation defined type;};
  
  // construct/copy/destroy:
  explicit multi_index_container(
    const ctor_args_list& args_list=ctor_args_list(),
    const allocator_type& al=allocator_type());
  explicit multi_index_container(const allocator_type& al);
  template<typename InputIterator>
  multi_index_container(
    InputIterator first,InputIterator last,
    const ctor_args_list& args_list=ctor_args_list(),
    const allocator_type& al=allocator_type());
  multi_index_container(
    std::initializer_list<Value> list,
    const ctor_args_list& args_list=ctor_args_list(),
    const allocator_type& al=allocator_type());
  multi_index_container(
    const multi_index_container<Value,IndexSpecifierList,Allocator>& x);
  multi_index_container(
    multi_index_container<Value,IndexSpecifierList,Allocator>&& x);
  ~multi_index_container();
  multi_index_container<Value,IndexSpecifierList,Allocator>& operator=(
    const multi_index_container<Value,IndexSpecifierList,Allocator>& x);
  multi_index_container<Value,IndexSpecifierList,Allocator>& operator=(
    multi_index_container<Value,IndexSpecifierList,Allocator>&& x);
  multi_index_container<Value,IndexSpecifierList,Allocator>& operator=(
    std::initializer_list<Value> list)
  allocator_type get_allocator()const noexcept;
  // retrieval of indices
  template<int N> typename nth_index<N>::type& get()noexcept;
  template<int N> const typename nth_index<N>::type& get()const noexcept;
  template<typename Tag> typename index<Tag>::type& get()noexcept;
  template<typename Tag> const typename index<Tag>::type& get()const noexcept;
  // projection of iterators
  template<int N,typename IteratorType>
    typename nth_index<N>::type::iterator project(IteratorType it);
  template<int N,typename IteratorType>
    typename nth_index<N>::type::const_iterator project(IteratorType it)const;
  template<typename Tag,typename IteratorType>
    typename index<Tag>::type::iterator project(IteratorType it);
  template<typename Tag,typename IteratorType>
    typename index<Tag>::type::const_iterator project(IteratorType it)const;
};
// multi_index_container associated global class templates:
template<typename MultiIndexContainer,int N> struct nth_index
{
  typedef typename MultiIndexContainer::nth_index<N>::type type;
};
template<typename MultiIndexContainer,typename Tag> struct index
{
  typedef typename MultiIndexContainer::index<Tag>::type type;
};
template<typename MultiIndexContainer,int N>
struct nth_index_iterator       // deprecated
{
  typedef typename MultiIndexContainer::nth_index_iterator<N>::type type;
};
template<typename MultiIndexContainer,int N>
struct nth_index_const_iterator // deprecated
{
  typedef typename MultiIndexContainer::nth_index_const_iterator<N>::type type;
};
template<typename MultiIndexContainer,typename Tag>
struct index_iterator           // deprecated
{
  typedef typename MultiIndexContainer::index_iterator<Tag>::type type;
};
template<typename MultiIndexContainer,typename Tag>
struct index_const_iterator     // deprecated
{
  typedef typename MultiIndexContainer::index_const_iterator<Tag>::type type;
};
// multi_index_container global functions for index retrieval:
template<
  int N,typename Value,typename IndexSpecifierList,typename Allocator
>
typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type&
get(multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept
{
  return m.get<N>();
}
template<
  int N,typename Value,typename IndexSpecifierList,typename Allocator
>
const typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type&
get(const multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept
{
  return m.get<N>();
}
template<
  typename Tag,typename Value,typename IndexSpecifierList,typename Allocator
>
typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type&
get(multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept
{
  return m.get<Tag>();
}
template<
  typename Tag,typename Value,typename IndexSpecifierList,typename Allocator
>
const typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type&
get(const multi_index_container<Value,IndexSpecifierList,Allocator>& m)noexcept
{
  return m.get<Tag>();
}
// multi_index_container global functions for projection of iterators:
template<
  int N,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type::iterator
project(
  multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it)
{
  return m.template project<N>(it);
}
template<
  int N,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename nth_index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,N
>::type::const_iterator
project(
  const multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it)
{
  return m.template project<N>(it);
}
template<
  typename Tag,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type::iterator
project(
  multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it)
{
  return m.template project<Tag>(it);
}
template<
  typename Tag,typename IteratorType,
  typename Value,typename IndexSpecifierList,typename Allocator
>
typename index<
  multi_index_container<Value,IndexSpecifierList,Allocator>,Tag
>::type::const_iterator
project(
  const multi_index_container<Value,IndexSpecifierList,Allocator>& m,
  IteratorType it)
{
  return m.template project<Tag>(it);
}
// comparison:
// OP is any of ==,<,!=,>,>=,<=
template<
  typename Value1,typename IndexSpecifierList1,typename Allocator1,
  typename Value2,typename IndexSpecifierList2,typename Allocator2
>
bool operator OP(
  const multi_index_container<Value1,IndexSpecifierList1,Allocator1>& x,
  const multi_index_container<Value2,IndexSpecifierList2,Allocator2>& y)
  {
    return get<0>(x) OP get<0>(y);
  }
// specialized algorithms:
template<typename Value,typename IndexSpecifierList,typename Allocator>
void swap(
  multi_index_container<Value,IndexSpecifierList,Allocator>& x,
  multi_index_container<Value,IndexSpecifierList,Allocator>& y)
  {
    x.swap(y);
  }
} // namespace boost::multi_index 
} // namespace boost

Complexity

В описаниях операций<multi_index_container>мы принимаем схему, изложенную вразделе подписи сложности.

Instantiation types

<multi_index_container>обозначается следующими типами:

  1. < [29] >—< [29] >< [29] >< [31] >< [32] >< [32] >.
  2. < [37] >,< [38] >< [38] >.< [39] >[< [40] >] [] [] []] []] []] [[[]]] [[[]]]] [[[]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[[]]]]] [[[]]]] [[[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[]]]] [[[[]]]]] [[[[]]]] [[[[]]]]] [[[[]]]]] [[[]]]] [[[]]] Для этого необходимо, чтобы< [41] >.
  3. < [53] >< [54] >[i][i]][allocator.requirements][i][i][i][i][i]][i][i][i][i]][i][i][i][i]][i][i][i]][i][i][i]][i][i][i]][i][i][i]][i][i][i]][i][i][i]][i][i][i]][i][i]][i][i][i]][i][i]][i][i][i]][i][i][i]][i][i]][i][i]][i][i][i]][i][i]][i][i]][i][i]][i][i]][i][i]][i][i]][i][i. Доказательство: СЭЛЛУБАЛЬНАЯ ДЕРЖАНИЕ В РЕЗУЛЬТАЦИИ:
    • СОГЛАШЕННОСТЬ В КОНДЕНЦИАЛЬНОМ КОНДЕРМЕ: В КОНДЕРЕ 2 ТЭДУСОЦИРОВАННЫЙ ВОПРОС.
    • Для того, чтобы< [61] >-х< [62] >-х< [62] >-х< [62] >-х< [62] >-х< [62] >-х< [62] >-х< [63] >-х< [63] >-х< [63] >-х< [64] >-х< [65] >,< [64] >-х< [65] >,
        -х]-х< [66] >-х< [66] >,< [68] >,< [64] >,< [70] >-х< [70] >.
Индексы данной<multi_index_container>инстанциации не могут иметь дубликатовметок, ни в пределах одного индекса, ни в двух разных индексах.Value— тип элементов, содержащихся в них.Valueдолжно бытьErasableотmulti_index_container.
  • IndexSpecifierListуказывает индексы, из которых состоитmulti_index_container. Он должен быть непустымMPL Forward Sequence(и, предпочтительно,MPL Random Access Sequence) указателей индекса. Для синтаксического удобстваindexed_byМожно использовать последовательность MPL.
  • Allocatorдолжен быть распределителемValueобъектов, удовлетворяющих соответствующим требованиям C++ по[allocator.requirements]. Допускаются следующие изменения стандартных требований:
    • Поддерживаются экземпляры с неравным распределением: замена двух экземпляров с неравным распределением не должна приводить к каким-либо исключениям.
    • Для каждого типаTтипAllocator::rebind<T>::other::pointerможет быть любым типом итератора случайного доступа, при условии, что он явно конструируется из буквального0(стоящего здесь в качестве нулевого указателя) или из любогоpтипаT*, указывающего на область, выделенную некоторым экземпляромAllocatorили каким-либо другим типом распределителя, отскакивающим отAllocator.pointer, построенный изp, должен относиться к*p.
  • Indices of a given multi_index_container instantiation cannot have duplicate tags, either within a single index or in two different indices. [ORIG_END] -->

    Nested types

    ctor_args_list
    Although the exact definition of ctor_args_list is implementation defined, from the user point of view this type can be treated as equivalent to ::boost::tuple<C0,...,CI-1>, where Ci is the ctor_args type of the i-th index held by the multi_index_container, in the same order as they were specified. Strictly speaking, there is an implicit conversion from const ::boost::tuple<C0,...,CI-1>& to const ctor_args_list&. This type is used for providing the construction arguments of the indices of the multi_index_container. ctor_args_list is DefaultConstructible, provided that all ctor_args types involved are DefaultConstructible.
    index_specifier_type_list
    Same type as IndexSpecifierList.
    index_type_list
    Model of MPL Random Access Sequence and MPL Extensible Sequence containing the types of the indices held by the multi_index_container, in the same order as they were specified.
    iterator_type_list
    Model of MPL Random Access Sequence and MPL Extensible Sequence containing the types of the iterators of the indices held by the multi_index_container, in the same order as they were specified.
    const_iterator_type_list
    Model of MPL Random Access Sequence and MPL Extensible Sequence containing the types of the constant iterators of the indices held by the multi_index_container, in the same order as they were specified.

    Nested class templates

    template<int N> struct nth_index
    nth_index<N>::type yields the type of the N-th (0-based) index held by the multi_index_container, in the same order as they were specified.
    Requires: 0 <= N < I.
    template<typename Tag> struct index
    index<Tag>::type yields the type of the index which has Tag as an associated tag type.
    Requires: Some index of the multi_index_container has Tag as an associated tag type.
    template<int N> struct nth_index_iterator
    nth_index_iterator<N>::type is equivalent to nth_index<N>::type::iterator.
    Note: The use of nth_index_iterator is deprecated.
    template<int N> struct nth_index_const_iterator
    nth_index_const_iterator<N>::type is equivalent to nth_index<N>::type::const_iterator.
    Note: The use of nth_index_const_iterator is deprecated.
    template<typename Tag> struct index_iterator
    index_iterator<Tag>::type is equivalent to index<Tag>::type::iterator.
    Note: The use of index_iterator is deprecated.
    template<typename Tag> struct index_const_iterator
    index_const_iterator<Tag>::type is equivalent to index<Tag>::type::const_iterator.
    Note: The use of index_const_iterator is deprecated.

    Constructors, copy and assignment

    explicit multi_index_container(
      const ctor_args_list& args_list=ctor_args_list(),
      const allocator_type& al=allocator_type());
    Effects: Constructs an empty multi_index_container using the specified argument list and allocator.
    Complexity: Constant.
    explicit multi_index_container(const allocator_type& al);
    Effects: Constructs an empty multi_index_container using the specified allocator and the default value of ctor_args_list.
    Complexity: Constant.
    template<typename InputIterator>
    multi_index_container(
      InputIterator first,InputIterator last,
      const ctor_args_list& args_list=ctor_args_list(),
      const allocator_type& al=allocator_type());
    Requires: InputIterator is an input iterator. Value is EmplaceConstructible into multi_index_container from *first. last is reachable from first.
    Effects: Constructs and empty multi_index_container using the specified argument list and allocator and fills it with the elements in the range [first,last). Insertion of each element may or may not succeed depending on the acceptance by all the indices of the multi_index_container.
    Complexity: O(m*H(m)), where m is the number of elements in [first,last).
    multi_index_container(
      std::initializer_list<Value> list,
      const ctor_args_list& args_list=ctor_args_list(),
      const allocator_type& al=allocator_type());
    Effects: Equivalent to multi_index_container(list.begin(),list.end(),args_list,al).
    multi_index_container(
      const multi_index_container<Value,IndexSpecifierList,Allocator>& x);
    Requires: Value is CopyInsertable into multi_index_container.
    Effects: Constructs a copy of x, copying its elements as well as its internal objects (those specified in ctor_args_list and the allocator.)
    Postconditions: *this==x. The order on every index of the multi_index_container is preserved as well.
    Complexity: O(x.size()*log(x.size()) + C(x.size())).
    multi_index_container(
      multi_index_container<Value,IndexSpecifierList,Allocator>&& x);
    Effects: Constructs a multi_index_container by moving the elements of x and copying its internal objects (those specified in ctor_args_list and the allocator.)
    Postconditions: If x==y just before the movement, *this==y. The order on every index of the multi_index_container is preserved as well.
    Complexity: Constant.
    ~multi_index_container()
    Effects: Destroys the multi_index_container and all the elements contained. The order in which the elements are destroyed is not specified.
    Complexity: O(n).
    multi_index_container<Value,IndexSpecifierList,Allocator>& operator=(
      const multi_index_container<Value,IndexSpecifierList,Allocator>& x);
    Requires: Value is CopyInsertable into multi_index_container.
    Effects: Replaces the elements and internal objects of the multi_index_container with copies from x.
    Postconditions: *this==x. The order on every index of the multi_index_container is preserved as well.
    Returns: *this.
    Complexity: O(n + x.size()*log(x.size()) + C(x.size())).
    Exception safety: Strong, provided the copy and assignment operations of the types of ctor_args_list do not throw.
    multi_index_container<Value,IndexSpecifierList,Allocator>& operator=(
      multi_index_container<Value,IndexSpecifierList,Allocator>&& x);
    Effects: Replaces the elements of multi_index_container with those of x and its internal objects with copies from the corresponding objects in x.
    Postconditions: If x==y just before the movement, *this==y. The order on every index of the multi_index_container is preserved as well.
    Returns: *this.
    Complexity: O(n).
    Exception safety: Strong, provided the copy and assignment operations of the types of ctor_args_list do not throw.
    multi_index_container<Value,IndexSpecifierList,Allocator>& operator=(
      std::initializer_list<Value> list);
    Requires: Value is CopyInsertable into multi_index_container.
    Effects: Replaces the elements the multi_index_container with copies of the elements of list, inserted in the specified order. Insertion of each element may or may not succeed depending on the acceptance by all the indices of the multi_index_container.
    Returns: *this.
    Complexity: O(n + I(m)), where m is the number of elements of list.
    Exception safety: Strong, provided the copy and assignment operations of the types of ctor_args_list do not throw.
    allocator_type get_allocator()const noexcept;
    Returns a copy of the allocator_type object used to construct the multi_index_container.
    Complexity: Constant.

    Index retrieval operations

    template<int N> typename nth_index<N>::type& get()noexcept;
    Requires: 0 <= N < I.
    Effects: Returns a reference to the nth_index<N>::type index held by *this.
    Complexity: Constant.
    template<int N> const typename nth_index<N>::type& get()const noexcept;
    Requires: 0 <= N < I.
    Effects: Returns a const reference to the nth_index<N>::type index held by *this.
    Complexity: Constant.
    template<typename Tag> typename index<Tag>::type& get()noexcept;
    Requires: Tag is such that index<Tag>::type is valid.
    Effects: Returns a reference to the index<Tag>::type index held by *this.
    Complexity: Constant.
    template<typename Tag> const typename index<Tag>::type& get()const noexcept;
    Requires: Tag is such that index<Tag>::type is valid.
    Effects: Returns a const reference to the index<Tag>::type index held by *this.
    Complexity: Constant.

    Projection operations

    Учитывая<multi_index_container>с индексами<i1>и<i2>, мы говорим, что<i1>-итератор<it1>и<i2>-итератор<it2>являютсяэквивалентными, если:

    • < [112] >и< [113] >,
    • < [116] >и< [117] >[] [] [].
    it1==i1.end()иit2==i2.end(),
  • ORit1иit2указывают на один и тот же элемент.
  • [ORIG_END] -->

    template<int N,typename IteratorType>
    typename nth_index<N>::type::iterator project(IteratorType it);
    Requires: 0 <= N < I. IteratorType belongs to iterator_type_list. it is a valid iterator of some index of *this (i.e. does not refer to some other multi_index_container.)
    Effects: Returns an nth_index<N>::type::iterator equivalent to it.
    Complexity: Constant.
    Exception safety: nothrow.
    template<int N,typename IteratorType>
    typename nth_index<N>::type::const_iterator project(IteratorType it)const;
    Requires: 0 <= N < I. IteratorType belongs to const_iterator_type_list or iterator_type_list. it is a valid (constant or non-constant) iterator of some index of *this (i.e. does not refer to some other multi_index_container.)
    Effects: Returns an nth_index<N>::type::const_iterator equivalent to it.
    Complexity: Constant.
    Exception safety: nothrow.
    template<typename Tag,typename IteratorType>
    typename index<Tag>::type::iterator project(IteratorType it);
    Requires: Tag is such that index<Tag>::type is valid. IteratorType belongs to iterator_type_list. it is a valid iterator of some index of *this (i.e. does not refer to some other multi_index_container.)
    Effects: Returns an index<Tag>::type::iterator equivalent to it.
    Complexity: Constant.
    Exception safety: nothrow.
    template<typename Tag,typename IteratorType>
    typename index<Tag>::type::const_iterator project(IteratorType it)const;
    Requires: Tag is such that index<Tag>::type is valid. IteratorType belongs to const_iterator_type_list or iterator_type_list. it is a valid (constant or non-constant) iterator of some index of *this (i.e. does not refer to some other multi_index_container.)
    Effects: Returns an index<Tag>::type::const_iterator iterator equivalent to it.
    Complexity: Constant.
    Exception safety: nothrow.

    Serialization

    <multi_index_container>s может быть заархивировано / извлечено с помощьюBoost.Serialization. Повышаю. MultiIndex не раскрывает интерфейс публичной сериализации, как это предусмотрено Boost. Сама сериализация. Поддерживаются как обычные, так и XML-архивы.

    Каждый из индексов, включающих данный<multi_index_container>, вносит свои собственные предварительные условия, а также гарантии на извлеченные контейнеры. При их описании используются следующие понятия. Тип<T>являетсясериализуемым(resp. XML-сериализируемым), если любой объект типа<T>может быть сохранен в выходной архив (архив XML) и позже извлечен из входного архива (архив XML), связанного с тем же хранилищем. Если<x'>типа<T>загружается из информации о сериализации, сохраненной от другого объекта<x>, мы говорим, что<x'>являетсявосстановленной копией<x>. Учитывая двоичный предикат<Pred>над<T>,<T>и объекты<p>и<q>типа<Pred>, мы говорим, что<q>являетсясериализацией-совместимойс<p>, если

    <p(x,y) == q(x',y')>
    для каждого<x>и<y>типа<T>и<x'>и<y'>восстанавливаются копии<x>и<y>соответственно.

    Operation: saving of a multi_index_container m to an output archive (XML archive) ar.
    Requires: Value is serializable (XML-serializable). Additionally, each of the indices of m can impose another requirements.
    Exception safety: Strong with respect to m. If an exception is thrown, ar may be left in an inconsistent state.
    Operation: loading of a multi_index_container m' from an input archive (XML archive) ar.
    Requires: Value is serializable (XML-serializable). Additionally, each of the indices of m' can impose another requirements.
    Exception safety: Basic. If an exception is thrown, ar may be left in an inconsistent state.



    Пересмотрено 12 октября 2013

    © Copyright 2003-2013 Joaquín M López Muñoz. Распространяется под лицензией Boost Software License, версия 1.0. (См. сопроводительный файлLICENSE_1_0.txtили копию на) http://www.boost.org/LICENSE_1_0.txt

    Статья Boost.MultiIndex Documentation - multi_index_container reference раздела Boost.MultiIndex Documentation - Reference может быть полезна для разработчиков на c++ и boost.




    Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



    :: Главная :: Boost.MultiIndex Documentation - Reference ::


    реклама


    ©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
    Top.Mail.Ru

    Время компиляции файла: 2024-08-30 11:47:00
    2025-05-20 01:33:06/0.0098550319671631/1