Gaudi Framework, version v21r9

Home   Generated: 3 May 2010

AppReturnCode.h

Go to the documentation of this file.
00001 
00006 #ifndef APPRETURNCODE_H_
00007 #define APPRETURNCODE_H_
00008 
00009 #include "GaudiKernel/IProperty.h"
00010 #include "GaudiKernel/Property.h"
00011 
00012 namespace Gaudi {
00025   inline StatusCode setAppReturnCode(SmartIF<IProperty> &appmgr, int value, bool force = false) {
00026     if (appmgr) {
00027       IntegerProperty returnCode("ReturnCode", 0);
00028       if (appmgr->getProperty(&returnCode).isSuccess()) {
00029         if (returnCode.value() == 0 || force) {
00030           returnCode.setValue(value);
00031           return appmgr->setProperty(returnCode);
00032         }
00033       }
00034     }
00035     return StatusCode::FAILURE;
00036   }
00037 
00043   inline int getAppReturnCode(const SmartIF<IProperty> &appmgr) {
00044     if (appmgr) {
00045       IntegerProperty returnCode("ReturnCode", 0);
00046       if (appmgr->getProperty(&returnCode).isSuccess())
00047         return returnCode.value();
00048     }
00049     return 0;
00050   }
00051 }
00052 #endif /* APPRETURNCODE_H_ */

Generated at Mon May 3 12:14:12 2010 for Gaudi Framework, version v21r9 by Doxygen version 1.5.6 written by Dimitri van Heesch, © 1997-2004