Thursday, May 24, 2007

Class structure

One product of our Tuesday meeting was a general outline of the class structure for the project.
  • Parser class
    • functions to parse tab or comma delimited PBDB files
  • Occurrence class
    • The fundamental data of our analysis, contains information about each fossil occurrence
  • Lineage class
    • Summarizes a group of occurrences of a single lineage, in our program this will be equivalent to genus-level resolution
  • NodeOfInterest class
    • (this may need to be split up into several classes)

Tuesday, May 22, 2007

Parsing input and the occurrence class

From Derrick:

-Put the Parser class into its own .h and .cpp files. Just copy the way that things are laid out in the Occurence class .cpp and .h. Note that I put function definitions (the actual code of a function) within the class declaration for Parser. That is legal, but you should break it out so that only function declarations go in the class declaration in the .h file and the actual code goes in the .cpp. Add the files to the xcode project, and make sure that it still compiles.

-Add some error detection to the parser class. Right now the Parse function just takes the string passed in, breaks it up by tabs and sticks the pieces into strings. Add a second argument to the function, which is an integer that specifies the expected number of chunks that the line will be broken into. Add an integer return value to the Parse function, which will be an error code (0 for no error, nonzero for an error). At the end of the function, check whether the number of chunks (using the size() function) is equal to the expected number passed in. If it is, return 0, else return 1.

-Allow the parser to break up the lines using delimiters besides tab. It might be useful for it to use other characters such as comma or space. Add a member to the Parser class that is a char called delimiter. In the Parse function where it currently checks whether a character is equal to '\t', change it to check whether the character is equal to delimiter. This final part may be a bit more challenging: Make the Parser constructor function take a char argument, which is set as the delimiter.

Monday, May 21, 2007

Starting the project...

Set up this blog today.