walberla::domain_decomposition::internal::BlockData Class Reference

Detailed Description

wrapper class for any kind of block data (used only internally, never to be seen in the interface of public member functions) see: http://www.drdobbs.com/cpp/twisting-the-rtti-system-for-safe-dynami/229401004#

#include <IBlock.h>

+ Inheritance diagram for walberla::domain_decomposition::internal::BlockData:

Classes

class  Data
 
class  DataBase
 

Public Member Functions

template<typename T >
 BlockData (T *ptr)
 
 ~BlockData ()
 
bool operator== (const BlockData &rhs) const
 
bool operator!= (const BlockData &rhs) const
 
template<typename U >
const U * get () const
 
template<typename U >
U * get ()
 
template<typename U >
const U * uncheckedFastGet () const
 Attention: Calling this function ONLY works if type U is identical to the type T that was once added. More...
 
template<typename U >
U * uncheckedFastGet ()
 Attention: Calling this function ONLY works if type U is identical to the type T that was once added. More...
 
template<typename U >
bool isOfType () const
 
template<typename U >
bool isClassOrSubclassOf () const
 
template<typename U >
bool isSubclassOf () const
 
bool isOfSameType (const BlockData &bd) const
 

Static Private Member Functions

template<typename T >
static void thrower (void *ptr)
 

Private Attributes

DataBasedata_
 
void * ptr_
 
void(* thr_ )(void *)
 
std::string typeInfo_
 

Additional Inherited Members

- Private Member Functions inherited from walberla::NonCopyable
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 

Constructor & Destructor Documentation

◆ BlockData()

template<typename T >
walberla::domain_decomposition::internal::BlockData::BlockData ( T *  ptr)
inline

◆ ~BlockData()

walberla::domain_decomposition::internal::BlockData::~BlockData ( )
inline

Member Function Documentation

◆ get() [1/2]

template<typename U >
U* walberla::domain_decomposition::internal::BlockData::get ( )
inline

◆ get() [2/2]

template<typename U >
const U* walberla::domain_decomposition::internal::BlockData::get ( ) const
inline

◆ isClassOrSubclassOf()

template<typename U >
bool walberla::domain_decomposition::internal::BlockData::isClassOrSubclassOf ( ) const
inline

◆ isOfSameType()

bool walberla::domain_decomposition::internal::BlockData::isOfSameType ( const BlockData bd) const
inline

◆ isOfType()

template<typename U >
bool walberla::domain_decomposition::internal::BlockData::isOfType ( ) const
inline

◆ isSubclassOf()

template<typename U >
bool walberla::domain_decomposition::internal::BlockData::isSubclassOf ( ) const
inline

◆ operator!=()

bool walberla::domain_decomposition::internal::BlockData::operator!= ( const BlockData rhs) const
inline

◆ operator==()

bool walberla::domain_decomposition::internal::BlockData::operator== ( const BlockData rhs) const
inline

◆ thrower()

template<typename T >
static void walberla::domain_decomposition::internal::BlockData::thrower ( void *  ptr)
inlinestaticprivate

◆ uncheckedFastGet() [1/2]

template<typename U >
U* walberla::domain_decomposition::internal::BlockData::uncheckedFastGet ( )
inline

Attention: Calling this function ONLY works if type U is identical to the type T that was once added.

Retrieving a pointer to a base class of class T that was once added does not work!

◆ uncheckedFastGet() [2/2]

template<typename U >
const U* walberla::domain_decomposition::internal::BlockData::uncheckedFastGet ( ) const
inline

Attention: Calling this function ONLY works if type U is identical to the type T that was once added.

Retrieving a pointer to a base class of class T that was once added does not work!

Member Data Documentation

◆ data_

DataBase* walberla::domain_decomposition::internal::BlockData::data_
private

◆ ptr_

void* walberla::domain_decomposition::internal::BlockData::ptr_
private

◆ thr_

void(* walberla::domain_decomposition::internal::BlockData::thr_) (void *)
private

◆ typeInfo_

std::string walberla::domain_decomposition::internal::BlockData::typeInfo_
private

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