⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mherror.h

📁 一个SIP协议栈
💻 H
字号:
#ifndef _MHERROR_H#define _MHERROR_H/********************************************************************* $Id: MHError.h,v 1.2 1999/08/31 02:22:05 cullen Exp $ *********************************************************************  This library is free software; you can redistribute it and/or modify  it under the terms of the GNU Lesser General Public License as  published by the Free Software Foundation; either version 2 of the  License, or (at your option) any later version.  In addition to the  terms and conditions set forth in the GNU Lesser General Public  License, as a condition of using this library you are required to  grant to all users of this library or any implementation utilizing  or derived from this library a reciprocal, no cost, worldwide,  perpetual, non-exclusive, non-transferable, unrestricted license to  your claims of all patents and patent applications throughout the  world that are infringed by the library or any implementation  utilizing or derived from this library.  In the event you  redistribute this library or any implementation utilizing or derived  from this library, you must prominently display the foregoing terms  and conditions with the library or the implementation utilizing or  derived from this library.   In the event of a conflict of terms between the foregoing license  grant and the terms set forth in the GNU Lesser General Public  License, the foregoing terms and conditions shall be deemed to  govern.   This library is distributed in the hope that it will be useful, but  WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU  Lesser General Public License for more details.   You should have received a copy of the GNU Lesser General Public  License along with this library; if not; write to the Free Software  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.   Copyright 1999 Vovida Networks, Inc.  All Rights Reserved. ********************************************************************* $Log: MHError.h,v $ Revision 1.2  1999/08/31 02:22:05  cullen updated header **********************************************************************/#include <exception>#include <string>#include "Trace.h"#include "Object.h"// Throw an exception#define THREAD_EXCEPTION(message, param)  throw ThreadMHError(message, param)#define VVRTP_EXCEPTION(message, param)  throw VVRTPMHError(message, param)#define SOCKET_EXCEPTION(message, param)  throw SocketMHError(message, param)#define SOCKET_TIMEOUT  throw SocketTimeOut();#define SOCKET_CANCELLED  throw SocketCancelled();#define SOCKET_STOPPED  throw WaitingStopped();#define SIGNAL_PDU_EXCEPTION(message, param)  throw SignalPduMHError(message, param)#define CONTROL_PDU_EXCEPTION(message, param)  throw ControlPduMHError(message, param)#define FASTSTART_PDU_EXCEPTION(message, param)  throw FastStartPduMHError(message, param)#define EXCEPTION_EXT(message, param)  throw MHError(message, param)#define EXCEPTION(message) EXCEPTION_EXT(message,0)namespace mh323{    class MHError : public Object,public std::exception    {    public:                MHError(const  char * pcMessage, unsigned uParameter);        MHError(const MHError & rxOther);        MHError & operator=(const MHError & rxOther);                // Returns exception description        virtual const char * what() const;        unsigned int getParameter() const;                    virtual ostream & printOn(ostream & xStream) const;    protected:                const char * m_pcMessage;        unsigned m_uParameter;    };            class SocketEvent{};    class SocketCancelled : public SocketEvent {};    class WaitingStopped  : public SocketEvent {};    class SocketTimeOut    :public SocketEvent {};        class SocketMHError : public MHError     {    public:        SocketMHError(const  char * pcMessage, unsigned uParameter):          MHError(pcMessage,uParameter) {}          SocketMHError(const SocketMHError & rxOther):          MHError(rxOther) {}    };    class ThreadMHError : public MHError     {    public:        ThreadMHError(const  char * pcMessage, unsigned uParameter):          MHError(pcMessage,uParameter) {}          ThreadMHError(const SocketMHError & rxOther):          MHError(rxOther) {}    };    class MutexMHError  : public MHError     {    public:        MutexMHError(const  char * pcMessage, unsigned uParameter) :          MHError(pcMessage,uParameter) {}          MutexMHError(const SocketMHError & rxOther) :          MHError(rxOther) {}    };        class SignalPduMHError : public MHError     {    public:        SignalPduMHError(const  char * pcMessage, unsigned uParameter):          MHError(pcMessage,uParameter) {}          SignalPduMHError(const SocketMHError & rxOther):          MHError(rxOther) {}    };    class ControlPduMHError : public MHError     {    public:        ControlPduMHError(const  char * pcMessage, unsigned uParameter):          MHError(pcMessage,uParameter) {}          ControlPduMHError(const SocketMHError & rxOther):          MHError(rxOther) {}    };    class FastStartPduMHError : public MHError     {    public:        FastStartPduMHError(const  char * pcMessage, unsigned uParameter):          MHError(pcMessage,uParameter) {}          FastStartPduMHError(const SocketMHError & rxOther):          MHError(rxOther) {}    };    class VVRTPMHError  : public MHError     {    public:        VVRTPMHError(const  char * pcMessage, unsigned uParameter) :          MHError(pcMessage,uParameter) {}          VVRTPMHError(const SocketMHError & rxOther) :          MHError(rxOther) {}    };}#endif // _MHError_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -