00001 //# <MirTypeAssert.h>: a base class for auto-checking of primitive type sizes 00002 //# Copyright (C) 2000,2001,2002,2003 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# 00027 //# $Id: MirTypeAssert.h,v 1.1 2009/09/03 18:54:47 pteuben Exp $ 00028 00029 #ifndef BIMA_MIRTYPEASSERT_H 00030 #define BIMA_MIRTYPEASSERT_H 00031 00032 #include <casa/Exceptions/Error.h> 00033 00034 #include <casa/namespace.h> 00035 // <summary> 00036 // an exception indicating that assumptions about the size of primitive 00037 // types are not satisfied. 00038 // </summary> 00039 00040 // <use visibility=export> 00041 00042 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00043 // </reviewed> 00044 00045 // <etymology> 00046 // Current support of Miriad uv-IO is based on certain assumptions about use 00047 // of memory, specifically the size of primitive types. 00048 // </etymology> 00049 // 00050 // <synopsis> 00051 // This exception is used to indicate that certain assumptions about the size 00052 // of primitive types do not hold. Miriad IO in aips++ assumes that the sizes 00053 // of Int, Float, and Double are equal to the corresponding sizes of int, float, 00054 // and Double; this exception is thrown when these conditions are not met. 00055 // 00056 // Normally, applications do not create and throw this exception directly as 00057 // it has been integrated into the MirTypeAssert class which 00058 // automatically checks the memory assumptions upon construction. Any class 00059 // that depends on this assumption can inherit from MirTypeAssert. 00060 // </synopsis> 00061 // 00062 // <motivation> 00063 // See summary above. 00064 // </motivation> 00065 // 00066 class MiriadMemoryAssumptionError : public AipsError { 00067 public: 00068 00069 // An exception with a message indicating the unsupported feature 00070 MiriadMemoryAssumptionError(const String &msg); 00071 00072 virtual ~MiriadMemoryAssumptionError() throw(); 00073 00074 protected: 00075 // Message-less exceptions should not be created excepted possibly by 00076 // subclasses 00077 MiriadMemoryAssumptionError(); 00078 }; 00079 00080 // <summary> 00081 // a base for classes that rely on assumptions regarding privitive type sizes. 00082 // </summary> 00083 00084 // <use visibility=export> 00085 00086 // <reviewed reviewer="" date="yyyy/mm/dd" tests="" demos=""> 00087 // </reviewed> 00088 00089 // <etymology> 00090 // Current support of Miriad uv-IO is based on certain assumptions about use 00091 // of memory, specifically the size of primitive types. 00092 // </etymology> 00093 // 00094 // <synopsis> 00095 // This exception is used to indicate that certain assumptions about the size 00096 // of primitive types do not hold. Miriad IO in aips++ assumes that the sizes 00097 // of Int, Float, and Double are equal to the corresponding sizes of int, float, 00098 // and Double; this exception is thrown when these conditions are not met. 00099 // 00100 // Normally, applications do not create and throw this exception directly as 00101 // it has been integrated into the MirTypeAssert class which 00102 // automatically checks the memory assumptions upon construction. Any class 00103 // that depends on this assumption can inherit from MirTypeAssert. 00104 // </synopsis> 00105 // 00106 // <motivation> 00107 // See summary above. 00108 // </motivation> 00109 // 00110 class MirTypeAssert { 00111 public: 00112 MirTypeAssert(); 00113 00114 protected: 00115 static Bool ok; 00116 }; 00117 00118 #endif