blitz  Version 1.0.2
blitz::MemoryBlock< P_type > Class Template Reference

#include <memblock.h>

Inheritance diagram for blitz::MemoryBlock< P_type >:
Inheritance graph
Collaboration diagram for blitz::MemoryBlock< P_type >:
Collaboration graph

Public Types

typedef P_type T_type
 

Protected Member Functions

 MemoryBlock (sizeType items)
 
 MemoryBlock (sizeType length, T_type *data)
 Constructor for a preallocated block that should be deleted when we are done? More...
 
virtual ~MemoryBlock ()
 
bool doLock (bool lockingPolicy)
 
void addReference ()
 
T_type *restrict data ()
 
const T_type *restrict data () const
 
T_type *& dataBlockAddress ()
 
sizeType length () const
 
int removeReference ()
 
int references () const
 
void allocate (sizeType length)
 
void deallocate ()
 

Private Member Functions

 MemoryBlock (const MemoryBlock< T_type > &)
 
void operator= (const MemoryBlock< T_type > &)
 
 MemoryBlock ()
 The default constructor is needed for serialization. More...
 

Private Attributes

bool allocatedByUs_
 Keeps track of whether the block was preallocated or not. More...
 
union {
   T_type *restrict   data_
 
   simdTypes< T_type >::vecType *restrict   data_tv_
 
   char *restrict   data_char_
 
}; 
 
union {
   T_type *   dataBlockAddress_
 
   simdTypes< T_type >::vecType *restrict   dBA_tv_
 
   char *   dBA_char_
 
}; 
 
sizeType length_
 

Friends

class MemoryBlockReference< P_type >
 

Member Typedef Documentation

template<typename P_type>
typedef P_type blitz::MemoryBlock< P_type >::T_type

Constructor & Destructor Documentation

template<typename P_type>
blitz::MemoryBlock< P_type >::MemoryBlock ( sizeType  items)
inlineexplicitprotected
template<typename P_type>
blitz::MemoryBlock< P_type >::MemoryBlock ( sizeType  length,
T_type data 
)
inlineprotected

Constructor for a preallocated block that should be deleted when we are done?

template<typename P_type>
virtual blitz::MemoryBlock< P_type >::~MemoryBlock ( )
inlineprotectedvirtual
template<typename P_type>
blitz::MemoryBlock< P_type >::MemoryBlock ( const MemoryBlock< T_type > &  )
inlineprivate
template<typename P_type>
blitz::MemoryBlock< P_type >::MemoryBlock ( )
inlineprivate

The default constructor is needed for serialization.

Member Function Documentation

template<typename P_type>
void blitz::MemoryBlock< P_type >::addReference ( )
inlineprotected
template<typename P_type>
void blitz::MemoryBlock< P_type >::allocate ( sizeType  length)
inlineprotected
template<typename P_type>
const T_type* restrict blitz::MemoryBlock< P_type >::data ( ) const
inlineprotected
template<typename P_type>
T_type*& blitz::MemoryBlock< P_type >::dataBlockAddress ( )
inlineprotected
template<typename P_type>
void blitz::MemoryBlock< P_type >::deallocate ( )
protected
template<typename P_type>
bool blitz::MemoryBlock< P_type >::doLock ( bool  lockingPolicy)
inlineprotected
template<typename P_type>
sizeType blitz::MemoryBlock< P_type >::length ( ) const
inlineprotected
template<typename P_type>
void blitz::MemoryBlock< P_type >::operator= ( const MemoryBlock< T_type > &  )
inlineprivate
template<typename P_type>
int blitz::MemoryBlock< P_type >::references ( ) const
inlineprotected
template<typename P_type>
int blitz::MemoryBlock< P_type >::removeReference ( )
inlineprotected

Friends And Related Function Documentation

template<typename P_type>
friend class MemoryBlockReference< P_type >
friend

Member Data Documentation

union { ... }
union { ... }
template<typename P_type>
bool blitz::MemoryBlock< P_type >::allocatedByUs_
private

Keeps track of whether the block was preallocated or not.

This affects potential alignment so must be taken into account when we delete.

Referenced by blitz::MemoryBlock< T_type >::MemoryBlock().

template<typename P_type>
char* restrict blitz::MemoryBlock< P_type >::data_char_
template<typename P_type>
simdTypes<T_type>::vecType* restrict blitz::MemoryBlock< P_type >::data_tv_
template<typename P_type>
char* blitz::MemoryBlock< P_type >::dBA_char_
template<typename P_type>
simdTypes<T_type>::vecType* restrict blitz::MemoryBlock< P_type >::dBA_tv_

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