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{ \
9if (sizeof(x) != memoryArena->containerStructMemory.size) { return nullptr; } \
10 return new(memoryArena->containerStructMemory.block) x (); \
11} \
12else
13
14
15//this should not allocate memory
16Container *getContainer(const char *name, samurai::memory::MemoryArena *memoryArena)
17{
18
19
21 {
22 //"invalid container name: "
23 return nullptr;
24 }
25
26}
27
28#undef SAMURAI_DECLARE_CONTAINER
Container * getContainer(const char *name, samurai::memory::MemoryArena *memoryArena)
#define SAMURAI_ALL_CONTAINERS()
Definition containers.h:16