| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 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_ */