Journal

Engine/source/core/util/journal/journal.h

Journaling System.

More...

Classes:

class

Functor base classes.

class

Multiple argument function functor specialization.

Private Types

enum
Mode {
  StopState 
  PlayState 
  RecordState 
  DisabledState 
}
Id 
void(Journal::*
VoidMethod )()
void *
VoidPtr 

Private Static Attributes

FuncDecl *
enum Journal::Mode

Public Attributes

class B class A Func
class B class A
class B class A void(Obj::*
id )
class B class A void(Obj::*
method )())
class B class A
class B class A void(Obj::*

Private Functions

Private Static Functions

Functor *
_create(Id id)
Id
_getFunctionId(VoidPtr ptr, VoidMethod method)
_removeFunctionId(VoidPtr ptr, VoidMethod method)

Public Static Functions

Register a function with the journalling system.

DeclareFunction(T obj, U method)
bool

Returns true if a function is being dispatched.

bool

Returns true if in play mode.

bool

Returns true if in recording mode.

Play(const char * file)
bool
Read(T * v)
bool
Read(U32 size, void * buffer)
ReadString(char str)
Record(const char * file)
RemoveFunction(T obj, U method)
bool
Write(U32 size, void * buffer)

Public Functions

Method((A &a) , (mFile, a) )
Method((A &a) , (mFile, a) )
Method((A &a, B &b) , (mFile, a, b) )
Method((A &a, B &b) , (mFile, a, b) )
Method((A &a, B &b, C &c) , (mFile, a, b, c) )
Method((A &a, B &b, C &c) , (mFile, a, b, c) )
Method((A &a, B &b, C &c, D &d) , (mFile, a, b, c, d) )
Method((A &a, B &b, C &c, D &d) , (mFile, a, b, c, d) )
Method((A &a, B &b, C &c, D &d, E &e) , (mFile, a, b, c, d, e) )
Method((A &a, B &b, C &c, D &d, E &e) , (mFile, a, b, c, d, e) )
Method((A &a, B &b, C &c, D &d, E &e, F &f) , (mFile, a, b, c, d, e, f) )
Method((A &a, B &b, C &c, D &d, E &e, F &f) , (mFile, a, b, c, d, e, f) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g) , (mFile, a, b, c, d, e, f, g) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g) , (mFile, a, b, c, d, e, f, g) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h) , (mFile, a, b, c, d, e, f, g, h) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h) , (mFile, a, b, c, d, e, f, g, h) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i) , (mFile, a, b, c, d, e, f, g, h, i) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i) , (mFile, a, b, c, d, e, f, g, h, i) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j) , (mFile, a, b, c, d, e, f, g, h, i, j) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j) , (mFile, a, b, c, d, e, f, g, h, i, j) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k) , (mFile, a, b, c, d, e, f, g, h, i, j, k) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k) , (mFile, a, b, c, d, e, f, g, h, i, j, k) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l, M &m) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l, m) )
Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l, M &m) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l, m) )
class B class A
Method((Func func, A a) , (mFile, id, a) , (a) )
class B
Method((Func func, A a, B b) , (mFile, id, a, b) , (a, b) )
class B class C
Method((Func func, A a, B b, C c) , (mFile, id, a, b, c) , (a, b, c) )
class B class C class D
Method((Func func, A a, B b, C c, D d) , (mFile, id, a, b, c, d) , (a, b, c, d) )
class B class C class D class E
Method((Func func, A a, B b, C c, D d, E e) , (mFile, id, a, b, c, d, e) , (a, b, c, d, e) )
class B class C class D class E class F
Method((Func func, A a, B b, C c, D d, E e, F f) , (mFile, id, a, b, c, d, e, f) , (a, b, c, d, e, f) )
class B class C class D class E class F class G
Method((Func func, A a, B b, C c, D d, E e, F f, G g) , (mFile, id, a, b, c, d, e, f, g) , (a, b, c, d, e, f, g) )
class B class C class D class E class F class G class H
Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h) , (mFile, id, a, b, c, d, e, f, g, h) , (a, b, c, d, e, f, g, h) )
class B class C class D class E class F class G class H class I
Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i) , (mFile, id, a, b, c, d, e, f, g, h, i) , (a, b, c, d, e, f, g, h, i) )
class B class C class D class E class F class G class H class I class J
Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j) , (mFile, id, a, b, c, d, e, f, g, h, i, j) , (a, b, c, d, e, f, g, h, i, j) )
class B class C class D class E class F class G class H class I class J class K
Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k) , (mFile, id, a, b, c, d, e, f, g, h, i, j, k) , (a, b, c, d, e, f, g, h, i, j, k) )
class B class C class D class E class F class G class H class I class J class K class L
Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l) , (mFile, id, a, b, c, d, e, f, g, h, i, j, k, l) , (a, b, c, d, e, f, g, h, i, j, k, l) )
Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m) , (mFile, id, a, b, c, d, e, f, g, h, i, j, k, l, m) , (a, b, c, d, e, f, g, h, i, j, k, l, m) )
class B class A
Method((Obj *obj, void(Obj::*)(A) method, A a)
class B
Method((Obj *obj, void(Obj::*)(A, B) method, A a, B b)
class B class C
Method((Obj *obj, void(Obj::*)(A, B, C) method, A a, B b, C c)
class B class C class D
Method((Obj *obj, void(Obj::*)(A, B, C, D) method, A a, B b, C c, D d)
class B class C class D class E
Method((Obj *obj, void(Obj::*)(A, B, C, D, E) method, A a, B b, C c, D d, E e)
class B class C class D class E class F
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F) method, A a, B b, C c, D d, E e, F f)
class B class C class D class E class F class G
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G) method, A a, B b, C c, D d, E e, F f, G g)
class B class C class D class E class F class G class H
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H) method, A a, B b, C c, D d, E e, F f, G g, H h)
class B class C class D class E class F class G class H class I
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I) method, A a, B b, C c, D d, E e, F f, G g, H h, I i)
class B class C class D class E class F class G class H class I class J
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j)
class B class C class D class E class F class G class H class I class J class K
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J, K) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k)
class B class C class D class E class F class G class H class I class J class K class L
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J, K, L) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l)
Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J, K, L, M) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m)
class B class A
Method(Func , (Func func, A a) , (a) )
class B
Method(Func , (Func func, A a, B b) , (a, b) )
class B class C
Method(Func , (Func func, A a, B b, C c) , (a, b, c) )
class B class C class D
Method(Func , (Func func, A a, B b, C c, D d) , (a, b, c, d) )
class B class C class D class E
Method(Func , (Func func, A a, B b, C c, D d, E e) , (a, b, c, d, e) )
class B class C class D class E class F
Method(Func , (Func func, A a, B b, C c, D d, E e, F f) , (a, b, c, d, e, f) )
class B class C class D class E class F class G
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g) , (a, b, c, d, e, f, g) )
class B class C class D class E class F class G class H
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h) , (a, b, c, d, e, f, g, h) )
class B class C class D class E class F class G class H class I
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i) , (a, b, c, d, e, f, g, h, i) )
class B class C class D class E class F class G class H class I class J
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j) , (a, b, c, d, e, f, g, h, i, j) )
class B class C class D class E class F class G class H class I class J class K
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k) , (a, b, c, d, e, f, g, h, i, j, k) )
class B class C class D class E class F class G class H class I class J class K class L
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l) , (a, b, c, d, e, f, g, h, i, j, k, l) )
Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m) , (a, b, c, d, e, f, g, h, i, j, k, l, m) )

Detailed Description

Journaling System.

The journaling system is used to record external events and non-deterministic values from an execution run in order that the run may be re-played for debugging purposes. The journaling system is integrated into the platform library, though not all platform calls are journaled.

File system calls are not journaled, so any modified files must be reset to their original state before playback. Only a single journal can be recored or played back at a time.

For the journals to play back correctly, journal events cannot be triggered during the processing of another event.

Private Types

Mode

Enumerator

StopState
PlayState
RecordState
DisabledState
typedef U32 Id 
typedef void(Journal::* VoidMethod )()
typedef void * VoidPtr 

Private Static Attributes

U32 _Count 
bool _Dispatching 
FuncDecl * _FunctionList 
enum Journal::Mode _State 
Stream * mFile 
Journal smInstance 

Public Attributes

class B class A Func func 
class B class A id 
class B class A void(Obj::* id )
class B class A void(Obj::* method )())
class B class A mFile 
class B class A void(Obj::* mFile )

Private Functions

Journal()

~Journal()

Private Static Functions

_create(Id id)

_finish()

_getFunctionId(VoidPtr ptr, VoidMethod method)

_removeFunctionId(VoidPtr ptr, VoidMethod method)

_start()

idPool()

Public Static Functions

DeclareFunction(T func)

Register a function with the journalling system.

DeclareFunction(T obj, U method)

Disable()

IsDispatching()

Returns true if a function is being dispatched.

IsPlaying()

Returns true if in play mode.

IsRecording()

Returns true if in recording mode.

Play(const char * file)

PlayNext()

Read(T * v)

Read(U32 size, void * buffer)

ReadString(char str)

Record(const char * file)

RemoveFunction(T obj, U method)

Stop()

Write(const T & v)

Write(U32 size, void * buffer)

WriteString(const char str)

Public Functions

Method((A &a) , (mFile, a) )

Method((A &a) , (mFile, a) )

Method((A &a, B &b) , (mFile, a, b) )

Method((A &a, B &b) , (mFile, a, b) )

Method((A &a, B &b, C &c) , (mFile, a, b, c) )

Method((A &a, B &b, C &c) , (mFile, a, b, c) )

Method((A &a, B &b, C &c, D &d) , (mFile, a, b, c, d) )

Method((A &a, B &b, C &c, D &d) , (mFile, a, b, c, d) )

Method((A &a, B &b, C &c, D &d, E &e) , (mFile, a, b, c, d, e) )

Method((A &a, B &b, C &c, D &d, E &e) , (mFile, a, b, c, d, e) )

Method((A &a, B &b, C &c, D &d, E &e, F &f) , (mFile, a, b, c, d, e, f) )

Method((A &a, B &b, C &c, D &d, E &e, F &f) , (mFile, a, b, c, d, e, f) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g) , (mFile, a, b, c, d, e, f, g) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g) , (mFile, a, b, c, d, e, f, g) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h) , (mFile, a, b, c, d, e, f, g, h) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h) , (mFile, a, b, c, d, e, f, g, h) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i) , (mFile, a, b, c, d, e, f, g, h, i) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i) , (mFile, a, b, c, d, e, f, g, h, i) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j) , (mFile, a, b, c, d, e, f, g, h, i, j) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j) , (mFile, a, b, c, d, e, f, g, h, i, j) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k) , (mFile, a, b, c, d, e, f, g, h, i, j, k) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k) , (mFile, a, b, c, d, e, f, g, h, i, j, k) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l, M &m) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l, m) )

Method((A &a, B &b, C &c, D &d, E &e, F &f, G &g, H &h, I &i, J &j, K &k, L &l, M &m) , (mFile, a, b, c, d, e, f, g, h, i, j, k, l, m) )

Method((Func func, A a) , (mFile, id, a) , (a) )

Method((Func func, A a, B b) , (mFile, id, a, b) , (a, b) )

Method((Func func, A a, B b, C c) , (mFile, id, a, b, c) , (a, b, c) )

Method((Func func, A a, B b, C c, D d) , (mFile, id, a, b, c, d) , (a, b, c, d) )

Method((Func func, A a, B b, C c, D d, E e) , (mFile, id, a, b, c, d, e) , (a, b, c, d, e) )

Method((Func func, A a, B b, C c, D d, E e, F f) , (mFile, id, a, b, c, d, e, f) , (a, b, c, d, e, f) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g) , (mFile, id, a, b, c, d, e, f, g) , (a, b, c, d, e, f, g) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h) , (mFile, id, a, b, c, d, e, f, g, h) , (a, b, c, d, e, f, g, h) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i) , (mFile, id, a, b, c, d, e, f, g, h, i) , (a, b, c, d, e, f, g, h, i) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j) , (mFile, id, a, b, c, d, e, f, g, h, i, j) , (a, b, c, d, e, f, g, h, i, j) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k) , (mFile, id, a, b, c, d, e, f, g, h, i, j, k) , (a, b, c, d, e, f, g, h, i, j, k) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l) , (mFile, id, a, b, c, d, e, f, g, h, i, j, k, l) , (a, b, c, d, e, f, g, h, i, j, k, l) )

Method((Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m) , (mFile, id, a, b, c, d, e, f, g, h, i, j, k, l, m) , (a, b, c, d, e, f, g, h, i, j, k, l, m) )

Method((Obj *obj, void(Obj::*)(A) method, A a)

Method((Obj *obj, void(Obj::*)(A, B) method, A a, B b)

Method((Obj *obj, void(Obj::*)(A, B, C) method, A a, B b, C c)

Method((Obj *obj, void(Obj::*)(A, B, C, D) method, A a, B b, C c, D d)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E) method, A a, B b, C c, D d, E e)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F) method, A a, B b, C c, D d, E e, F f)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G) method, A a, B b, C c, D d, E e, F f, G g)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H) method, A a, B b, C c, D d, E e, F f, G g, H h)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I) method, A a, B b, C c, D d, E e, F f, G g, H h, I i)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J, K) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J, K, L) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l)

Method((Obj *obj, void(Obj::*)(A, B, C, D, E, F, G, H, I, J, K, L, M) method, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m)

Method(Func , (Func func, A a) , (a) )

Method(Func , (Func func, A a, B b) , (a, b) )

Method(Func , (Func func, A a, B b, C c) , (a, b, c) )

Method(Func , (Func func, A a, B b, C c, D d) , (a, b, c, d) )

Method(Func , (Func func, A a, B b, C c, D d, E e) , (a, b, c, d, e) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f) , (a, b, c, d, e, f) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g) , (a, b, c, d, e, f, g) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h) , (a, b, c, d, e, f, g, h) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i) , (a, b, c, d, e, f, g, h, i) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j) , (a, b, c, d, e, f, g, h, i, j) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k) , (a, b, c, d, e, f, g, h, i, j, k) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l) , (a, b, c, d, e, f, g, h, i, j, k, l) )

Method(Func , (Func func, A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m) , (a, b, c, d, e, f, g, h, i, j, k, l, m) )