CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::Chunk4< Data1, Data2, Data3, Data4 > Struct Template Referencefinal

#include <chunk.hpp>

Inheritance diagram for codi::Chunk4< Data1, Data2, Data3, Data4 >:

Public Types

using Base = ChunkBase
 Abbreviation for the base class type.
 

Public Member Functions

 Chunk4 (size_t const &size)
 Constructor.
 
 ~Chunk4 ()
 Destructor.
 
- Public Member Functions inherited from codi::ChunkBase
 ChunkBase (size_t const &size)
 Constructor.
 
virtual ~ChunkBase ()
 Destructor.
 
template<typename... Data>
void pushData (Data &&... dataEntries)
 provided.
 
template<typename... Pointers>
void dataPointer (size_t const &index, Pointers *&... pointers)
 
void swap (ImplProxy &other)
 Swap data with other chunk of the same type.
 
size_t getSize () const
 Get the allocated size.
 
size_t getUnusedSize () const
 Number of unused data items.
 
size_t getUsedSize () const
 Number of used data items.
 
void reset ()
 Sets the number of used items to zero.
 
void resize (size_t newSize)
 Resize the allocated data. Stored data is lost. Used size is set to zero.
 
void setUsedSize (size_t const &usage)
 Set the used size.
 

ChunkBase interface implementation

static size_t constexpr EntrySize
 Total size of all data in one entry.
 
void allocateData ()
 Allocated the data if it was deallocated before.
 
void dataPointer (size_t const &index, Data1 *&pointer1, Data2 *&pointer2, Data3 *&pointer3, Data4 *&pointer4)
 
void deleteData ()
 Delete the allocated data.
 
void erase (size_t const &start, size_t const &end)
 Erase data items start, ..., end - 1.
 
void pushData (Data1 const &value1, Data2 const &value2, Data3 const &value3, Data4 const &value4)
 provided.
 
void readData (FileIo &handle)
 Read data from the FileIo handle.
 
void swap (Chunk4< Data1, Data2, Data3, Data4 > &other)
 Swap data with other chunk of the same type.
 
void writeData (FileIo &handle) const
 Write data to the FileIo handle.
 

Additional Inherited Members

- Static Public Attributes inherited from codi::ChunkBase
static size_t constexpr EntrySize = false
 Total size of all data in one entry.
 
- Protected Member Functions inherited from codi::ChunkBase
void swap (ChunkBase &other)
 Swap the entries of this base class.
 
- Protected Attributes inherited from codi::ChunkBase
size_t size
 Maximum size of arrays.
 
size_t usedSize
 Currently used size.
 

Detailed Description

template<typename Data1, typename Data2, typename Data3, typename Data4>
struct codi::Chunk4< Data1, Data2, Data3, Data4 >

@ brief Chunk with four entries per item.

Template Parameters
Chunk1Any type.
Chunk2Any type.
Chunk3Any type.
Chunk4Any type.

Member Function Documentation

◆ allocateData()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::allocateData ( )
inlinevirtual

Allocated the data if it was deallocated before.

Implements codi::ChunkBase.

◆ dataPointer()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::dataPointer ( size_t const & index,
Data1 *& pointer1,
Data2 *& pointer2,
Data3 *& pointer3,
Data4 *& pointer4 )
inline

Extract pointer to requested position. For each entry one argument has to be provided.

◆ deleteData()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::deleteData ( )
inlinevirtual

Delete the allocated data.

Implements codi::ChunkBase.

◆ erase()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::erase ( size_t const & start,
size_t const & end )
inlinevirtual

Erase data items start, ..., end - 1.

Implements codi::ChunkBase.

◆ pushData()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::pushData ( Data1 const & value1,
Data2 const & value2,
Data3 const & value3,
Data4 const & value4 )
inline

provided.

Add one data item. For each entry one argument has to be

◆ readData()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::readData ( FileIo & handle)
inlinevirtual

Read data from the FileIo handle.

Implements codi::ChunkBase.

◆ swap()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::swap ( Chunk4< Data1, Data2, Data3, Data4 > & other)
inline

Swap data with other chunk of the same type.

◆ writeData()

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
void codi::Chunk4< Data1, Data2, Data3, Data4 >::writeData ( FileIo & handle) const
inlinevirtual

Write data to the FileIo handle.

Implements codi::ChunkBase.

Member Data Documentation

◆ EntrySize

template<typename Data1 , typename Data2 , typename Data3 , typename Data4 >
size_t constexpr codi::Chunk4< Data1, Data2, Data3, Data4 >::EntrySize
staticconstexpr
Initial value:
=
sizeof(Data1) + sizeof(Data2) + sizeof(Data3) + sizeof(Data4)

Total size of all data in one entry.


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