BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcRecoUtil/MdcRecoUtil-00-01-08/MdcRecoUtil/Code.h
Go to the documentation of this file.
1//--------------------------------------------------------------------------
2// File and Version Information:
3// $Id: Code.h,v 1.2 2009/12/23 02:59:56 zhangy Exp $
4//
5// Description:
6// Class Header for |Code|
7// Tell about success and failure
8//
9// Environment:
10// Software developed for the BaBar Detector at the SLAC B-Factory.
11//
12// Author List:
13// A. Snyder
14//
15// Copyright Information:
16// Copyright (C) 1996 SLAC
17//
18// History:
19// Migration for BESIII MDC
20//
21//------------------------------------------------------------------------
22
23#ifndef Code_H
24#define Code_H
25
26#include <assert.h>
27#include <stdlib.h>
28
29//DEL class ostream;
30
31class Code {
32
33public:
34
35 //constructors
36
37 //default to success, default success code is 1
38 Code(int s=1,int f=0):_fail(0),_success(0)
39 {
40 if(f==0) {setSuccess(s);}
41 else if(s==0) {setFail(f);}
42 }
43
44 //copy
45 Code(const Code &c)
46 :_fail(c.fail()),_success(c.success())
47 {}
48
49 //access
50
51 inline int fail()const {return _fail;}
52 inline int success()const {return _success;}
53
54 //set
55 inline void setFail(int i)
56 {assert(i); _fail=i; _success=0;}
57 inline void setSuccess(int i)
58 {assert(i); _success=i; _fail=0;}
59
60
61private:
62
63 //data
64
65 int _fail; // failure code
66 int _success; // success code
67
68};
69
70#endif
XmlRpcServer s
Definition: HelloServer.cpp:11