GameShield V5 SDK Programming Guide: GS5_Ext.h File Reference

GameShield v5 SDK

GameShield V5 SDK Programming Guide  v5.2
GS5_Ext.h File Reference

GS5 Extension Development. More...

Include dependency graph for GS5_Ext.h:

Classes

class  gs::TGSApp
 GS5 Application. More...
 
class  gs::TGSDynamicLM
 Base class of Dynamic License Model. More...
 

Namespaces

 gs
 GameShield name space.
 

Macros

APP Macros
#define DECLARE_APP(clsName)
 Declare a TGSApp subclass. More...
 
#define IMPLEMENT_APP(clsName)
 Implements a TGSApp subclass. More...
 
#define GET_APP(clsName)   ((clsName*)TGSApp::getInstance())
 Get TGSApp instance. More...
 
Dynamic License Model Macros
#define DECLARE_LM(clsName, licType, licName, licDescription)
 
#define IMPLEMENT_LM(clsName)
 

Detailed Description

GS5 Extension Development.

This file is needed to develop your own GS5 extensions such as a license model or GS5 event monitor.

Macro Definition Documentation

#define DECLARE_APP (   clsName)
Value:
private: \
static TGSApp * createInstance(){ return new clsName(); }\
public:\
static void initClass(){\
gs::TGSApp::registerApp(clsName::createInstance);\
}

Declare a TGSApp subclass.

It defines needed class members for an app subclass and must be put in the class declaration as following:

class TMyApp : public gs::TGSApp{
DECLARE_APP(TMyApp);
};
See Also
IMPLEMENT_APP
GET_APP
#define DECLARE_LM (   clsName,
  licType,
  licName,
  licDescription 
)
Value:
private: \
static TGSDynamicLM * createInstance(){ return new clsName(); }\
public:\
static void initClass(){\
gs::registerLM(clsName::createInstance, licType, licName, licDescription);\
}

Declare a License Model subclass

Parameters
clsNameSub-class name
licTypeUnique string typeId of the LM

The typeId can be any string ( a UUID or whatever string meaningful in your software system)

Parameters
licNameUser-friendly string name of the LM
licDescriptionString description of the LM
#define GET_APP (   clsName)    ((clsName*)TGSApp::getInstance())

Get TGSApp instance.

Get the single instance of registered TGSApp class.

Because it is recommended that the constructor of TGSApp and its subclass is protected, this macro is the official way of creating / retrieving a pointer to TGSApp (or its subclass)

The reason is for code portability: The same binary can be executed without wrapping or embedded in protected game.

See Also
DECLARE_APP
IMPLEMENT_APP
#define IMPLEMENT_APP (   clsName)
Value:
namespace clsName_ {\
struct clsName##Registor {\
clsName##Registor(){ clsName::initClass(); }\
} clsName##Registor_inst; \
}

Implements a TGSApp subclass.

It implements needed class members for an app subclass and must be put in a cpp file as following:

in myapp.cpp:
IMPLEMENT_APP(TMyApp);
void TMyApp::OnAppBegin(){ ... }
See Also
DECLARE_APP,
GET_APP
#define IMPLEMENT_LM (   clsName)
Value:
namespace clsName_ {\
struct clsName##Registor {\
clsName##Registor(){ clsName::initClass();}\
} clsName##Registor_inst; \
}

Implements a License Model subclass

Parameters
clsNameSub-class name

It must be in a CPP file to make sure the LM subclass is registered to the GS5 kernel.

Generated on Mon Feb 3 2014 13:15:28 for GameShield V5 SDK Programming Guide by   doxygen 1.8.5