DumontEXE 0.0.1
cmcError.h
00001 /* ***************************************************************************
00002 **
00003 ** Copyright (C) 2007 Lorimark Solutions, LLC. All rights reserved.
00004 **
00005 ** This file is part of the DumontEXE Scripting Extension Kit
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://dumont.showoff-db.org/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://dumont.showoff-db.org/licensing.html 
00017 ** or contact the sales department at sales@lorimarksolutions.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ** author: Mark Petryk ~ Lorimark Solutions, LLC
00023 ** **************************************************************************/
00024 
00025 #ifndef CDA_ERROR_H_422FD07F_0597_4cbb_A034_9AE85166472E
00026 #define CDA_ERROR_H_422FD07F_0597_4cbb_A034_9AE85166472E
00027 
00028 #include <QMetaType>
00029 #include <QObject>
00030 #include <QString>
00031 
00032 namespace cmcDatabaseApi {
00033 
00034 #define CMC_ERROR( n,d ) error()-> set( __FILE__, __LINE__, Q_FUNC_INFO, qPrintable(objectName()), n, d );
00035 
00036 /*!
00037 ** \brief Cmc Error Object
00038 **
00039 ** The error object is a container for dealing with application errors.  It
00040 **  is a class that is closely linked to the \ref cmcObject class.  Every
00041 **  cmcObject has its own cmcError object, which allows each object to report
00042 **  its own error to its own object.
00043 **
00044 */
00045 class cmcError:
00046   public QObject
00047 {
00048   Q_OBJECT
00049   Q_CLASSINFO( "DestroyObject", "no" )
00050   public:
00051 
00052     /*!
00053     ** \brief Copy Constructor
00054     **
00055     */
00056     cmcError( const cmcError & copy );
00057 
00058     /*!
00059     ** \brief General Constructor
00060     **
00061     */
00062     cmcError( QObject * parent = NULL );
00063 
00064     virtual ~cmcError();
00065 
00066     /*!
00067     ** \internal
00068     ** \brief Set an error message
00069     **
00070     ** This sets the error message for this object.
00071     **
00072     **
00073     **
00074     */
00075     void set( const long number, const QString & description );
00076 
00077     /*!
00078     ** \internal
00079     ** \brief Set an error message
00080     **
00081     **
00082     **
00083     */
00084     void set
00085     (
00086       const char * file,
00087       long line,
00088       const char * funcInfo,
00089       const char * objectName,
00090       const long number,
00091       const QString & description
00092     );
00093 
00094     
00095 
00096   public slots:
00097 
00098     /*!
00099     ** \brief Clear the error message
00100     **
00101     **
00102     */
00103     void clear();
00104 
00105     /*!
00106     ** \brief Return the Error Number
00107     **
00108     **
00109     */
00110     long number();
00111 
00112     /*!
00113     ** \brief Return the Error Description
00114     **
00115     */
00116     QString description();
00117 
00118     /*!
00119     ** \brief Formatted Message
00120     **
00121     ** This returns the error number and error message combined.
00122     **
00123     */
00124     QString message();
00125 
00126   private:
00127 
00128     long m_number;
00129 
00130     QString m_description;
00131 
00132 }; // endclass cmcError:
00133 
00134 } // endnamespace cmcDatabaseApi
00135 
00136 #endif // #ifndef CDA_ERROR_H
00137 
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com