Skip to content
Stuart Mentzer edited this page Aug 6, 2015 · 26 revisions

Introduction

This is the preliminary EnergyPlus C++ coding guidelines. It is likely that this will evolve and grow considerably over time.

Source Files

  • Header file names have a .hh extension
  • Source file names have a .cc extension
  • Header and source files (we call these both "source" files in some contexts) have Linux-style (\n) line terminators (dos2unix can convert to this)

Source Structure

Header Files

  • Header files have include guards wrapping the whole file of the form
#ifndef NamespaceName_FileName_hh_INCLUDED
#define NamespaceName_FileName_hh_INCLUDED
...
#endif
  • namespaces are normally given lowercase names
  • namespaces are marked like this:
namespace thing1 {
namespace thing2 {
...
} // thing2
} // thing1
  • No extra indentation in namespaces
Clone this wiki locally