$ Id:$ -------------------------------------------------------------- Coding Standards ================ additional to the ALICE C++ Coding Conventions 1. Ordering of headers: 1. Ali* 2. G4* 3. other packages (CLHEP, ODBMS, ROOT, ...) 4. system (eg. ) 2. Use G4 basic type instead of "raw" types: G4int, G4double, G4bool, G4String, ... 3. Inline fuctions: When implementation of inline methods is within two lines, put it in the header file after the class declaration in the header file (*.hh or *.ddl); otherwise put it in a separated *.cc file. 4. Declare member functions that should not change class member data as const. 5. Re-declare virtual member functions in a derived class with a keyword virtual. 6. Header file: Place each section in the class declarations (public, protected, private) in this order: // constructors // destructor // operators // static methods // methods // set methods // get methods // static data members // data members Use comment line for all sections except for constructors and destructors. 7. Implementation file: declare class definitions in this order: // static data members // static methods // constructors // destructors // methods Private definitions should be declared first, then protected and public. 8. Exception/Warning: Use AliGlobal::Exception()/Warning(); (or TG4Global in g4mc) use this form of text: class_name::method_name: exception/warning_text 9. Style: Standard indention: 2 spaces; Max. line length: 80 characters; Recomendations: - default constructor - protected in suitable cases (to prevent from creation of invalid objects) - always provide copy constructor and assignement operator for a class with pointer-type data member(s)