News SF.net Project Frequently Asked Questions Documentation Downloads Mailing Lists How to Contribute

SourceForge.net Logo

Changing the way games are made and played.

tnlJournal.h File Reference

tnlJournal.h File Reference

#include "tnlMethodDispatch.h"
#include <stdio.h>

Namespaces

namespace  TNL

Defines

#define TNL_ENABLE_JOURNALING
#define TNL_DECLARE_JOURNAL_ENTRYPOINT(func, args)
#define TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(className, func, args, argNames)
#define TNL_JOURNAL_WRITE_BLOCK(blockType, x)
#define TNL_JOURNAL_READ_BLOCK(blockType, x)
#define TNL_JOURNAL_READ(x)   TNL::Journal::getReadStream()->read x
#define TNL_JOURNAL_WRITE(x)   TNL::Journal::getWriteStream()->write x


Define Documentation

#define TNL_ENABLE_JOURNALING
 

#define TNL_DECLARE_JOURNAL_ENTRYPOINT func,
args   ) 
 

Value:

void func args; \
      void func##_body args

#define TNL_IMPLEMENT_JOURNAL_ENTRYPOINT className,
func,
args,
argNames   ) 
 

Value:

struct Journal_##className##_##func##_er : public JournalEntryRecord { \
      FunctorDecl<void (className::*) args> mFunctorDecl; \
      Journal_##className##_##func##_er(const char *name) : JournalEntryRecord(name), mFunctorDecl(&className::func##_body) { mFunctor = &mFunctorDecl; } \
      } gJournal_##className##_##func##_er(#func); \
      void className::func args { \
      gJournal_##className##_##func##_er.mFunctorDecl.set argNames; \
         callEntry(#func, gJournal_##className##_##func##_er.mFunctor); \
      } \
      void className::func##_body args

#define TNL_JOURNAL_WRITE_BLOCK blockType,
 ) 
 

Value:

{ \
   if(TNL::Journal::getCurrentMode() == TNL::Journal::Record && TNL::Journal::isInEntrypoint()) \
   { \
      static TNL::JournalBlockTypeToken typeToken(#blockType);\
      TNL::JournalToken dummy(typeToken.getValue(), true); \
      { \
      x \
      } \
   } \
}

#define TNL_JOURNAL_READ_BLOCK blockType,
 ) 
 

Value:

{ \
   if(TNL::Journal::getCurrentMode() == TNL::Journal::Playback && TNL::Journal::isInEntrypoint()) \
   { \
      static TNL::JournalBlockTypeToken typeToken(#blockType);\
      TNL::JournalToken dummy(typeToken.getValue(), false); \
      { \
      x \
      } \
   } \
}

#define TNL_JOURNAL_READ  )     TNL::Journal::getReadStream()->read x
 

#define TNL_JOURNAL_WRITE  )     TNL::Journal::getWriteStream()->write x