Skip to content

Commit

Permalink
Refactor classes for atomic types
Browse files Browse the repository at this point in the history
- make ctors all inline
- use intermediate class `NcAtomic` to reduce duplication of equality
  operator
- now classes are only a few lines each, move them all into `ncType.h`
  header
  • Loading branch information
ZedThree committed Jan 4, 2024
1 parent ec6394c commit 0a6d0f1
Show file tree
Hide file tree
Showing 34 changed files with 122 additions and 594 deletions.
20 changes: 0 additions & 20 deletions cxx4/ncByte.cpp

This file was deleted.

28 changes: 0 additions & 28 deletions cxx4/ncByte.h

This file was deleted.

18 changes: 0 additions & 18 deletions cxx4/ncChar.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions cxx4/ncChar.h

This file was deleted.

12 changes: 0 additions & 12 deletions cxx4/ncCompoundType.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#include "ncGroup.h"
#include "ncCheck.h"
#include "ncCompoundType.h"
#include "ncByte.h"
#include "ncUbyte.h"
#include "ncChar.h"
#include "ncShort.h"
#include "ncUshort.h"
#include "ncInt.h"
#include "ncUint.h"
#include "ncInt64.h"
#include "ncUint64.h"
#include "ncFloat.h"
#include "ncDouble.h"
#include "ncString.h"
#include "ncException.h"

using namespace std;
Expand Down
18 changes: 0 additions & 18 deletions cxx4/ncDouble.cpp

This file was deleted.

25 changes: 0 additions & 25 deletions cxx4/ncDouble.h

This file was deleted.

12 changes: 0 additions & 12 deletions cxx4/ncEnumType.cpp
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
#include "ncEnumType.h"
#include "ncGroup.h"
#include "ncCheck.h"
#include "ncByte.h"
#include "ncUbyte.h"
#include "ncChar.h"
#include "ncShort.h"
#include "ncUshort.h"
#include "ncInt.h"
#include "ncUint.h"
#include "ncInt64.h"
#include "ncUint64.h"
#include "ncFloat.h"
#include "ncDouble.h"
#include "ncString.h"
#include "ncException.h"
using namespace std;
using namespace netCDF;
Expand Down
1 change: 0 additions & 1 deletion cxx4/ncFile.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include "ncFile.h"
#include "ncCheck.h"
#include "ncException.h"
#include "ncByte.h"
#include<iostream>
#include<string>
#include<sstream>
Expand Down
18 changes: 0 additions & 18 deletions cxx4/ncFloat.cpp

This file was deleted.

24 changes: 0 additions & 24 deletions cxx4/ncFloat.h

This file was deleted.

15 changes: 2 additions & 13 deletions cxx4/ncGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,7 @@
#include "ncCompoundType.h"
#include "ncOpaqueType.h"
#include "ncGroupAtt.h"
#include "ncByte.h"
#include "ncUbyte.h"
#include "ncChar.h"
#include "ncShort.h"
#include "ncUshort.h"
#include "ncInt.h"
#include "ncUint.h"
#include "ncInt64.h"
#include "ncUint64.h"
#include "ncFloat.h"
#include "ncDouble.h"
#include "ncString.h"

#include <cstddef>
#include <ncException.h>
#include "ncCheck.h"
Expand Down Expand Up @@ -1237,7 +1226,7 @@ NcEnumType NcGroup::addEnumType(const string& name,NcEnumType::ncEnumType baseTy


// Adds a new netCDF Vlen type.
NcVlenType NcGroup::addVlenType(const string& name,NcType& baseType) const {
NcVlenType NcGroup::addVlenType(const string& name, const NcType& baseType) const {
ncCheckDefineMode(myId);
nc_type typeId;
ncCheck(nc_def_vlen(myId, name.c_str(), baseType.getId(),&typeId),__FILE__,__LINE__);
Expand Down
2 changes: 1 addition & 1 deletion cxx4/ncGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ namespace netCDF
\param basetype A NcType object to be used for the basetype.
\return The NcVlenType object for this new netCDF vlen type.
*/
NcVlenType addVlenType(const std::string& name,NcType& basetype) const;
NcVlenType addVlenType(const std::string& name, const NcType& basetype) const;


/*!
Expand Down
18 changes: 0 additions & 18 deletions cxx4/ncInt.cpp

This file was deleted.

25 changes: 0 additions & 25 deletions cxx4/ncInt.h

This file was deleted.

18 changes: 0 additions & 18 deletions cxx4/ncInt64.cpp

This file was deleted.

25 changes: 0 additions & 25 deletions cxx4/ncInt64.h

This file was deleted.

18 changes: 0 additions & 18 deletions cxx4/ncShort.cpp

This file was deleted.

Loading

0 comments on commit 0a6d0f1

Please sign in to comment.