DD4hep - The AIDA detector description toolkit for high energy physics experiments
DD4hep  Rev:Unversioneddirectory
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Errors.cpp
Go to the documentation of this file.
1 // AIDA Detector description implementation for LCD
2 //--------------------------------------------------------------------------
3 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
4 // All rights reserved.
5 //
6 // For the licensing terms see $DD4hepINSTALL/LICENSE.
7 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
8 //
9 // \author Markus Frank
10 // \date 2016-02-02
11 // \version 1.0
12 //
13 //==========================================================================
14 // $Id$
15 
16 // Framework include files
17 #include "DD4hep/Errors.h"
18 
19 // C/C++ includes
20 #include <cerrno>
21 #include <cstring>
22 
23 #define IMPLEMENT(x,y) std::string x () { return ::strerror( errno = y ); }
24 
25 namespace DD4hep { namespace Errors {
26  IMPLEMENT(noPermission,EPERM) // 1
27  IMPLEMENT(noEntry,ENOENT) // 2
28  IMPLEMENT(ioError,EIO) // 5
29  IMPLEMENT(invalidArg,EINVAL) // 22
30  IMPLEMENT(noSys,ENOSYS) // 38
31  IMPLEMENT(cancelled,ECANCELED) // 125
32 #ifdef __APPLE__
33  IMPLEMENT(linkRange,EINVAL) // 48 does not exist on apple
34  IMPLEMENT(noKey,EINVAL) // 126 does not exist on apple
35 #else
36  IMPLEMENT(linkRange,ELNRNG) // 48
37  IMPLEMENT(noKey,ENOKEY) // 126
38 #endif
39  }}
IMPLEMENT(noPermission, EPERM) IMPLEMENT(noEntry
std::string noPermission()
System error string for EPERM. Sets errno accordingly.
std::string cancelled()
System error string for ECANCELED. Sets errno accordingly.
std::string noKey()
System error string for ENOKEY. Sets errno accordingly.
std::string noSys()
System error string for ENOSYS. Sets errno accordingly.
std::string invalidArg()
System error string for EINVAL. Sets errno accordingly.
std::string ioError()
System error string for EIO. Sets errno accordingly.
std::string noEntry()
System error string for ENOENT. Sets errno accordingly.
std::string linkRange()
System error string for ELNRNG. Sets errno accordingly.