Doxygen Samurai Engine
0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
containers.cpp
Go to the documentation of this file.
1
#include <
containers.h
>
2
#include <
assert/assert.h
>
3
4
5
6
7
#define SAMURAI_DECLARE_CONTAINER(x) if (std::strcmp(name, #x ) == 0) \
8
{ \
9
if (sizeof(x) != memoryArena->containerStructMemory.size) { return nullptr; } \
10
return new(memoryArena->containerStructMemory.block) x (); \
11
} \
12
else
13
14
15
//this should not allocate memory
16
Container
*
getContainer
(
const
char
*name,
samurai::memory::MemoryArena
*memoryArena)
17
{
18
19
20
SAMURAI_ALL_CONTAINERS
()
21
{
22
//"invalid container name: "
23
return
nullptr
;
24
}
25
26
}
27
28
#undef SAMURAI_DECLARE_CONTAINER
assert.h
getContainer
Container * getContainer(const char *name, samurai::memory::MemoryArena *memoryArena)
Definition
containers.cpp:16
containers.h
SAMURAI_ALL_CONTAINERS
#define SAMURAI_ALL_CONTAINERS()
Definition
containers.h:16
Container
Definition
baseContainer.h:156
samurai::memory::MemoryArena
Definition
memoryArena.h:18
gameplay
containers.cpp
Generated by
1.10.0