Changes between Version 25 and Version 26 of Documentation/Tutorial/PingPong
- Timestamp:
- Apr 28, 2009, 3:46:17 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/Tutorial/PingPong
v25 v26 19 19 {{{ 20 20 01 #include <string> 21 02 #include "ariba/utility/s tartup/StartupWrapper.h"21 02 #include "ariba/utility/system/StartupWrapper.h" 22 22 03 #include "PingPong.h" 23 04 23 04 24 24 05 using std::string; 25 25 06 using ariba::utility::StartupWrapper; … … 28 28 09 int main( int argc, char** argv ) { 29 29 10 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::init System();35 16 36 17 // this will do the main functionality and block37 18 PingPong ping;38 19 ping.setMode( !Configuration::instance().read<bool>("GENERAL_Initiator") );30 11 // get config file 31 12 string config = "../etc/settings.cnf"; 32 13 if (argc >= 2) config = argv[1]; 33 14 34 15 StartupWrapper::initConfig( config ); 35 16 StartupWrapper::initSystem(); 36 17 37 18 // this will do the main functionality and block 38 19 PingPong ping; 39 39 20 StartupWrapper::startup(&ping, true); 40 40 21 41 22 // thiswill run blocking until <enter> is hit41 22 // --> we will run blocking until <enter> is hit 42 42 23 43 24 StartupWrapper::shutdown( );43 24 StartupWrapper::shutdown(&ping); 44 44 25 return 0; 45 26 45 26} 46 46 }}} 47 47 The ''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.