1 #ifndef UTIL_FP_ARRAY_H 2 #define UTIL_FP_ARRAY_H 11 #include <util/containers/PArrayIterator.h> 12 #include <util/containers/ConstPArrayIterator.h> 39 template <
typename Data,
int Capacity>
138 template <
typename Data,
int Capacity>
146 template<
typename Data,
int Capacity>
152 for (i = 0; i < other.
size_; ++i) {
158 if (Capacity >
size_) {
159 for (i =
size_; i < Capacity; ++i) {
169 template <
typename Data,
int Capacity>
175 if (
this == &other)
return *
this;
178 if (Capacity < other.
size_) {
183 for (
int i = 0; i < other.
size_; ++i) {
189 if (Capacity >
size_) {
190 for (
int i =
size_; i < Capacity; ++i) {
201 template <
typename Data,
int Capacity>
208 template <
typename Data,
int Capacity>
215 template <
typename Data,
int Capacity>
222 template <
typename Data,
int Capacity>
233 template <
typename Data,
int Capacity>
247 template <
typename Data,
int Capacity>
261 template <
typename Data,
int Capacity>
274 template <
typename Data,
int Capacity>
277 if (
size_ == Capacity) {
287 template <
typename Data,
int Capacity>
291 for (
int i=0; i < Capacity; ++i) {
void append(Data &data)
Append an element to the end of the array.
Statically allocated pointer array.
int capacity() const
Return physical capacity of array.
Forward iterator for a PArray.
File containing preprocessor macros for error handling.
void setCurrent(Data **ptr)
Set the current pointer value.
int size() const
Return logical size of this array.
Data & operator[](int i)
Get an element by reference (mimic C-array subscripting).
#define UTIL_THROW(msg)
Macro for throwing an Exception, reporting function, file and line number.
void clear()
Set logical size to zero and nullify all elements.
void setEnd(Data **ptr)
Set the value of the end pointer.
Utility classes for scientific computation.
Forward iterator for a PArray.
void begin(PArrayIterator< Data > &iterator)
Set an iterator to begin this container.
FPArray()
Default constructor.
Data * ptrs_[Capacity]
Array of pointers to Data objects.
int size_
Logical size of array (number of elements used).
void setEnd(Data **ptr)
Set the value of the end pointer.
FPArray< Data, Capacity > & operator=(const FPArray< Data, Capacity > &other)
Assignment, element by element.
void setCurrent(Data **ptr)
Set the current pointer value.