Leviathan  0.8.0.0
Leviathan game engine
DataBlock.cpp File Reference
#include "Include.h"
#include "../StringOperations.h"
#include "DataBlock.h"
#include "Iterators/StringIterator.h"
#include <float.h>
#include "Script/ScriptExecutor.h"

Go to the source code of this file.

Namespaces

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

Macros

#define DEFAULTTOANDFROMPACKETCONVERTFUNCTINS(BlockTypeName, VarTypeName, TmpTypeName)
 

Functions

 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (IntBlock, int, int)
 
 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (FloatBlock, float, float)
 
 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (BoolBlock, bool, bool)
 
 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (WstringBlock, wstring, wstring)
 
 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (StringBlock, string, string)
 
 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (DoubleBlock, double, double)
 
 Leviathan::DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (CharBlock, char, sf::Int8)
 
DLLEXPORT std::ostream & Leviathan::operator<< (std::ostream &stream, const VariableBlock &value)
 

Macro Definition Documentation

◆ DEFAULTTOANDFROMPACKETCONVERTFUNCTINS

#define DEFAULTTOANDFROMPACKETCONVERTFUNCTINS (   BlockTypeName,
  VarTypeName,
  TmpTypeName 
)
Value:
template<> \
DLLEXPORT void BlockTypeName::AddDataToPacket(sf::Packet& packet) \
{ \
packet << *Value; \
} \
template<> \
DLLEXPORT BlockTypeName::DataBlock(sf::Packet& packet) \
{ \
TmpTypeName tmpval; \
if(!(packet >> tmpval)) { \
throw InvalidArgument("invalid packet format"); \
} \
Value = new VarTypeName(tmpval); \
}

Definition at line 146 of file DataBlock.cpp.