9#ifndef __stir_copy_fill__H__
10#define __stir_copy_fill__H__
37 template <
typename iterT>
38 static iterT copy_to(
const T& stir_object, iterT iter)
40 return std::copy(stir_object.begin_all(), stir_object.end_all(), iter);
42 template <
typename iterT>
43 static void fill_from(T& stir_object, iterT iter, iterT iter_end)
45 std::copy(iter, iter_end, stir_object.begin_all());
52template <
int num_dimensions,
class elemT>
57 template <
typename iterT>
58 static iterT copy_to(
const Array_type& stir_array, iterT iter)
64 auto ret = std::copy(beg, beg + stir_array.
size_all(), iter);
75 template <
typename iterT>
76 static void fill_from(Array_type& stir_array, iterT iter, iterT iter_end)
87 std::copy(iter, iter_end, stir_array.
begin_all());
98 template <
typename iterT>
99 static iterT copy_to(
const ProjData& stir_object, iterT iter)
105 return CopyFill<ProjDataInMemory>::copy_to(*pdm_ptr, iter);
111 return stir_object.
copy_to(iter);
115 template <
typename iterT>
116 static void fill_from(
ProjData& stir_object, iterT iter, iterT iter_end)
119 CopyFill<ProjDataInMemory>::fill_from(*pdm_ptr, iter, iter_end);
131template <
typename T,
typename iterT>
135 return CopyFill<T>::copy_to(stir_object, iter);
142template <
typename T,
typename iterT>
147 CopyFill<T>::fill_from(stir_object, iter, iter_end);
defines the stir::Array class for multi-dimensional (numeric) arrays
Declaration of class stir::ProjDataInMemory.
This class defines multi-dimensional (numeric) arrays.
Definition Array.h:78
full_iterator begin_all()
start value for iterating through all elements in the array, see full_iterator
Definition Array.inl:213
bool is_contiguous() const
return if the array is contiguous in memory
Definition Array.inl:44
size_t size_all() const
return the total number of elements in this array
Definition Array.inl:262
const elemT * get_const_full_data_ptr() const
member function for access to the data via a const elemT*
Definition Array.inl:311
void release_full_data_ptr()
signal end of access to elemT*
Definition Array.inl:329
elemT * get_full_data_ptr()
member function for access to the data via a elemT*
Definition Array.inl:292
void release_const_full_data_ptr() const
signal end of access to const elemT*
Definition Array.inl:345
full_iterator end_all()
end value for iterating through all elements in the array, see full_iterator
Definition Array.inl:185
A class which reads/writes projection data from/to memory.
Definition ProjDataInMemory.h:39
The (abstract) base class for the projection data.
Definition ProjData.h:105
iterT copy_to(iterT array_iter) const
Copy all bins to a range specified by a (forward) iterator.
Definition ProjData.h:310
iterT fill_from(iterT array_iter)
set all bins from an array iterator
Definition ProjData.h:277
iterT copy_to(const T &stir_object, iterT iter)
Copy all bins to a range specified by a iterator.
Definition copy_fill.h:133
void fill_from(T &stir_object, iterT iter, iterT iter_end)
set all elements of stir_object from an iterator
Definition copy_fill.h:144
Helper class for stir::copy_to and stir::fill_from.
Definition copy_fill.h:36