Proxy type representing a local view on a referenced dash::List
.
More...
#include <LocalListRef.h>
template<typename T, class LMemSpace>
class dash::LocalListRef< T, LMemSpace >
Proxy type representing a local view on a referenced dash::List
.
- Implemented concept:
- List Concept
Definition at line 33 of file ListRef.h.
◆ index_type
template<typename T, class LMemSpace>
◆ value_type
template<typename T, class LMemSpace>
Type definitions required for std::list concept:
Definition at line 62 of file LocalListRef.h.
◆ LocalListRef() [1/2]
template<typename T, class LMemSpace>
Constructor, creates a local access proxy for the given list.
Definition at line 82 of file LocalListRef.h.
◆ LocalListRef() [2/2]
template<typename T, class LMemSpace>
- Parameters
-
list | Pointer to list instance referenced by this view. |
viewspec | The view's offset and extent within the referenced list. |
Definition at line 87 of file LocalListRef.h.
◆ back()
template<typename T, class LMemSpace>
Accesses the last element in the list.
Definition at line 211 of file LocalListRef.h.
214 "dash::LocalListRef._back is not implemented");
◆ begin()
template<typename T, class LMemSpace>
Pointer to initial local element in the list.
Definition at line 99 of file LocalListRef.h.
101 return _list->_lbegin;
◆ end()
template<typename T, class LMemSpace>
Pointer past final local element in the list.
Definition at line 107 of file LocalListRef.h.
◆ front()
template<typename T, class LMemSpace>
Accesses the first element in the list.
Definition at line 242 of file LocalListRef.h.
245 "dash::LocalListRef.front is not implemented");
◆ insert()
template<typename T, class LMemSpace>
- Parameters
-
position | Position in the list where the new element is inserted. |
value | Value to be copied in the inserted element. |
Definition at line 112 of file LocalListRef.h.
118 DASH_LOG_TRACE(
"LocalListRef.insert()");
121 node.lprev =
nullptr;
122 node.lnext =
nullptr;
125 iterator it_insert_end = _list->_end;
127 "dash::LocalListRef.pop_back is not implemented");
129 DASH_LOG_TRACE(
"LocalListRef.insert >");
130 return it_insert_end;
◆ is_local()
template<typename T, class LMemSpace>
Checks whether the given global index is local to the calling unit.
- Returns
- True
- Parameters
-
global_index | A global list index |
Definition at line 261 of file LocalListRef.h.
◆ pop_back()
template<typename T, class LMemSpace>
Removes and destroys the last element in the list, reducing the container size by one.
Definition at line 202 of file LocalListRef.h.
205 "dash::LocalListRef.pop_back is not implemented");
◆ pop_front()
template<typename T, class LMemSpace>
Removes and destroys the first element in the list, reducing the container size by one.
Definition at line 233 of file LocalListRef.h.
236 "dash::LocalListRef.pop_front is not implemented");
◆ push_back()
template<typename T, class LMemSpace>
Inserts a new element at the end of the list, after its current last element.
The content of value
is copied or moved to the inserted element. Increases the container size by one.
Definition at line 139 of file LocalListRef.h.
141 DASH_LOG_TRACE(
"LocalListRef.push_back()");
143 ListNode_t * node_lptr =
nullptr;
147 node.lprev =
nullptr;
148 node.lnext =
nullptr;
152 auto l_cap_old = _list->_globmem->
local_size();
154 auto l_size_old = _list->_local_sizes.
local[0];
156 _list->_local_sizes.
local[0]++;
158 auto l_size_new = _list->_local_sizes.
local[0];
160 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", l_cap_old);
161 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", l_size_old);
162 if (l_size_new > l_cap_old) {
163 DASH_LOG_TRACE(
"LocalListRef.push_back",
164 "globmem.grow(", _list->_local_buffer_size,
")");
166 node_lptr =
static_cast<ListNode_t *
>(
167 _list->_globmem->
grow(_list->_local_buffer_size));
168 DASH_ASSERT_GT(_list->_globmem->
local_size(), l_cap_old,
169 "local capacity not increased after globmem.grow()");
172 node_lptr =
static_cast<ListNode_t *
>(
173 _list->_globmem->
lbegin() + l_size_old);
176 auto l_cap_new = _list->_globmem->
local_size();
177 DASH_LOG_TRACE(
"LocalListRef.push_back",
178 "node target address:", node_lptr);
179 if (l_size_old > 0) {
181 node.lprev =
static_cast<ListNode_t *
>(
182 _list->_globmem->
lbegin() + (l_size_old - 1));
184 DASH_ASSERT(node.lprev->lnext ==
nullptr);
185 node.lprev->lnext = node_lptr;
186 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", node.lprev->lnext);
188 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", node.lprev);
189 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", node.value);
190 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", node.lnext);
193 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", l_cap_new);
194 DASH_LOG_TRACE_VAR(
"LocalListRef.push_back", l_size_new);
195 DASH_LOG_TRACE(
"LocalListRef.push_back >");
local_pointer grow(size_type num_elements)
Increase capacity of local segment of global memory region by the given number of elements...
constexpr size_type local_size() const noexcept
Number of elements in local memory space.
local_pointer & lbegin() noexcept
Native pointer of the initial address of the local memory of the unit that initialized this GlobHeapM...
local_type local
Local proxy object, allows use in range-based for loops.
◆ push_front()
template<typename T, class LMemSpace>
Inserts a new element at the beginning of the list, before its current first element.
The content of value
is copied or moved to the inserted element. Increases the container size by one.
Definition at line 223 of file LocalListRef.h.
226 "dash::ListLocalRef.push_front is not implemented");
◆ size()
template<typename T, class LMemSpace>
Number of list elements in local memory.
Definition at line 251 of file LocalListRef.h.
253 return _list->
lsize();
constexpr size_type lsize() const noexcept
The number of elements in the local part of the list.
The documentation for this class was generated from the following files: