many helper functions

This commit is contained in:
amannb 2011-10-25 11:47:23 -07:00 committed by Bernhard Amann
parent 3654060246
commit d7a3b85fcd
6 changed files with 245 additions and 31 deletions

View file

@ -1,3 +1,4 @@
// See the file "COPYING" in the main distribution directory for copyright.
#ifndef INPUTREADERASCII_H
#define INPUTREADERASCII_H
@ -5,6 +6,19 @@
#include "InputReader.h"
#include <fstream>
#include <iostream>
#include <vector>
// Description for input field mapping
struct FieldMapping {
string name;
TypeTag type;
int position;
FieldMapping(const string& arg_name, const TypeTag& arg_type, int arg_position);
FieldMapping(const FieldMapping& arg);
FieldMapping() { position = -1; }
bool IsEmpty() { return position == -1; }
};
class InputReaderAscii : public InputReader {
@ -19,11 +33,19 @@ protected:
virtual bool DoInit(string path, int num_fields,
const LogField* const * fields);
virtual void DoFinish();
virtual bool DoUpdate();
private:
ifstream* file;
string fname;
unsigned int num_fields;
// map columns in the file to columns to send back to the manager
vector<FieldMapping> columnMap;
};