LRAUV  revA
NetCdfLogWriter.h
Go to the documentation of this file.
1 
11 #ifndef NETCDFLOGWRITER_H_
12 #define NETCDFLOGWRITER_H_
13 
14 #include "data/BinaryDataType.h"
15 #include "logger/FilterLogWriter.h"
16 #include "logger/HasFilename.h"
17 #include "utils/NetCdfWriter.h"
18 #include "utils/Str.h"
19 
20 class DataValue;
21 
33 {
34 public:
35 
37  NetCdfLogWriter( const Str& filename, bool version4, int varCount, char** varList, char** unitList,
38  int attCount = 0, char** attList = NULL );
39 
41  virtual ~NetCdfLogWriter();
42 
44  unsigned int writeHeader();
45 
48  unsigned int write( const LogEntry *entry, const Unit* unit = NULL );
49 
51  unsigned int writeFooter();
52 
53  virtual const Str& getFilename()
54  {
55  return filename_;
56  }
57 
58 protected:
59 
60  // Override this method to do something special with data entries
61  virtual unsigned int writeData( const DataEntry *dataEntry, int index, const Unit* unit );
62 
63  // Override this method to do something special with attribute entries
64  virtual unsigned int writeAtt( const DataEntry *dataEntry, int index, const Unit* unit );
65 
66 
67 private:
68  // Note that the copy constructor below is private and not given a body.
69  // Any attempt to call it will return a compiler error.
70  NetCdfLogWriter( const NetCdfLogWriter& old ); // disallow copy constructor
71 
74 
76  void addVar( const int index, const ElementURI* uri, BinaryDataType binaryType, const Unit& unit, short universalCode );
77 
79  void setAttValue( const DataEntry *dataEntry, const int attIndex );
80 
82  void netCdfInitialize();
83 
84  const Str filename_;
87  bool finalized_;
91 
92 };
93 
94 #endif /*NETCDFLOGWRITER_H_*/
Defines a LogWriter that generates a NetCDF table of values.
Definition: NetCdfLogWriter.h:32
Defines a LogWriter that generates a text table of values.
Definition: FilterLogWriter.h:32
virtual const Str & getFilename()
Definition: NetCdfLogWriter.h:53
BinaryDataType
These are binary type identifiers for serializing and unserializing The syntax below handles up to 16...
Definition: BinaryDataType.h:39
void netCdfInitialize()
Initialize the NetCDF file.
Definition: NetCdfLogWriter.cpp:150
bool netCdfInitialized_
Definition: NetCdfLogWriter.h:86
void addVar(const int index, const ElementURI *uri, BinaryDataType binaryType, const Unit &unit, short universalCode)
Add a new variable.
Definition: NetCdfLogWriter.cpp:206
NetCdfLogWriter(const Str &filename, bool version4, int varCount, char **varList, char **unitList, int attCount=0, char **attList=NULL)
Constructor.
Definition: NetCdfLogWriter.cpp:22
NetCdfWriter * netCdfWriter_
Definition: NetCdfLogWriter.h:85
virtual ~NetCdfLogWriter()
Destructor.
Definition: NetCdfLogWriter.cpp:99
const Str filename_
Definition: NetCdfLogWriter.h:84
virtual unsigned int writeAtt(const DataEntry *dataEntry, int index, const Unit *unit)
Definition: NetCdfLogWriter.cpp:93
A DataValue is an abstract base class for a data value and associated engineering units of the value...
Definition: DataValue.h:35
NetCdf::NetCdfVar ** vars_
Definition: NetCdfLogWriter.h:88
One "entry" in a LogQueue.
Definition: LogEntry.h:33
bool finalized_
Definition: NetCdfLogWriter.h:87
Code unit that represents an atomic unit of data destined for writing in the log file.
Definition: DataEntry.h:43
A very compact, very simple netCDF writer with a minimal feature set.
Definition: NetCdfWriter.h:32
void initializeNetCdfLogWriter()
Initialize variables, etc.
Definition: NetCdfLogWriter.cpp:147
virtual unsigned int writeData(const DataEntry *dataEntry, int index, const Unit *unit)
Definition: NetCdfLogWriter.cpp:78
Replacement for standard template class string.
Definition: Str.h:12
unsigned int writeHeader()
Start writing the NetCDF file.
Definition: NetCdfLogWriter.cpp:42
Simple Interface that contains getFilename() function.
Contains the FilterLogWriter class definition.
void setAttValue(const DataEntry *dataEntry, const int attIndex)
Set an attribute value.
Contains the BinaryDataType enumeration.
unsigned int writeFooter()
Finish writing the NetCDF file.
Definition: NetCdfLogWriter.cpp:111
Contains the NetCdfWriter class declaration.
unsigned int write(const LogEntry *entry, const Unit *unit=NULL)
Write an entry to the buffer.
Definition: NetCdfLogWriter.cpp:47
NetCdf::NetCdfVar ** timeVars_
Definition: NetCdfLogWriter.h:90
Code unit that represents a unique name for a DataElement.
Definition: ElementURI.h:27
Simple Interface that contains getFilename() function.
Definition: HasFilename.h:20
Code that represents an engineering unit.
Definition: Unit.h:24
Definition: NetCdf.h:84
const ElementURI ** varUris_
Definition: NetCdfLogWriter.h:89