# squirrel_helper.hpp File Reference

declarations and parts of the implementation of the class for convert code More...

`#include <squirrel.h>`
`#include "../core/math_func.hpp"`
`#include "../core/smallvec_type.hpp"`
`#include "../economy_type.h"`
`#include "../string_func.h"`
`#include "squirrel_helper_type.hpp"`

Go to the source code of this file.

## Namespaces
namespace | SQConvert
## Data Structures
struct | SQConvert::SQAutoFreePointers
| Pointers assigned to this class will be free'd when this instance comes out of scope. More...
struct | SQConvert::YesT< Y >
struct | SQConvert::IsVoidT< T >
| Helper class to recognize if the given type is void. More...
struct | SQConvert::IsVoidT< void >
struct | SQConvert::HasVoidReturnT< Tretval(*)()>
struct | SQConvert::HasVoidReturnT< Tretval(*)(Targ1)>
struct | SQConvert::HasVoidReturnT< Tretval(*)(Targ1, Targ2)>
struct | SQConvert::HasVoidReturnT< Tretval(*)(Targ1, Targ2, Targ3)>
struct | SQConvert::HasVoidReturnT< Tretval(*)(Targ1, Targ2, Targ3, Targ4)>
struct | SQConvert::HasVoidReturnT< Tretval(*)(Targ1, Targ2, Targ3, Targ4, Targ5)>
struct | SQConvert::HasVoidReturnT< Tretval(*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10)>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)()>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)(Targ1)>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)(Targ1, Targ2)>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)(Targ1, Targ2, Targ3)>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4)>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4, Targ5)>
struct | SQConvert::HasVoidReturnT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10)>
class | SQConvert::ForceType< T >
| Special class to make it possible for the compiler to pick the correct GetParam(). More...
struct | SQConvert::HelperT< Tretval(*)(), false >
| The real C++ caller for function with return value and 0 params. More...
struct | SQConvert::HelperT< Tretval(*)(), true >
| The real C++ caller for function with no return value and 0 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(), false >
| The real C++ caller for method with return value and 0 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(), true >
| The real C++ caller for method with no return value and 0 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1), false >
| The real C++ caller for function with return value and 1 param. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1), true >
| The real C++ caller for function with no return value and 1 param. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1), false >
| The real C++ caller for method with return value and 1 param. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1), true >
| The real C++ caller for method with no return value and 1 param. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2), false >
| The real C++ caller for function with return value and 2 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2), true >
| The real C++ caller for function with no return value and 2 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2), false >
| The real C++ caller for method with return value and 2 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2), true >
| The real C++ caller for method with no return value and 2 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3), false >
| The real C++ caller for function with return value and 3 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3), true >
| The real C++ caller for function with no return value and 3 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3), false >
| The real C++ caller for method with return value and 3 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3), true >
| The real C++ caller for method with no return value and 3 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3, Targ4), false >
| The real C++ caller for function with return value and 4 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3, Targ4), true >
| The real C++ caller for function with no return value and 4 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4), false >
| The real C++ caller for method with return value and 4 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4), true >
| The real C++ caller for method with no return value and 4 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3, Targ4, Targ5), false >
| The real C++ caller for function with return value and 5 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3, Targ4, Targ5), true >
| The real C++ caller for function with no return value and 5 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4, Targ5), false >
| The real C++ caller for method with return value and 5 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4, Targ5), true >
| The real C++ caller for method with no return value and 5 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10), false >
| The real C++ caller for function with return value and 10 params. More...
struct | SQConvert::HelperT< Tretval(*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10), true >
| The real C++ caller for function with no return value and 10 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10), false >
| The real C++ caller for method with return value and 10 params. More...
struct | SQConvert::HelperT< Tretval(Tcls::*)(Targ1, Targ2, Targ3, Targ4, Targ5, Targ6, Targ7, Targ8, Targ9, Targ10), true >
| The real C++ caller for method with no return value and 10 params. More...
## Functions
template<typename T>
static int | SQConvert::Return (HSQUIRRELVM vm, T t)
| To return a value to squirrel, we call this function.
template<>
int | SQConvert::Return< uint8 > (HSQUIRRELVM vm, uint8 res)
template<>
int | SQConvert::Return< uint16 > (HSQUIRRELVM vm, uint16 res)
template<>
int | SQConvert::Return< uint32 > (HSQUIRRELVM vm, uint32 res)
template<>
int | SQConvert::Return< int8 > (HSQUIRRELVM vm, int8 res)
template<>
int | SQConvert::Return< int16 > (HSQUIRRELVM vm, int16 res)
template<>
int | SQConvert::Return< int32 > (HSQUIRRELVM vm, int32 res)
template<>
int | SQConvert::Return< int64 > (HSQUIRRELVM vm, int64 res)
template<>
int | SQConvert::Return< Money > (HSQUIRRELVM vm, Money res)
template<>
int | SQConvert::Return< bool > (HSQUIRRELVM vm, bool res)
template<>
int | SQConvert::Return< char * > (HSQUIRRELVM vm, char *res)
template<>
int | SQConvert::Return< const char * > (HSQUIRRELVM vm, const char *res)
template<>
int | SQConvert::Return< void * > (HSQUIRRELVM vm, void *res)
template<typename T>
static T | SQConvert::GetParam (ForceType< T >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
| To get a param from squirrel, we call this function.
template<>
uint8 | SQConvert::GetParam (ForceType< uint8 >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
uint16 | SQConvert::GetParam (ForceType< uint16 >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
uint32 | SQConvert::GetParam (ForceType< uint32 >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
int8 | SQConvert::GetParam (ForceType< int8 >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
int16 | SQConvert::GetParam (ForceType< int16 >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
int32 | SQConvert::GetParam (ForceType< int32 >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
bool | SQConvert::GetParam (ForceType< bool >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
void * | SQConvert::GetParam (ForceType< void * >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
const char * | SQConvert::GetParam (ForceType< const char * >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<>
Array * | SQConvert::GetParam (ForceType< Array * >, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr)
template<typename Tcls, typename Tmethod>
SQInteger | SQConvert::DefSQNonStaticCallback (HSQUIRRELVM vm)
| A general template for all non-static method callbacks from Squirrel.
template<typename Tcls, typename Tmethod>
SQInteger | SQConvert::DefSQAdvancedNonStaticCallback (HSQUIRRELVM vm)
| A general template for all non-static advanced method callbacks from Squirrel.
template<typename Tcls, typename Tmethod>
SQInteger | SQConvert::DefSQStaticCallback (HSQUIRRELVM vm)
| A general template for all function/static method callbacks from Squirrel.
template<typename Tcls>
static SQInteger | SQConvert::DefSQDestructorCallback (SQUserPointer p, SQInteger size)
| A general template for the destructor of SQ instances.
template<typename Tcls, typename Tmethod, int Tnparam>
SQInteger | SQConvert::DefSQConstructorCallback (HSQUIRRELVM vm)
| A general template to handle creating of instance with any amount of params.

## Detailed Description

declarations and parts of the implementation of the class for convert code

Definition in file squirrel_helper.hpp.