Changes between Version 25 and Version 26 of Documentation/Tutorial/PingPong


Ignore:
Timestamp:
Apr 28, 2009, 3:46:17 PM (16 years ago)
Author:
huebsch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Tutorial/PingPong

    v25 v26  
    1919{{{
    202001 #include <string>
    21 02 #include "ariba/utility/startup/StartupWrapper.h"
     2102 #include "ariba/utility/system/StartupWrapper.h"
    222203 #include "PingPong.h"
    23 04
     2304 
    242405 using std::string;
    252506 using ariba::utility::StartupWrapper;
     
    282809 int main( int argc, char** argv ) {
    292910
    30 11      string config = "../etc/settings.cnf";
    31 12      if (argc >= 2) config = argv[1];
    32 13
    33 14      StartupWrapper::initConfig( config );
    34 15      StartupWrapper::initSystem();
    35 16     
    36 17      // this will do the main functionality and block
    37 18      PingPong ping;
    38 19      ping.setMode( !Configuration::instance().read<bool>("GENERAL_Initiator") );
     3011      // get config file
     3112      string config = "../etc/settings.cnf";
     3213      if (argc >= 2) config = argv[1];
     3314
     3415      StartupWrapper::initConfig( config );
     3516      StartupWrapper::initSystem();
     3617
     3718      // this will do the main functionality and block
     3819      PingPong ping;
    393920      StartupWrapper::startup(&ping, true);
    404021
    41 22      // this will run blocking until <enter> is hit
     4122      // --> we will run blocking until <enter> is hit
    424223
    43 24      StartupWrapper::shutdown();
     4324      StartupWrapper::shutdown(&ping);
    444425      return 0;
    45 26 }
     4526}
    4646}}}
    4747The ''main.cpp'' serves us as an entry point to the application. In the first lines we include class definitions we need here (e.g. strings because we want to handle some). Also, we include the !StartupWrapper class that comes with ''Ariba''. It provides some handy helpers for initialization. Finally, we need to include the ''!PingPong.h'', because this is the actual thing we want to execute.