PHX::ContiguousAllocator< AlignmentT > Class Template Reference

Class that allocates a contiguous chunk of memory for all fields. More...

#include <Phalanx_Allocator_Contiguous.hpp>

List of all members.

Public Member Functions

 ContiguousAllocator ()
 ~ContiguousAllocator ()
void reset ()
void addRequiredChunk (std::size_t size_of_data_type, std::size_t num_elements)
 data_type_size is the size of a single element of the data type and num_elements is the number of elements of the data type that need to be allocated.
void setup ()
 Called after all byte requirements are registered. Allocates the contiguous array.
template<class DataT >
Teuchos::ArrayRCP< DataT > allocate (std::size_t num_elements)
int getTotalBytes () const

Private Attributes

bool setup_called_
long int total_bytes_
int offset_
Teuchos::ArrayRCP< char > chunk_


Detailed Description

template<typename AlignmentT>
class PHX::ContiguousAllocator< AlignmentT >

Class that allocates a contiguous chunk of memory for all fields.

This class will allocate all fields for all data types in one contiguous chunk of memory. It is templated on AlignmentT which is the size that all variables should be aligned on.


Constructor & Destructor Documentation

template<typename AlignmentT >
PHX::ContiguousAllocator< AlignmentT >::ContiguousAllocator (  )  [inline]

References PHX::ContiguousAllocator< AlignmentT >::reset().

Here is the call graph for this function:

template<typename AlignmentT >
PHX::ContiguousAllocator< AlignmentT >::~ContiguousAllocator (  )  [inline]


Member Function Documentation

template<typename AlignmentT >
void PHX::ContiguousAllocator< AlignmentT >::addRequiredChunk ( std::size_t  size_of_data_type,
std::size_t  num_elements 
) [inline]

data_type_size is the size of a single element of the data type and num_elements is the number of elements of the data type that need to be allocated.

References PHX::ContiguousAllocator< AlignmentT >::setup_called_, and PHX::ContiguousAllocator< AlignmentT >::total_bytes_.

template<typename AlignmentT >
template<class DataT >
Teuchos::ArrayRCP<DataT> PHX::ContiguousAllocator< AlignmentT >::allocate ( std::size_t  num_elements  )  [inline]

template<typename AlignmentT >
int PHX::ContiguousAllocator< AlignmentT >::getTotalBytes (  )  const [inline]

template<typename AlignmentT >
void PHX::ContiguousAllocator< AlignmentT >::reset (  )  [inline]

template<typename AlignmentT >
void PHX::ContiguousAllocator< AlignmentT >::setup (  )  [inline]

Called after all byte requirements are registered. Allocates the contiguous array.

References PHX::ContiguousAllocator< AlignmentT >::chunk_, PHX::ContiguousAllocator< AlignmentT >::setup_called_, and PHX::ContiguousAllocator< AlignmentT >::total_bytes_.


Member Data Documentation

template<typename AlignmentT >
Teuchos::ArrayRCP<char> PHX::ContiguousAllocator< AlignmentT >::chunk_ [private]

template<typename AlignmentT >
int PHX::ContiguousAllocator< AlignmentT >::offset_ [private]

template<typename AlignmentT >
bool PHX::ContiguousAllocator< AlignmentT >::setup_called_ [private]

template<typename AlignmentT >
long int PHX::ContiguousAllocator< AlignmentT >::total_bytes_ [private]


The documentation for this class was generated from the following file:

Generated on Thu Dec 17 11:06:13 2009 for Phalanx by  doxygen 1.5.9