UExcept.cxx

Go to the documentation of this file.
00001 /**************************************************************************
00002  *
00003  * Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, The EROS
00004  *   Group, LLC.
00005  * Copyright (C) 2004, 2005, 2006, Johns Hopkins University.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or
00009  * without modification, are permitted provided that the following
00010  * conditions are met:
00011  *
00012  *   - Redistributions of source code must contain the above
00013  *     copyright notice, this list of conditions, and the following
00014  *     disclaimer.
00015  *
00016  *   - Redistributions in binary form must reproduce the above
00017  *     copyright notice, this list of conditions, and the following
00018  *     disclaimer in the documentation and/or other materials
00019  *     provided with the distribution.
00020  *
00021  *   - Neither the names of the copyright holders nor the names of any
00022  *     of any contributors may be used to endorse or promote products
00023  *     derived from this software without specific prior written
00024  *     permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00027  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00028  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00029  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
00030  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
00031  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
00032  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00033  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
00034  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00035  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00036  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037  *
00038  **************************************************************************/
00039 
00040 #include <stdint.h>
00041 #include <string>
00042 #include "UExcept.hxx"
00043 
00044 namespace sherpa {
00045 
00046   UExceptionType::UExceptionType(const std::string& s)
00047     : name(s)
00048   {
00049   }
00050 
00051   UExceptionType::~UExceptionType()
00052   {
00053   }
00054 
00055   UExceptionBase::~UExceptionBase()
00056   {
00057   }
00058 
00059   UExceptionBase::UExceptionBase(const UExceptionType *et,
00060                                  const char *file, int line,
00061                                  const std::string& msg)
00062   {
00063     this->et = et;
00064     this->msg = msg;
00065     this->file = file;
00066     this->line = line;
00067   }
00068   UExceptionBase::UExceptionBase(const UExceptionBase& cme)
00069   {
00070     this->et = cme.et;
00071     this->msg = cme.msg;
00072     this->file = cme.file;
00073     this->line = cme.line;
00074   }
00075 
00076 #define DEF_UEXCEPT(nm) UExceptionType nm(#nm)
00077 
00078   namespace excpt {
00079     DEF_UEXCEPT(Assert);
00080     DEF_UEXCEPT(OutOfMemory);
00081     DEF_UEXCEPT(IntegrityFail);
00082     DEF_UEXCEPT(Malformed);
00083     DEF_UEXCEPT(BadValue);
00084     DEF_UEXCEPT(NullArg);
00085     DEF_UEXCEPT(NoAccess);
00086     DEF_UEXCEPT(NoObject);
00087     DEF_UEXCEPT(ObjectExists);
00088     DEF_UEXCEPT(Truncated);
00089     DEF_UEXCEPT(Overrun);
00090     DEF_UEXCEPT(Subprocess);
00091     DEF_UEXCEPT(LockFail);
00092     DEF_UEXCEPT(LostLock);
00093     DEF_UEXCEPT(UniverseDied);
00094     DEF_UEXCEPT(NoConnect);
00095     DEF_UEXCEPT(NoAuth);
00096     DEF_UEXCEPT(Environ);
00097     DEF_UEXCEPT(VersionError);
00098     DEF_UEXCEPT(ConnLost);
00099     DEF_UEXCEPT(IoError);
00100     DEF_UEXCEPT(BadOpcode);
00101     DEF_UEXCEPT(PrngError);
00102     DEF_UEXCEPT(BoundsError);
00103     DEF_UEXCEPT(Unspecified);
00104   };
00105 
00106 } /* namespace sherpa */

Generated on Thu May 17 23:59:16 2012 for BitC Compiler by  doxygen 1.4.7