[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

preprocessor directives in header files



Software people,

I'd like to propose a new coding convention to add to our list at 
http://www.jlab.org/Hall-D/software/wiki/index.php/Coding_Conventions . 
All header files should have preprocessor directives to prevent their 
inclusion more than once. David L. has already de facto proposed a 
convention for these directives. For example in DCDCTrackHit.h you will see:

|// $Id$
||//
||//    File: DCDCWire.h
||// Created: Wed Oct 18 11:39:35 EDT 2006
||// Creator: davidl (on Darwin swire-b241.jlab.org 8.7.0 powerpc)
||//
||
||#ifndef _DCDCWire_
||#define _DCDCWire_
||
||#include <DCoordinateSystem.h>
||
||
||class DCDCWire:public DCoordinateSystem{
||	public:
||		float phi;		// phi angle of wire at midplane in lab coordinates
||
||		int ring;
||		int straw;
||		float stereo;
||};
||
||#endif // _DCDCWire_
||
|

|Maybe this is too obvious to mention, but I thought we should put it on 
the list anyway. Comments? If people agree, I can add the item to the 
wiki page.|
||
|  -- Mark|
|||
|||