Coding Conventions

From GlueXWiki
Revision as of 04:15, 1 July 2006 by Davidl (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Hall-D Coding and Use Conventions

C++

  • Classes specific to Hall-D/GlueX reconstruction will have names starting with the letter "D".
  • Classes specific to a subsystem should include the subsystem name in the first part of the class name. For example, all classes in the CDC package should have names starting with "DCDC"
  • The suffix for C++ source files should be .cc
  • The suffix for C source files should be .c
  • The suffix for both C++ and C header files should be .h
  • The suffix .C will be used for ROOT macros and will therefore be ignored by the make system.
  • The suffix for FOTRAN files should be .F
  • The suffix .f will be used for PAW macros and will therefore be ignored by the make system.
  • Factory classes derived from JFactory will have names that start with the data class (subclass of DObject) which they provide with "_factory" appended. For example:

DCDCHit_factory

  • Tagged factory classes (factories with a tag other than an empty string) will have an underscore and the tag appended to the class name. For example, a factory with the tag "ALT1" :

DCDCHit_factory_ALT1