activemq-cpp-3.4.0

src/main/decaf/io/EOFException.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 
00018 #ifndef _DECAF_IO_EOFEXCEPTION_H
00019 #define _DECAF_IO_EOFEXCEPTION_H
00020 
00021 #include <decaf/io/IOException.h>
00022 
00023 namespace decaf{
00024 namespace io{
00025 
00026     /*
00027      * Signals that an End of File exception has occurred.
00028      */
00029     class DECAF_API EOFException : public io::IOException
00030     {
00031     public:
00032 
00036         EOFException() throw(){}
00037 
00042         EOFException( const lang::Exception& ex ) throw()
00043         : IOException() {
00044             *(lang::Exception*)this = ex;
00045         }
00046 
00051         EOFException( const EOFException& ex ) throw()
00052         : IOException() {
00053             *(lang::Exception*)this = ex;
00054         }
00055 
00066         EOFException( const char* file, const int lineNumber,
00067                       const std::exception* cause,
00068                       const char* msg, ... ) throw() : IOException( cause )
00069         {
00070             va_list vargs;
00071             va_start( vargs, msg );
00072             buildMessage( msg, vargs );
00073 
00074             // Set the first mark for this exception.
00075             setMark( file, lineNumber );
00076         }
00077 
00083         EOFException( const std::exception* cause ) throw() : IOException( cause ) {}
00084 
00093         EOFException( const char* file, const int lineNumber,
00094                       const char* msg, ... ) throw()
00095         : IOException()
00096         {
00097             va_list vargs;
00098             va_start( vargs, msg );
00099             buildMessage( msg, vargs );
00100 
00101             // Set the first mark for this exception.
00102             setMark( file, lineNumber );
00103         }
00104 
00112         virtual EOFException* clone() const{
00113             return new EOFException( *this );
00114         }
00115 
00116         virtual ~EOFException() throw(){}
00117 
00118     };
00119 
00120 }}
00121 
00122 #endif /*_DECAF*/