activemq-cpp-3.3.0

src/main/decaf/net/SocketException.h

Go to the documentation of this file.
00001 /*
00002  * Licensed to the Apache Software Foundation (ASF) under one or more
00003  * contributor license agreements.  See the NOTICE file distributed with
00004  * this work for additional information regarding copyright ownership.
00005  * The ASF licenses this file to You under the Apache License, Version 2.0
00006  * (the "License"); you may not use this file except in compliance with
00007  * the License.  You may obtain a copy of the License at
00008  *
00009  *     http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS,
00013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 #ifndef _DECAF_NET_SOCKETEXCEPTION_H_
00018 #define _DECAF_NET_SOCKETEXCEPTION_H_
00019 
00020 #include <decaf/io/IOException.h>
00021 
00022 namespace decaf{
00023 namespace net{
00024 
00028     class DECAF_API SocketException : public io::IOException
00029     {
00030     public:
00031 
00032         SocketException() throw() {}
00033 
00034         SocketException( const lang::Exception& ex ) throw()
00035         : io::IOException() {
00036             *(lang::Exception*)this = ex;
00037         }
00038 
00039         SocketException( const SocketException& ex ) throw()
00040         : io::IOException() {
00041             *(lang::Exception*)this = ex;
00042         }
00043 
00054         SocketException( const char* file, const int lineNumber,
00055                          const std::exception* cause,
00056                          const char* msg, ... )
00057         throw() : io::IOException( cause )
00058         {
00059             va_list vargs;
00060             va_start( vargs, msg );
00061             buildMessage( msg, vargs );
00062 
00063             // Set the first mark for this exception.
00064             setMark( file, lineNumber );
00065         }
00066 
00072         SocketException( const std::exception* cause )
00073             throw() : io::IOException( cause ) {}
00074 
00084         SocketException( const char* file, const int lineNumber,
00085                          const char* msg, ...) throw()
00086         : io::IOException() {
00087             va_list vargs;
00088             va_start( vargs, msg );
00089             buildMessage( msg, vargs );
00090 
00091             // Set the first mark for this exception.
00092             setMark( file, lineNumber );
00093         }
00094 
00102         virtual SocketException* clone() const {
00103             return new SocketException( *this );
00104         }
00105 
00106         virtual ~SocketException() throw() {}
00107 
00108     };
00109 
00110 }}
00111 
00112 #endif // _DECAF_NET_SOCKETEXCEPTION_H_