|
From: Kristof V. L. <kr...@co...> - 2004-04-08 10:59:34
|
Whoops, my mistake - I thought the NMEA parser would do the reading and the parsing in one go, but this makes a lot more sense. BTW: Is any actual parsing being done in LogFileParser? If not, should we rename LogFileParser to LogFileReader (as you did in the example code)? Just to make separation of concerns more clear between these classes in the future.. Best, Kristof. http://www.comp.lancs.ac.uk/~kristof > -----Original Message----- > From: cst...@li... [mailto:cst...@li...] On > Behalf Of Stuart Reeves > Sent: 07 April 2004 13:17 > To: CSTK Development List > Subject: [Cstk-devonly] Re: NMEA Parser > > > In fact, this method fits definitely for the other parser classes as > > well.. You do need to add the channels and channel-length to the method I > > guess: > > virtual int read_line(char *line, DataCell* channels, uint numchannels)=0; > > so the method directly returns the channels in one go, right? > > Hmm... What I was thinking was that you might want to do something like > this: > > LogFileReader *l = new LogFileReader("datafile"); > NMEAParser *p = new NMEAParser(); > > while (blah) { > // Get the current line > char *line; > if (l->read_line(line); > // Parse it > p->parse_sentence(channels, numchannels, line); > ... > } > ... > } > > > Putting the channels and numchannels into read_line would be redundant > since all we're getting out of it is an unparsed string. No? |