Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 2.54 KB

ImplementationTips.org

File metadata and controls

75 lines (54 loc) · 2.54 KB

things to go over with dobra

project 3. need to be regraded/fixed. gla thing project. have set up ahead of time.

I have both the linear scan and priority queue and adaptively choose between the two.

generic c++ tips

If you get an error like QueryTreeNode.cc:(.text+0xa1d): undefined reference to `Function::GrowFromParseTree(FuncOperator*, Schema&)’

SourceFile.cc:(.assembly+0xaddress): undefined reference to `SomeClass::Somefunction(ParameterOne, ParameterTwo…)’

Then consider your makefiles. You may not be linking in the object files that contain the definitions. Or you may be linking them in the wrong order.

STL usage

if you intend to use STL directly, and with the objects being copied in, make sure to have a copy constructor and an assignment operator defined, because some of the objects have pointer members.

otherwise, you can use pointers and you don’t need to.

project idiosyncrasies

uninitialized writes to buffers

valgrind complains about these, but if you initialized the buffers it kills performance. the program is written to take care of this problem so that it doesn’t effect the output. It does however make it impossible to hash the files and know you have the same output.

schema class problems

memory leak from using strdup

also not freeing other pointers

relation class problems

the relation data structure in the test header files, needs to call delete on the schema pointer it contains

p1

there is an implicit MoveFirst on open. at least, the way it is used in later tests implies this is true.

p2-1

generically, make sure the comparison function works.

sorting

know that runs in is not necessarily equal to the runs out, so record where your runs start and stop.

p2-2

reading and writing ordermaker

highly suggest overloading the stream insert and stream extract operators of c++

implement merging differential file

p3

don’t use Function.tar, broken

Function.Apply, updates whichever of it’s arguments is appropriates with the value. This value needs to be added to a running total, it is not updated by Apply, meerly overwritten with whatever value needs to be taken care of by the caller of this funciton. The return value is the Type (Int or Double) that is appropriate for the function.

select pipe looks okay select file, just uses select pipe, looks fine project looks evil, cause we have to deconstruct and reconstruct records. join looks like a pain in the ass, but not evil duplicate remove requires another ordermaker, uggh sum looks okay, maybe group by looks annoying. write out doesn’t look too bad.