dberror.h

Go to the documentation of this file.
00001 // OSB library ********************************************* -*- C++ -*-
00006 /*
00007   AUTHOR(S): Stephan Broennimann (vb)
00008 
00009   RCS information
00010    $Name: OSB_060808 $
00011    $Revision: 1.13 $
00012 
00013   License
00014    OSB rating and billing library for communication networks
00015    Copyright (C) 2004, 2005, 2006  OSB systems
00016 
00017    This file may be distributed and/or modify under the terms of the
00018    GNU General Public License (GPL) as published by the Free Software
00019    Foundation which is provided in the file LICENSE.GPL included in the
00020    packaging of this file.
00021 
00022    The file is distributed in the hope that it will be useful, but WITHOUT
00023    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00024    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00025    for more details.
00026 
00027    Holders of a OSB Commercial License may use this file under the terms
00028    and conditions of this commercial license.
00029  */
00030 #ifndef _DBERROR_H_
00031 #define _DBERROR_H_
00032 
00033 // *********************************************************************
00034 // included header files
00035 // + standard includes
00036 
00037 // + local headers
00038 #include "osberror.h"
00039 
00040 // *********************************************************************
00041 // namespace extensions
00042 namespace OSB_DB {
00043 
00044 // *********************************************************************
00045 // class definitions
00047     class DbException : public OSB_LIB::OsbException {
00048     public:
00050         explicit DbException(
00051             const std::string& dbMsg
00052         ) : OsbException(defErrorNo_), dbErrNo_(0)
00053         {
00054             *this << dbMsg;
00055         }
00056 
00058         DbException(
00059                   long         dbErrNo,
00060             const std::string& dbMsg
00061         ) : OsbException(defErrorNo_), dbErrNo_(dbErrNo)
00062         {
00063             *this << dbMsg;
00064         }
00065 
00070         DbException(
00071                   ErrorNo      errNo,
00072                   long         dbErrNo,
00073             const std::string& dbMsg
00074         ) : OsbException(errNo), dbErrNo_(dbErrNo)
00075         {
00076             *this << dbMsg;
00077         }
00078 
00079     public:
00081         long dbErrNo_;
00082     private:
00084         static const ErrorNo defErrorNo_ = 24;
00085     };                                  // class DbException
00086 
00087     // ********************************************************************
00088     // specialized database exceptions
00089 
00096     class ChildFound : public DbException {
00097     public:
00099         explicit ChildFound(
00100             const std::string& dbMsg
00101         ) : DbException(defErrorNo_, dbMsg)
00102         {
00103             // empty
00104         }
00106         ChildFound(
00107                   long         dbErrNo,
00108             const std::string& dbMsg
00109         ) : DbException(defErrorNo_, dbErrNo, dbMsg)
00110         {
00111             // empty
00112         }
00117         ChildFound(
00118                   ErrorNo      errNo,
00119                   long         dbErrNo,
00120             const std::string& dbMsg
00121         ) : DbException(errNo, dbErrNo, dbMsg)
00122         {
00123             // empty
00124         }
00125     private:
00127         static const ErrorNo defErrorNo_ = 83;
00128     };                                  // class ChildFound
00129 }                                       // namespace OSB_DB
00130 #endif                                  // #ifndef _DBERROR_H_

Generated on Sat Sep 2 14:06:32 2006 for OSB Library by  doxygen 1.4.7