Difference: LHCbCodingGuidelines (5 vs. 6)

Revision 62015-11-04 - MarcoCattaneo

Line: 1 to 1
 
META TOPICPARENT name="LHCbComputing"

LHCb Coding Guidelines

Line: 6 to 6
 
Changed:
<
<

Coding Conventions

  • The original (from 2001) C++ coding conventions are described in note LHCb-2001-054
  • An emacs customisation file has been developed by Olivier Callot to produce standard templates for source code files
>
>

C++ Coding Guidelines

  • We suggest to follow, as much as possible, Bjarne Stroustrup's C++ code guidelines. Note that, for the time being, C++14 is not allowed in LHCb production code (since it must compile with gcc48)
  • For a historical perspective, the original (from 2001) LHCb C++ coding conventions are described in note LHCb-2001-054. Many of the recommendations are still valid, as well as the naming conventions.
  • An emacs customisation file was developed to produce standard templates for source code files
 
Changed:
<
<

Data Model Conventions

>
>

Units Conventions

 
Deleted:
<
<
 

LHCb applications conventions

  • Rules for return status codes for algorithms and tools running in production applications
  • Rules for printout from algorithms and tools running in production applications. See also the printing from Gaudi FAQ
  • The Gaudi base classes for algorithms and tools provide implementations for the initialize() and finalize() methods. If you don't need to do anything specific in these methods, you not should not override the base class implementations in your derived class - rely on polymorphism to do its job.
Changed:
<
<
  • All member variables should be initialised in the constructor, even if they are again initialised in the initialize() method. Pointer variables should be initialised to NULL
  • new in initialize() must be matched by delete in finalize(), not in the destructor. If the pointer to be deleted is a member variable, test equality to NULL to avoid double deletion:
if( NULL ! = m_thePointer ) {
delete m_thePointer;
m_thePointer = NULL;
}
>
>
  • new in initialize() must be matched by delete in finalize(), not in the destructor. If the pointer to be deleted is a member variable, test equality to nullptr to avoid double deletion:
if( nullptr ! = m_thePointer ) {
delete m_thePointer;
m_thePointer = nullptr;
}
 

Interaction with the Transient Event Store

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback