QuercusVL Programming Manual
Use VL namespace. All classes are defined inside “VL” namespace to avoid collisions with other
class names.
class CEventHandler: public ISystemEH
Class that will implement the client code to execute with the events. As it is derived from
IsystemEH we force it to implement its abstract methods (“On...”). If you are not interested in
any of the events just leave method implementation empty.
CEventHandler EventHandler;
Object that will catch events.
if(VLLoad()==-1) return -1;
Load of VL library.
if(!System::Initialize("Central.ini","Central.log",&EventHandler)) return -1;
Initialization of VL class library. This must be the first method to be called.
It is responsible to initialize the system, events, and set up networking with units configured at
initialization file “Central.ini”. The file “Central.log” stores system logs. As you can see, the
previously created object CEventHandler, is passed to the library as a parameter so that the
library can call its methods when necessary.
From now on, if you start the simulators “TSSimu” or “RLSimu” or the system has been
configured to communicate with real units, the events generated will be received.
System::Terminate();
End of VL library execution.
VLUnload();
Unload of VL library.
2.1.1. Memory management
It must be mentioned that C++ memory management is hidden (using “intelligent” pointers),
in a way that the developer doesn't have to worry about objects creation and removal.
All objects that make up the library can be created on the stack, passed as function
parameters by value, returns, etc. without loosing memory or performance. For example the
following construction is perfectly valid:
Quercus Technologies
18