NetCDF-C++
4.3.2
Toggle main menu visibility
Loading...
Searching...
No Matches
ncFile.h
1
#include <string>
2
#include "ncGroup.h"
3
#include "netcdf.h"
4
5
#ifndef NcFileClass
6
#define NcFileClass
7
8
10
namespace
netCDF
11
{
12
18
class
NcFile
:
public
NcGroup
19
{
20
public
:
21
22
enum
FileMode
23
{
24
read
,
25
write
,
26
replace
,
27
newFile
28
};
29
30
enum
FileFormat
31
{
32
classic
,
33
classic64
,
34
nc4
,
35
nc4classic
36
};
37
38
40
NcFile
();
41
47
48
NcFile
(
const
std::string& filePath,
const
int
ncFileFlags);
49
50
60
NcFile
(
const
std::string& filePath,
const
FileMode
fMode);
61
67
void
create
(
const
std::string& filePath,
const
int
ncFileFlags);
68
74
void
open
(
const
std::string& filePath,
int
ncFileFlags);
75
76
86
void
open
(
const
std::string& filePath,
const
FileMode
fMode);
87
95
NcFile
(
const
std::string& filePath,
const
FileMode
fMode,
const
FileFormat
fFormat);
103
void
open
(
const
std::string& filePath,
const
FileMode
fMode,
const
FileFormat
fFormat);
104
106
void
close
();
107
109
virtual
~NcFile
();
//closes file and releases all resources
110
112
void
sync
();
113
115
void
set_Fill
(
int
fillmode,
int
*old_modep);
116
118
void
redef
();
119
121
void
enddef
();
122
123
std::string getPath()
const
;
124
125
126
private
:
127
/* Do not allow definition of NcFile involving copying any NcFile or NcGroup.
128
Because the destructor closes the file and releases al resources such
129
an action could leave NcFile objects in an invalid state */
130
NcFile
& operator =(
const
NcGroup
& rhs);
131
NcFile
& operator =(
const
NcFile
& rhs);
132
NcFile
(
const
NcGroup
& rhs);
133
NcFile
(
const
NcFile
& rhs);
134
};
135
136
}
137
138
139
#endif
netCDF::NcFile::NcFile
NcFile()
Constructor generates a null object.
Definition
ncFile.cpp:39
netCDF::NcFile::sync
void sync()
Synchronize an open netcdf dataset to disk.
Definition
ncFile.cpp:161
netCDF::NcFile::enddef
void enddef()
Leave define mode, used for classic model.
Definition
ncFile.cpp:176
netCDF::NcFile::set_Fill
void set_Fill(int fillmode, int *old_modep)
Elect a fill parameter different that the one currently being used.
Definition
ncFile.cpp:165
netCDF::NcFile::NcFile
NcFile(const std::string &filePath, const FileMode fMode)
Opens a netCDF file.
netCDF::NcFile::create
void create(const std::string &filePath, const int ncFileFlags)
Create a netCDF file.
Definition
ncFile.cpp:110
netCDF::NcFile::open
void open(const std::string &filePath, const FileMode fMode, const FileFormat fFormat)
Creates a netCDF file of a specified format.
netCDF::NcFile::FileMode
FileMode
Definition
ncFile.h:23
netCDF::NcFile::newFile
@ newFile
Create new file, fail if already exists.
Definition
ncFile.h:27
netCDF::NcFile::read
@ read
File exists, open read-only.
Definition
ncFile.h:24
netCDF::NcFile::write
@ write
File exists, open for writing.
Definition
ncFile.h:25
netCDF::NcFile::replace
@ replace
Create new file, even if already exists.
Definition
ncFile.h:26
netCDF::NcFile::open
void open(const std::string &filePath, int ncFileFlags)
Opens a netCDF file.
netCDF::NcFile::close
void close()
Close a file before destructor call.
Definition
ncFile.cpp:29
netCDF::NcFile::NcFile
NcFile(const std::string &filePath, const FileMode fMode, const FileFormat fFormat)
Creates a netCDF file of a specified format.
netCDF::NcFile::redef
void redef()
Redefine variable.
Definition
ncFile.cpp:171
netCDF::NcFile::FileFormat
FileFormat
Definition
ncFile.h:31
netCDF::NcFile::classic
@ classic
Classic format, classic data model.
Definition
ncFile.h:32
netCDF::NcFile::classic64
@ classic64
64-bit offset format, classic data model
Definition
ncFile.h:33
netCDF::NcFile::nc4
@ nc4
(default) netCDF-4/HDF5 format, enhanced data model
Definition
ncFile.h:34
netCDF::NcFile::nc4classic
@ nc4classic
netCDF-4/HDF5 format, classic data model
Definition
ncFile.h:35
netCDF::NcFile::open
void open(const std::string &filePath, const FileMode fMode)
Opens a netCDF file.
netCDF::NcFile::NcFile
NcFile(const std::string &filePath, const int ncFileFlags)
Opens a netCDF file.
netCDF::NcGroup::NcGroup
NcGroup()
Constructor generates a null object.
Definition
ncGroup.cpp:52
netCDF
C++ API for netCDF4.
Definition
ncAtt.h:10
Return to the Main Unidata NetCDF page.
Generated on
for NetCDF-C++. NetCDF is a
Unidata
library.