Leviathan  0.8.0.0
Leviathan game engine
Leviathan::DataBlock< DBlockT * > Class Template Reference

#include <DataBlock.h>

+ Inheritance diagram for Leviathan::DataBlock< DBlockT * >:

Public Member Functions

 DataBlock ()
 
 DataBlock (const DBlockT *val)
 
 DataBlock (DBlockT *val)
 
 DataBlock (const DataBlock &otherdeepcopy)
 
virtual ~DataBlock ()
 
DataBlockoperator= (const DataBlock &arg)
 
virtual DataBlockAllAllocateNewFromThis () const
 
bool operator== (const DataBlock< DBlockT > &other)
 
template<class ConvertT >
 operator ConvertT () const
 
template<class ConvertT >
 operator ConvertT * ()
 
template<class ConvertT >
bool IsConversionAllowedNonPtr () const
 
template<class ConvertT >
bool IsConversionAllowedPtr () const
 
- Public Member Functions inherited from Leviathan::DataBlockAll
virtual ~DataBlockAll ()
 
bool operator== (const DataBlockAll &other)
 

Static Public Member Functions

static DataBlockCopyConstructor (DataBlock *arg)
 

Public Attributes

DBlockT * Value
 
- Public Attributes inherited from Leviathan::DataBlockAll
short Type
 

Additional Inherited Members

- Protected Member Functions inherited from Leviathan::DataBlockAll
 DataBlockAll ()
 

Detailed Description

template<class DBlockT>
class Leviathan::DataBlock< DBlockT * >

A pointer specialized version of DataBlock

Todo:
Add support for move operators to this too

Definition at line 284 of file DataBlock.h.

Constructor & Destructor Documentation

◆ DataBlock() [1/4]

template<class DBlockT >
Leviathan::DataBlock< DBlockT * >::DataBlock ( )
inline

Definition at line 286 of file DataBlock.h.

286  : Value(NULL){
287 
289  }
#define DATABLOCK_TYPE_ERROR
Definition: DataBlock.h:31

◆ DataBlock() [2/4]

template<class DBlockT >
Leviathan::DataBlock< DBlockT * >::DataBlock ( const DBlockT *  val)
inline

Definition at line 290 of file DataBlock.h.

290  : Value(val){
291 
292  // use templates to get type //
294  }
static const short TVal
Definition: DataBlock.h:43

◆ DataBlock() [3/4]

template<class DBlockT >
Leviathan::DataBlock< DBlockT * >::DataBlock ( DBlockT *  val)
inline

Definition at line 295 of file DataBlock.h.

295  : Value(val){
296 
297  // use templates to get type //
299  }
static const short TVal
Definition: DataBlock.h:43

◆ DataBlock() [4/4]

template<class DBlockT >
Leviathan::DataBlock< DBlockT * >::DataBlock ( const DataBlock< DBlockT * > &  otherdeepcopy)
inline

Definition at line 301 of file DataBlock.h.

301  : Value(otherdeepcopy.Value){
302 
303  // copy type //
304  Type = otherdeepcopy.Type;
305  }

◆ ~DataBlock()

template<class DBlockT >
virtual Leviathan::DataBlock< DBlockT * >::~DataBlock ( )
inlinevirtual

Definition at line 307 of file DataBlock.h.

307  {
308  }

Member Function Documentation

◆ AllocateNewFromThis()

template<class DBlockT >
virtual DataBlockAll* Leviathan::DataBlock< DBlockT * >::AllocateNewFromThis ( ) const
inlinevirtual

Implements Leviathan::DataBlockAll.

Definition at line 320 of file DataBlock.h.

320  {
321 
322  return static_cast<DataBlockAll*>((new DataBlock<DBlockT*>(const_cast<const DataBlock<DBlockT*>&>(*this))));
323  }

◆ CopyConstructor()

template<class DBlockT >
static DataBlock* Leviathan::DataBlock< DBlockT * >::CopyConstructor ( DataBlock< DBlockT * > *  arg)
inlinestatic

Definition at line 327 of file DataBlock.h.

327  {
328 
329  std::unique_ptr<DataBlock> block(new DataBlock());
330 
331  block.get()->Type = arg->Type;
332  // copy pointer //
333  block.get()->Value = arg->Value;
334 
335  // destroy original //
336  arg->Value = NULL;
337 
338  return block.release();
339  }
DataBlock(const _U &forceempty)
Creates an uninitialized block of type non.
Definition: DataBlock.h:166

◆ IsConversionAllowedNonPtr()

template<class DBlockT >
template<class ConvertT >
bool Leviathan::DataBlock< DBlockT * >::IsConversionAllowedNonPtr ( ) const
inline

Definition at line 364 of file DataBlock.h.

364  {
365  // check it //
366  return false;
367  }

◆ IsConversionAllowedPtr()

template<class DBlockT >
template<class ConvertT >
bool Leviathan::DataBlock< DBlockT * >::IsConversionAllowedPtr ( ) const
inline

Definition at line 370 of file DataBlock.h.

370  {
371  // check it //
373  }
static bool IsConversionAllowedPtr(const DataBlock< DBlockTDT > *block)
Definition: DataBlock.h:107

◆ operator ConvertT()

template<class DBlockT >
template<class ConvertT >
Leviathan::DataBlock< DBlockT * >::operator ConvertT ( ) const
inline

Definition at line 350 of file DataBlock.h.

350  {
351  //LEVIATHAN_ASSERT(false, "data block pointer cannot be made into value");
352  //return ConvertT();
353  return reinterpret_cast<ConvertT>(Value);
354  }

◆ operator ConvertT *()

template<class DBlockT >
template<class ConvertT >
Leviathan::DataBlock< DBlockT * >::operator ConvertT * ( )
inlineexplicit

Definition at line 357 of file DataBlock.h.

357  {
358 
360  }
static T * DoConversionPtr(DataBlock< DBlockTDT > *block)
Definition: DataBlock.h:85

◆ operator=()

template<class DBlockT >
DataBlock& Leviathan::DataBlock< DBlockT * >::operator= ( const DataBlock< DBlockT * > &  arg)
inline

Definition at line 311 of file DataBlock.h.

311  {
312  // copy type //
313  Type = arg.Type;
314  Value = arg.Value;
315  // avoid performance issues //
316  return *this;
317  }

◆ operator==()

template<class DBlockT >
bool Leviathan::DataBlock< DBlockT * >::operator== ( const DataBlock< DBlockT > &  other)
inline

Definition at line 342 of file DataBlock.h.

342  {
343 
344  // compare values with default operator //
345  return Value == other.Value;
346  }

Member Data Documentation

◆ Value

template<class DBlockT >
DBlockT* Leviathan::DataBlock< DBlockT * >::Value

Definition at line 375 of file DataBlock.h.


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