46 const Int32* ARCANE_RESTRICT local_ids,
47 Integer index,Int32 local_id_offset)
48 : m_items(items), m_local_ids(local_ids), m_index(index), m_local_id_offset(local_id_offset){}
55 typedef std::random_access_iterator_tag iterator_category;
67 value_type operator*()
const {
return m_items[ m_local_id_offset + m_local_ids[m_index] ]; }
68 value_type operator->()
const {
return m_items[ m_local_id_offset + m_local_ids[m_index] ]; }
69 ThatClass& operator++() { ++m_index;
return (*
this); }
70 ThatClass& operator--() { --m_index;
return (*
this); }
73 friend Integer operator-(
const ThatClass& a,
const ThatClass& b)
75 return a.m_index - b.m_index;
80 return ThatClass(a.m_items,a.m_local_ids,index,a.m_local_id_offset);
85 return ThatClass(a.m_items,a.m_local_ids,index,a.m_local_id_offset);
87 friend bool operator<(
const ThatClass& lhs,
const ThatClass& rhs)
89 return lhs.m_index<=rhs.m_index;
91 friend bool operator==(
const ThatClass& lhs,
const ThatClass& rhs)
96 return lhs.m_items==rhs.m_items && lhs.m_local_ids==rhs.m_local_ids && lhs.m_index==rhs.m_index;
98 friend bool operator!=(
const ThatClass& lhs,
const ThatClass& rhs)
105 const ItemInternalPtr* m_items;
106 const Int32* ARCANE_RESTRICT m_local_ids;
108 Int32 m_local_id_offset = 0;
145 : m_local_ids(local_ids)
147 , m_local_id_offset(local_id_offset)
149 ARCANE_ASSERT(_isValid(), (
"Bad ItemInternalVectorView"));
154 : m_local_ids(count, local_ids)
156 , m_local_id_offset(local_id_offset)
158 ARCANE_ASSERT(_isValid(), (
"Bad ItemInternalVectorView"));
163 : m_local_ids(local_ids._idsWithoutOffset())
165 , m_local_id_offset(local_ids.m_local_id_offset)
167 ARCANE_ASSERT(_isValid(), (
"Bad ItemInternalVectorView"));
171 : m_local_ids(view.constLocalIds())
172 , m_shared_info(view.m_shared_info)
173 , m_local_id_offset(view.m_local_id_offset)
179 Integer
size()
const {
return m_local_ids.size(); }
193 ARCANE_DEPRECATED_REASON(
"Y2022: Use ItemVectorView::operator[] instead")
194 ItemInternal* operator[](Integer index)
const {
return m_shared_info->m_items_internal[m_local_ids[index]]; }
197 ARCANE_DEPRECATED_REASON(
"Y2022: Do not use this method")
200 ARCANE_DEPRECATED_REASON(
"Y2022: Use ItemVectorView to iterate")
201 const_iterator begin()
const
203 return const_iterator(_items().data(), m_local_ids.data(), 0, m_local_id_offset);
206 ARCANE_DEPRECATED_REASON(
"Y2022: Use ItemVectorView to iterate")
207 const_iterator end()
const
209 return const_iterator(_items().data(), m_local_ids.data(), this->size(), m_local_id_offset);
214 Int32 localIdOffset()
const {
return m_local_id_offset; }
219 ItemSharedInfo* m_shared_info = ItemSharedInfo::nullInstance();
220 Int32 m_local_id_offset = 0;
225 ItemInternalArrayView _items()
const {
return m_shared_info->m_items_internal; }