SimFQT Logo  1.00.0
C++ Simulated Fare Quote System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
Coding Rules

In the following sections we describe the naming conventions which are used for files, classes, structures, local variables, and global variables.

Default Naming Rules for Variables

Variables names follow Java naming conventions. Examples:

  • lNumberOfPassengers
  • lSeatAvailability

Default Naming Rules for Functions

Function names follow Java naming conventions. Example:

  • int myFunctionName (const int& a, int b)

Default Naming Rules for Classes and Structures

Each new word in a class or structure name should always start with a capital letter and the words should be separated with an under-score. Abbreviations are written with capital letters. Examples:

  • MyClassName
  • MyStructName

Default Naming Rules for Files

Files are named after the C++ class names.

Source files are named using .cpp suffix, whereas header files end with .hpp extension. Examples:

  • FlightDate.hpp
  • SegmentDate.cpp

Default Functionality of Classes

All classes that are configured by input parameters should include:

  • default empty constructor
  • one or more additional constructor(s) that takes input parameters and initializes the class instance
  • setup function, preferably named `setup' or `set_parameters'

Explicit destructor functions are not required, unless they are needed. It shall not be possible to use any of the other member functions unless the class has been properly initiated with the input parameters.