Download - Computational Vision Group
Transcript
– ClassName – associated files ClassName.h for the class declaration and ClassName.cc for its implementation. – method_name() (within a class) – a_local_variable (global variables are forbidden) – get_a_variable(), “Accessor” – set_a_variable(), “Modifier” • All comments are to be written in plain British English. • Use the C++-style // for comments, not the C-style /* */. • Standard use of 8 character tabulation. • All main() programs and test cases have to be situated in the progs/ subdirectory. Include Files • Use the directive #include "filename.h" for user-prepared include files (i.e. those which are part of our own code). • Use the directive #include <filename.h> for include files from system libraries. • Every include file must contain a mechanism that prevents multiple inclusions of the file. The defined “guard definition” has to be written in uppercase letters, it has to begin and finish with 2 underscores, and each term has to be separated by one underscore. For example, at beginning of the include file called |ActiveShapeTracker.h— you will see #ifndef __ACTIVE_SHAPE_TRACKER_H__ #define __ACTIVE_SHAPE_TRACKER_H__ This exact format has to be adopted. Functions and Variables • Global variables and functions must be avoided; they almost always violate the principle of encapsulation. Instead use static member functions of classes, e.g. there is a PeopleTracker::create_new_id() static member function to create a new, globally unique id from any thread. 18