Potato Engine
Loading...
Searching...
No Matches
Archivable.hpp File Reference
#include <unordered_map>
#include <functional>

Go to the source code of this file.

Classes

class  Archivable
 Abstract factory class inherited by all classes that should be archived. More...

Macros

#define ARCHIVE_STATIC(type)
 Registers classes to be archived as a static actor.

Macro Definition Documentation

◆ ARCHIVE_STATIC

#define ARCHIVE_STATIC ( type)
Value:
static struct __##type##_Register { \
__##type##_Register() { \
__Archive::_GetArchive()[#type] = []() -> Archivable* { return new type(); }; \
} \
} __##type##_register;
Abstract factory class inherited by all classes that should be archived.

Registers classes to be archived as a static actor.

Remarks
Call this macro at the top of source files for archivable classes
Parameters
typeLiteral name of the class

Definition at line 13 of file Archivable.hpp.