Leviathan  0.8.0.0
Leviathan game engine
DataBlock.h File Reference
#include "Define.h"
#include "../../Common/ReferenceCounted.h"
#include "../../Utility/Convert.h"
#include <map>
#include <memory>
#include "../../Common/SFMLPackets.h"
#include "../../Exceptions.h"

Go to the source code of this file.

Classes

class  Leviathan::DataBlock< DBlockT >
 Main DataBlock class. More...
 
struct  Leviathan::DataBlockNameResolver< T >
 
class  Leviathan::DataBlockConverter< FromDataBlockType, TargetType >
 
struct  Leviathan::DataBlockConversionResolver< DBlockTDT, T >
 
struct  Leviathan::TypeToAngelScriptIDConverter< TypeToFetchID >
 
class  Leviathan::DataBlockAll
 
class  Leviathan::DataBlock< DBlockT >
 Main DataBlock class. More...
 
class  Leviathan::DataBlock< DBlockT * >
 
struct  Leviathan::TvalToTypeResolver< TValue >
 
class  Leviathan::VariableBlock
 Non-template class for working with all types of DataBlocks. More...
 
class  Leviathan::NamedVariableBlock
 DataBlock variant with name. More...
 
class  Leviathan::ScriptSafeVariableBlock
 Reference counted version for scripts of VariableBlock. More...
 
class  Leviathan::DataBlockConverter< FromDataBlockType, std::wstring >
 
class  Leviathan::DataBlockConverter< FromDataBlockType, std::string >
 

Namespaces

 Leviathan
 The access mask controls which registered functions and classes a script sees.
 

Macros

#define DATABLOCK_TYPE_INT   3
 
#define DATABLOCK_TYPE_FLOAT   4
 
#define DATABLOCK_TYPE_BOOL   5
 
#define DATABLOCK_TYPE_WSTRING   6
 
#define DATABLOCK_TYPE_STRING   7
 
#define DATABLOCK_TYPE_CHAR   8
 
#define DATABLOCK_TYPE_DOUBLE   9
 
#define DATABLOCK_TYPE_VOIDPTR   11
 
#define DATABLOCK_TYPE_ERROR   9000
 
#define DATABLOCK_TYPE_UNINITIALIZED   10000
 
#define NAMERESOLVERTEMPLATEINSTANTIATION(DType, TVALDEFINE)   template<> struct DataBlockNameResolver<DType>{ static const short TVal = TVALDEFINE;};
 
#define TVALRESOLVERTYPE(BlockTypeT, DEFINEDValT)
 
#define CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK(BlockTypeName, ToConvertTypeName, ConvertActionToDo)
 
#define CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT(BlockTypeName, ToConvertTypeName)
 

Typedefs

typedef DataBlock< int > Leviathan::IntBlock
 
typedef DataBlock< float > Leviathan::FloatBlock
 
typedef DataBlock< bool > Leviathan::BoolBlock
 
typedef DataBlock< std::wstring > Leviathan::WstringBlock
 
typedef DataBlock< std::string > Leviathan::StringBlock
 
typedef DataBlock< char > Leviathan::CharBlock
 
typedef DataBlock< double > Leviathan::DoubleBlock
 
typedef DataBlock< void * > Leviathan::VoidPtrBlock
 

Functions

 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (int, DATABLOCK_TYPE_INT)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (float, DATABLOCK_TYPE_FLOAT)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (bool, DATABLOCK_TYPE_BOOL)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (std::wstring, DATABLOCK_TYPE_WSTRING)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (std::string, DATABLOCK_TYPE_STRING)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (char, DATABLOCK_TYPE_CHAR)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (double, DATABLOCK_TYPE_DOUBLE)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (void *, DATABLOCK_TYPE_VOIDPTR)
 
 Leviathan::NAMERESOLVERTEMPLATEINSTANTIATION (void, DATABLOCK_TYPE_VOIDPTR)
 
 Leviathan::TVALRESOLVERTYPE (IntBlock, DATABLOCK_TYPE_INT)
 
 Leviathan::TVALRESOLVERTYPE (FloatBlock, DATABLOCK_TYPE_FLOAT)
 
 Leviathan::TVALRESOLVERTYPE (BoolBlock, DATABLOCK_TYPE_BOOL)
 
 Leviathan::TVALRESOLVERTYPE (WstringBlock, DATABLOCK_TYPE_WSTRING)
 
 Leviathan::TVALRESOLVERTYPE (StringBlock, DATABLOCK_TYPE_STRING)
 
 Leviathan::TVALRESOLVERTYPE (CharBlock, DATABLOCK_TYPE_CHAR)
 
 Leviathan::TVALRESOLVERTYPE (DoubleBlock, DATABLOCK_TYPE_DOUBLE)
 
 Leviathan::TVALRESOLVERTYPE (VoidPtrBlock, DATABLOCK_TYPE_VOIDPTR)
 
DLLEXPORT std::ostream & Leviathan::operator<< (std::ostream &stream, const VariableBlock &value)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (IntBlock, int,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (IntBlock, bool,(*block->Value) !=0)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, float)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, double)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (IntBlock, char)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (FloatBlock, float,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (FloatBlock, bool,(*block->Value) !=0)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, int)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, double)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (FloatBlock, char)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (BoolBlock, bool,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, int)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, double)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (BoolBlock, char)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (CharBlock, char,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (CharBlock, bool,(*block->Value) !=0)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, int)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, double)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (CharBlock, float)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (DoubleBlock, double,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (DoubleBlock, bool,(*block->Value) !=0)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, int)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, char)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (DoubleBlock, float)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, std::wstring,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, std::string, Convert::Utf16ToUtf8(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, bool, Convert::WstringFromBoolToInt(*block->Value) !=0)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, float, Convert::WstringTo< float >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, double, Convert::WstringTo< double >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, char,(char) Convert::WstringTo< wchar_t >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (WstringBlock, int, Convert::WstringTo< int >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, std::string,(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, std::wstring, Convert::Utf8ToUtf16(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, bool, Convert::StringFromBoolToInt(*block->Value) !=0)
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, float, Convert::StringTo< float >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, double, Convert::StringTo< double >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, char, Convert::StringTo< char >(*block->Value))
 
 Leviathan::CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (StringBlock, int, Convert::StringTo< int >(*block->Value))
 

Macro Definition Documentation

◆ CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK

#define CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCK (   BlockTypeName,
  ToConvertTypeName,
  ConvertActionToDo 
)
Value:
template<> \
class DataBlockConverter<BlockTypeName, ToConvertTypeName>{public: \
static inline ToConvertTypeName DoConvert(const BlockTypeName* block){ \
return ConvertActionToDo;}; \
static const bool AllowedConversion = true;};

Definition at line 880 of file DataBlock.h.

◆ CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT

#define CONVERSIONTEMPLATESPECIFICATIONFORDATABLOCKDEFAULT (   BlockTypeName,
  ToConvertTypeName 
)
Value:
template<> class DataBlockConverter<BlockTypeName, ToConvertTypeName>{public: \
static inline ToConvertTypeName DoConvert(const BlockTypeName* block){ \
return (ToConvertTypeName)(*block->Value);}; \
static const bool AllowedConversion = true;};

Definition at line 885 of file DataBlock.h.

◆ DATABLOCK_TYPE_BOOL

#define DATABLOCK_TYPE_BOOL   5

Definition at line 24 of file DataBlock.h.

◆ DATABLOCK_TYPE_CHAR

#define DATABLOCK_TYPE_CHAR   8

Definition at line 27 of file DataBlock.h.

◆ DATABLOCK_TYPE_DOUBLE

#define DATABLOCK_TYPE_DOUBLE   9

Definition at line 28 of file DataBlock.h.

◆ DATABLOCK_TYPE_ERROR

#define DATABLOCK_TYPE_ERROR   9000

Definition at line 31 of file DataBlock.h.

◆ DATABLOCK_TYPE_FLOAT

#define DATABLOCK_TYPE_FLOAT   4

Definition at line 23 of file DataBlock.h.

◆ DATABLOCK_TYPE_INT

#define DATABLOCK_TYPE_INT   3

Definition at line 22 of file DataBlock.h.

◆ DATABLOCK_TYPE_STRING

#define DATABLOCK_TYPE_STRING   7

Definition at line 26 of file DataBlock.h.

◆ DATABLOCK_TYPE_UNINITIALIZED

#define DATABLOCK_TYPE_UNINITIALIZED   10000

Definition at line 32 of file DataBlock.h.

◆ DATABLOCK_TYPE_VOIDPTR

#define DATABLOCK_TYPE_VOIDPTR   11

Definition at line 29 of file DataBlock.h.

◆ DATABLOCK_TYPE_WSTRING

#define DATABLOCK_TYPE_WSTRING   6

Definition at line 25 of file DataBlock.h.

◆ NAMERESOLVERTEMPLATEINSTANTIATION

#define NAMERESOLVERTEMPLATEINSTANTIATION (   DType,
  TVALDEFINE 
)    template<> struct DataBlockNameResolver<DType>{ static const short TVal = TVALDEFINE;};

Definition at line 47 of file DataBlock.h.

◆ TVALRESOLVERTYPE

#define TVALRESOLVERTYPE (   BlockTypeT,
  DEFINEDValT 
)
Value:
template<> struct TvalToTypeResolver<DEFINEDValT>{\
static const BlockTypeT* Conversion(const DataBlockAll* bl){\
return static_cast<const BlockTypeT*>(bl);}; \
static BlockTypeT* Conversion(DataBlockAll* bl){return static_cast<BlockTypeT*>(bl);}};

Definition at line 405 of file DataBlock.h.