# MI - Fimex: include/felt/FeltConstants.h Source File

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

# include/felt/FeltConstants.h

Go to the documentation of this file.

    00001 /*
    00002  wdb
    00003
    00004  Copyright (C) 2007 met.no
    00005
    00006  Contact information:
    00007  Norwegian Meteorological Institute
    00008  Box 43 Blindern
    00009  0313 OSLO
    00010  NORWAY
    00011  E-mail: wdb@met.no
    00012
    00013  This program is free software; you can redistribute it and/or modify
    00014  it under the terms of the GNU General Public License as published by
    00015  the Free Software Foundation; either version 2 of the License, or
    00016  (at your option) any later version.
    00017
    00018  This program is distributed in the hope that it will be useful,
    00019  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00020  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00021  GNU General Public License for more details.
    00022
    00023  You should have received a copy of the GNU General Public License
    00024  along with this program; if not, write to the Free Software
    00025  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
    00026  MA  02110-1301, USA
    00027  */
    00028
    00029 #ifndef FELTCONSTANTS_H_
    00030 #define FELTCONSTANTS_H_
    00031
    00032 #include <algorithm>
    00033 #include <boost/static_assert.hpp>
    00034
    00035 namespace felt
    00036 {
    00037
    00039 typedef short int word;
    00040
    00041 const size_t blockWords = 1024;
    00042 const size_t blockSize = blockWords * sizeof(word);
    00043 const size_t offsetToContentDefinition = 2;
    00044
    00045 /* M_PI not in <cmath> for C++98 */
    00046 #ifndef M_PI
    00047 #define M_PI  3.14159265358979323846  /* pi */
    00048 #endif
    00049
    00051 const double PI = M_PI;
    00053 const double EARTH_RADIUS = 6371000.;
    00054
    00059 inline bool isUndefined(word w)
    00060 {
    00061         return -32767 == w;
    00062 }
    00063
    00064 }
    00065
    00066 BOOST_STATIC_ASSERT(sizeof(felt::word) == 2);
    00067
    00068
    00069 #endif /*FELTCONSTANTS_H_*/