exceptions.h
上传用户:psq1974
上传日期:2007-01-06
资源大小:1195k
文件大小:2k
- /* Copyright (C) 1998, 1999 State University of New York at Stony Brook
- Author: Andrew V. Shuvalov ( andrew@ecsl.cs.sunysb.edu )
- Software license is located in file "COPYING"
- */
- #ifndef exceptions_h
- #define exceptions_h
- #include <string>
- #ifdef _WIN32
- # define vsnprintf _vsnprintf
- #endif
- /** generic exception
- */
- class BasicException {
- std::string text;
- public:
- BasicException() {}
- void init( const char *format, ... );
- void init( const char *format, va_list ap );
- const std::string &getText() { return text; }
- };
- /** subclass of basic exceptions
- */
- class NetworkException : public BasicException {
- /** for example, in video_thread method broadcast_target::send may
- raise this exception if it can't send data to broadcast target.
- This pointer will point to broadcast_target that should be removed from
- the queue
- */
- void *some_pointer;
- public:
- NetworkException( void *some_pointer, const char *format, ... );
- void *get_pointer() const { return some_pointer; }
- };
- /** subclass of basic exceptions
- */
- class ProtocolException : public BasicException {
- public:
- ProtocolException( const char *format, ... );
- };
- /** subclass of basic exceptions
- */
- class SyntaxException : public BasicException {
- public:
- SyntaxException( const char *format, ... );
- };
- /** subclass of basic exceptions
- */
- class ShutdownException : public BasicException {
- public:
- ShutdownException( const char *format, ... );
- };
- /** subclass of basic exceptions
- */
- class MutexErrorException : public BasicException {
- public:
- MutexErrorException( const char *format, ... );
- };
- /** subclass of basic exceptions
- */
- class MutexTimeoutException : public BasicException {
- public:
- MutexTimeoutException( const char *format, ... );
- };
- /** subclass of basic exceptions
- */
- class VideoException : public BasicException {
- public:
- VideoException( const char *format, ... );
- };
- /** subclass of basic exceptions
- */
- class ComportException : public BasicException {
- public:
- ComportException( const char *format, ... );
- };
- #endif // exceptions_h