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

PrevUpHomeNext

Class template iset_index

boost::interprocess::iset_index

Synopsis

// In header: <boost/interprocess/indexes/iset_index.hpp>

template<typename MapConfig> 
class iset_index : private iset_index_aux::index_t {
public:
  // types
  typedef index_type::iterator           iterator;          
  typedef index_type::const_iterator     const_iterator;    
  typedef index_type::insert_commit_data insert_commit_data;
  typedef index_type::value_type         value_type;        
  typedef MapConfig::compare_key_type    compare_key_type;  
  typedef value_type                     index_data_t;      

  // public member functions
  iset_index(typename MapConfig::segment_manager_base *);
  void reserve(typename MapConfig::segment_manager_base::size_type);
  void shrink_to_fit();
  iterator find(const compare_key_type &);
  const_iterator find(const compare_key_type &) const;
  std::pair< iterator, bool > 
  insert_check(const compare_key_type &, insert_commit_data &);
  iterator insert_commit(const compare_key_type &, void *, index_data_t &, 
                         insert_commit_data &);
};

Description

Index type based in boost::intrusive::set. Just derives from boost::intrusive::set and defines the interface needed by managed memory segments*<zwj></zwj>/

iset_index public member functions

  1. iset_index(typename MapConfig::segment_manager_base *);

    Constructor. Takes a pointer to the segment manager. Can throw

  2. void reserve(typename MapConfig::segment_manager_base::size_type);

    This reserves memory to optimize the insertion of n elements in the index

  3. void shrink_to_fit();
    This frees all unnecessary memory.
  4. iterator find(const compare_key_type & key);
  5. const_iterator find(const compare_key_type & key) const;
  6. std::pair< iterator, bool > 
    insert_check(const compare_key_type & key, insert_commit_data & commit_data);
  7. iterator insert_commit(const compare_key_type &, void *, index_data_t & v, 
                           insert_commit_data & commit_data);

PrevUpHomeNext