1#ifndef PSCF_FFTW_DR_ARRAY_H
2#define PSCF_FFTW_DR_ARRAY_H
11#include <util/containers/Array.h>
12#include <util/misc/ReferenceCounter.h>
13#include <util/misc/CountedReference.h>
70 template <
typename Data>
228 template <
class Archive>
229 void serialize(Archive& ar,
const unsigned int version);
262 CountedReference ref_;
278 template <
typename Data>
inline
280 {
return ((
bool)
data_ && !ref_.isAssociated()); }
285 template <
typename Data>
inline
287 {
return ((
bool)
data_ && ref_.isAssociated()); }
292 template <
typename Data>
293 template <
class Archive>
295 const unsigned int version)
298 if (Archive::is_saving()) {
305 if (Archive::is_loading()) {
325#include "FftwDRArray.tpp"
virtual void deallocate()
Dellocate an underlying C array that is owned by this container.
FftwDRArray< Data > & operator=(FftwDRArray< Data > const &other)
Assignment from another FftwDRArray<Data> container.
void dissociate()
Dissociate this object from an externally owned array slice.
Data ValueType
Data type of each array element.
bool isAssociated() const
Is this container associated with a C array it does not own?
FftwDRArray()
Default constructor.
void associate(FftwDRArray< Data > &other, int beginId, int capacity)
Associate this object with a slice of a different FftwDRArray.
void serialize(Archive &ar, const unsigned int version)
Serialize an FftwDRArray to/from an Archive.
void allocate(int capacity)
Allocate an underlying C array, which this container then owns.
bool isOwner() const
Does this container own a dynamically allocated C array?
Data * data_
Pointer to an array of Data elements.
int capacity() const
Return allocated size.
bool isAllocated() const
Does this array have associated data?
int capacity_
Allocated size of the data_ array.
bool hasRefs() const
Does this counter have references (is nRef > 0)?
ReferenceCounter()
Constructor.
int nRef() const
Get the number of references to a shareable resource.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
PSCF package top-level namespace.