10 #include "boost/assert.hpp" 15 namespace vdj_pipe{
namespace detail{
19 template<
class Id,
class Obj,
template<
class,
class>
class Stor = std::vector >
21 typedef Stor<Obj, std::allocator<Obj> >
vector_t;
39 const_iterator
end()
const {
return vid_.end();}
55 value_type
const&
at(
const id_type
id)
const {
64 value_type&
at(
const id_type
id) {
73 value_type
const*
find(
const id_type
id)
const {
78 value_type*
find(
const id_type
id) {
83 id_type
insert(value_type
const& obj) {
91 const std::size_t
n =
vpos(
id);
92 BOOST_ASSERT(
vid_.size() >
n);
102 const std::size_t
n =
vpos(
id);
111 const std::size_t pos =
vpos(
id);
126 std::size_t
vpos(
const id_type
id)
const {
127 BOOST_ASSERT(
id >= id0_ &&
"invalid ID");
128 return id() -
id0_();
134 return id >= id0_ &&
vpos(
id) < vid_.size();
void clear()
Definition: id_map.hpp:116
Id_map(const id_type id0)
Definition: id_map.hpp:31
Obj value_type
Definition: id_map.hpp:26
base_exception Err
Definition: id_map.hpp:29
Id id_type
Definition: id_map.hpp:25
std::size_t size() const
Definition: id_map.hpp:37
vector_t::iterator iterator
Definition: id_map.hpp:27
const_iterator begin() const
Definition: id_map.hpp:38
std::size_t size() const
Definition: vector_set.hpp:34
const_iterator end() const
Definition: id_map.hpp:39
value_type const * find(const id_type id) const
Definition: id_map.hpp:73
boost::error_info< struct errinfo_int1_, int > int1_t
Definition: exception.hpp:28
void clear()
Definition: vector_set.hpp:38
std::size_t vpos(const id_type id) const
Definition: id_map.hpp:126
Main namespace of vdj_pipe library.
Definition: keywords_variable.hpp:11
vector_t::const_iterator const_iterator
Definition: id_map.hpp:28
void insert(Iter i1, Iter i2)
Definition: vector_set.hpp:40
void reserve(const id_type id)
Definition: id_map.hpp:43
Definition: id_map.hpp:20
id_type min_id() const
Definition: id_map.hpp:41
Stor< Obj, std::allocator< Obj > > vector_t
Definition: id_map.hpp:21
value_type & at(const id_type id)
Definition: id_map.hpp:64
value_type const & operator[](const id_type id) const
Definition: id_map.hpp:45
const std::size_t n
Definition: vector_set_test.cpp:26
id_type pos2id(const std::size_t n) const
Definition: id_map.hpp:131
bool empty() const
Definition: vector_set.hpp:35
value_type const & back() const
Definition: vector_set.hpp:33
value_type & insert(const id_type id)
Definition: id_map.hpp:101
value_type & operator[](const id_type id)
Definition: id_map.hpp:50
Definition: exception.hpp:23
void erase(const id_type id)
Definition: id_map.hpp:109
bool empty() const
Definition: id_map.hpp:40
boost::error_info< struct errinfo_message_, std::string > msg_t
Definition: exception.hpp:24
value_type const & at(const id_type id) const
Definition: id_map.hpp:55
id_type max_id() const
Definition: id_map.hpp:42
bool check_range(const id_type id) const
Definition: id_map.hpp:133
id_type id0_
Definition: id_map.hpp:124
Vector_set< id_type > erased_
Definition: id_map.hpp:123
vector_t vid_
Definition: id_map.hpp:122
value_type * find(const id_type id)
Definition: id_map.hpp:78
id_type insert(value_type const &obj)
Definition: id_map.hpp:83
Id_map self_type
Definition: id_map.hpp:24
void pop_back()
Definition: vector_set.hpp:37
unsigned erase(CompatType const &t)
Definition: vector_set.hpp:58