A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Kinoko::Host::Context Class Reference

#include <Context.hh>

Description

Contexts can be used to restore a previous memory state for the current session.

Contexts can be thought of like savestates, where we can save and load a given checkpoint. Contexts work by performing a memcpy of the entire game heap, which is reliable since we override operator new with an EGG::Heap implementation. For variables with static storage duration, they may exist out of the heap. Thus, we need to manually copy those.

Definition at line 71 of file Context.hh.

Classes

struct  Statics
 

Public Member Functions

 Context (const Context &c)
 
 Context (Context &&c)
 Move constructs Context by stealing the memory block and ptrs from the provided context.
 
Contextoperator= (const Context &rhs)
 
Contextoperator= (Context &&rhs)
 
bool operator== (const Context &rhs) const
 

Static Public Member Functions

static void SetActiveContext (const Context &rhs)
 

Private Attributes

void * m_contextMemory
 
Statics m_statics
 

Constructor & Destructor Documentation

◆ Context() [1/3]

Kinoko::Host::Context::Context ( )

Definition at line 27 of file Context.cc.

◆ Context() [2/3]

Kinoko::Host::Context::Context ( const Context & c)

Definition at line 67 of file Context.cc.

◆ Context() [3/3]

Kinoko::Host::Context::Context ( Context && c)

Move constructs Context by stealing the memory block and ptrs from the provided context.

Definition at line 75 of file Context.cc.

◆ ~Context()

Kinoko::Host::Context::~Context ( )

Definition at line 82 of file Context.cc.

Member Function Documentation

◆ operator=() [1/2]

Context & Kinoko::Host::Context::operator= ( const Context & rhs)

Definition at line 86 of file Context.cc.

◆ operator=() [2/2]

Context & Kinoko::Host::Context::operator= ( Context && rhs)

Definition at line 98 of file Context.cc.

◆ operator==()

bool Kinoko::Host::Context::operator== ( const Context & rhs) const

Definition at line 108 of file Context.cc.

◆ SetActiveContext()

void Kinoko::Host::Context::SetActiveContext ( const Context & rhs)
static

Definition at line 148 of file Context.cc.

Member Data Documentation

◆ m_contextMemory

void* Kinoko::Host::Context::m_contextMemory
private

Definition at line 124 of file Context.hh.

◆ m_statics

Statics Kinoko::Host::Context::m_statics
private

Definition at line 125 of file Context.hh.