LRAUV  revA
NetCdfTableLogWriter.h
Go to the documentation of this file.
1 
11 #ifndef NETCDFTABLELOGWRITER_H_
12 #define NETCDFTABLELOGWRITER_H_
13 
14 #include "data/BinaryDataType.h"
15 #include "logger/HasFilename.h"
16 #include "logger/TableLogWriter.h"
17 #include "utils/NetCdfWriter.h"
18 #include "utils/Str.h"
19 
20 class DataValue;
21 
33 {
34 public:
35 
37  NetCdfTableLogWriter( const Str& filename, bool version4, int varCount, char** varListt, char** unitList,
38  bool interpolate = false, int attCount = 0, char** attList = NULL );
39 
41  virtual ~NetCdfTableLogWriter();
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 void clearRow();
54 
55  virtual const Str& getFilename()
56  {
57  return filename_;
58  }
59 
60 private:
61  // Note that the copy constructor below is private and not given a body.
62  // Any attempt to call it will return a compiler error.
63  NetCdfTableLogWriter( const NetCdfTableLogWriter& old ); // disallow copy constructor
64 
67 
69  void addVar( const int index, const ElementURI* uri, BinaryDataType binaryType, const Unit& unit, short universalCode );
70 
72  void setAttValue( const DataEntry *dataEntry, const int attIndex );
73 
75  unsigned int writeToColumn( const DataEntry *dataEntry, const int column );
76 
77  // Write a netcdf record
78  unsigned int writeRow();
79 
81  void netCdfInitialize();
82 
83  const Str filename_;
84  int attCount_;
85  char** attList_;
86  unsigned short* attUriCodes_;
90  bool finalized_;
94 
95 };
96 
97 #endif /*NETCDFTABLELOGWRITER_H_*/
unsigned int writeRow()
Definition: NetCdfTableLogWriter.cpp:173
BinaryDataType
These are binary type identifiers for serializing and unserializing The syntax below handles up to 16...
Definition: BinaryDataType.h:39
char ** attList_
Definition: NetCdfTableLogWriter.h:85
bool finalized_
Definition: NetCdfTableLogWriter.h:90
const NetCdf::NetCdfAtt ** attUnits_
Definition: NetCdfTableLogWriter.h:92
void setAttValue(const DataEntry *dataEntry, const int attIndex)
Set an attribute value.
Definition: NetCdfTableLogWriter.cpp:102
unsigned int writeFooter()
Finish writing the NetCDF file.
Definition: NetCdfTableLogWriter.cpp:193
virtual ~NetCdfTableLogWriter()
Destructor.
Definition: NetCdfTableLogWriter.cpp:179
NetCdfWriter * netCdfWriter_
Definition: NetCdfTableLogWriter.h:88
A DataValue is an abstract base class for a data value and associated engineering units of the value...
Definition: DataValue.h:35
NetCdfTableLogWriter(const Str &filename, bool version4, int varCount, char **varListt, char **unitList, bool interpolate=false, int attCount=0, char **attList=NULL)
Constructor.
Definition: NetCdfTableLogWriter.cpp:22
One "entry" in a LogQueue.
Definition: LogEntry.h:33
Definition: NetCdf.h:73
virtual const Str & getFilename()
Definition: NetCdfTableLogWriter.h:55
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 netCdfInitialize()
Initialize the NetCDF file.
Definition: NetCdfTableLogWriter.cpp:252
Defines a LogWriter that generates a text table of values.
Definition: TableLogWriter.h:31
Replacement for standard template class string.
Definition: Str.h:12
unsigned int write(const LogEntry *entry, const Unit *unit=NULL)
Write an entry to the buffer.
Definition: NetCdfTableLogWriter.cpp:65
bool netCdfInitialized_
Definition: NetCdfTableLogWriter.h:89
Simple Interface that contains getFilename() function.
virtual void clearRow()
Definition: NetCdfTableLogWriter.cpp:233
int * attCodeLookup_
Definition: NetCdfTableLogWriter.h:87
const NetCdf::NetCdfAtt ** atts_
Definition: NetCdfTableLogWriter.h:91
void initializeNetCdfTableLogWriter()
Initialize variables, etc.
Definition: NetCdfTableLogWriter.cpp:249
Contains the BinaryDataType enumeration.
int attCount_
Definition: NetCdfTableLogWriter.h:84
Contains the NetCdfWriter class declaration.
Code unit that represents a unique name for a DataElement.
Definition: ElementURI.h:27
void addVar(const int index, const ElementURI *uri, BinaryDataType binaryType, const Unit &unit, short universalCode)
Add a new variable.
Definition: NetCdfTableLogWriter.cpp:381
Defines a LogWriter that generates a NetCDF table of values.
Definition: NetCdfTableLogWriter.h:32
unsigned short * attUriCodes_
Definition: NetCdfTableLogWriter.h:86
Simple Interface that contains getFilename() function.
Definition: HasFilename.h:20
Code that represents an engineering unit.
Definition: Unit.h:24
const Str filename_
Definition: NetCdfTableLogWriter.h:83
Definition: NetCdf.h:84
unsigned int writeToColumn(const DataEntry *dataEntry, const int column)
Write a data item.
Definition: NetCdfTableLogWriter.cpp:155
NetCdf::NetCdfVar ** vars_
Definition: NetCdfTableLogWriter.h:93
unsigned int writeHeader()
Start writing the NetCDF file.
Definition: NetCdfTableLogWriter.cpp:55
Contains the TableLogWriter class definition.