Browse Source

Using #pragma once in headers

interpolate
Michael Uleysky 2 years ago
parent
commit
3362c02178
  1. 5
      include/NEMO.h
  2. 5
      include/basedata.h
  3. 5
      include/odm.h
  4. 6
      include/simple2ddata.h
  5. 6
      include/tindexes.h
  6. 6
      include/vartype.h

5
include/NEMO.h

@ -1,3 +1,4 @@
#pragma once
#include "DataAdapters/ncfilealt.h"
#include "mdatetime.h"
#include "simple2ddata.h"
@ -8,9 +9,6 @@
#include <stdlib.h>
#include <sys/types.h>
#if !defined(M__NEMO)
#define M__NEMO
using michlib::Ceil;
using michlib::Floor;
using michlib::int2;
@ -394,4 +392,3 @@ template<> inline NEMOData::Data NEMOData::Read<vartype::Vartype::MLD>(const std
template<> inline NEMOData::Data NEMOData::Read<vartype::Vartype::SSH>(const std::vector<size_t>& tindex) const { return ReadVar("zos", tindex); }
template<> inline NEMOData::Data NEMOData::Read<vartype::Vartype::W>(const std::vector<size_t>& tindex) const { return ReadVar("wo", tindex); }
#endif

5
include/basedata.h

@ -1,8 +1,6 @@
#pragma once
#include "comdefs.h"
#if !defined(M__BASEDATA)
#define M__BASEDATA
using michlib::real;
class BaseData
@ -29,4 +27,3 @@ class BaseData
explicit operator bool() const { return data.size() != 0; }
};
#endif

5
include/odm.h

@ -1,11 +1,9 @@
#pragma once
#include "BFileW.h"
#include "GPL.h"
#include "NEMO.h"
#include "tindexes.h"
#if !defined(M__ODM)
#define M__ODM
using michlib::BFileW;
using michlib::errmessage;
using michlib::GPL;
@ -89,4 +87,3 @@ inline NEMOData NEMOOpen(const CLArgs& args)
ndata.Open(dataset, cred, proxy);
return ndata;
}
#endif

6
include/simple2ddata.h

@ -1,8 +1,6 @@
#pragma once
#include "basedata.h"
#if !defined(M__SIMPLE2DDATA)
#define M__SIMPLE2DDATA
class Simple2DData: public BaseData
{
real x0 = 0.0, y0 = 0.0;
@ -75,5 +73,3 @@ class Simple2DData: public BaseData
return *this;
}
};
#endif

6
include/tindexes.h

@ -1,10 +1,8 @@
#pragma once
#include "mdatetime.h"
#include <memory>
#include <vector>
#if !defined(M__TINDEXES)
#define M__TINDEXES
using michlib::MDateTime;
template<class T> std::vector<size_t> GetTIndexes(const T& adapter, const MDateTime& b, const MDateTime& e)
@ -63,5 +61,3 @@ template<class T> size_t GetTIndex(const T& adapter, const MDateTime& t)
if(t >= adapter.Time(i) && t <= adapter.Time(i + 1)) return (t - adapter.Time(i) <= adapter.Time(i + 1) - t) ? i : (i + 1);
return 0;
}
#endif

6
include/vartype.h

@ -1,9 +1,7 @@
#pragma once
#include "MString.h"
#include <variant>
#if !defined(M__VARTYPE)
#define M__VARTYPE
using michlib::MString;
namespace vartype
@ -118,5 +116,3 @@ class VarType: public vartype::VartypeUnion
*this);
}
};
#endif

Loading…
Cancel
Save