Feature #76: Code reorganization
Replace THa prefix with namespaces
|Status:||In Progress||Start date:|
|Category:||-||Estimated time:||16.00 hours|
|Target version:||1.7||Spent time:||23.00 hours|
The archaic THa prefix to class names should be replaced with appropriate namespaces like Podd and HallA. The old names may still be made available to legacy code via typedefs.
#3 Updated by Ole Hansen over 2 years ago
- % Done changed from 0 to 30
Removed THa prefix. Renamed THa* files to files without that prefix. Changed code accordingly. Also, renamed all *.C (except scripts) to *.cxx for consistency with ROOT and hcana.Todo:
- wrap all classes in namespaces (Podd, HallA)
- create wrapper THa*.h headers for backward compatibility
- typedef old names for backward compatibility
#4 Updated by Ole Hansen over 2 years ago
- Status changed from New to In Progress
- % Done changed from 30 to 50
Created wrapper THa*.h headers.
Typedefs do not work to alias the old names to the new because typedefs clash with class forward declarations. However, simply
#define'ing old names to the new ones does work right out of the box. Put these
hana_decode/dcCompatDefs.h. The key is to have clients see all the
#define's as early as possible so that function arguments and class forward declarations are substituted properly.
The main caveat is that "THa" names may appear in strings, for example in calls to
TClonesArray constructors or
RVarDef definitions (to indicate the class of objects inside a
TClonesArray). Those calls will fail to recognize the referenced class, and such instances will have to be modified and compiled conditionally, if necessary.
Admittedly, this business is a bit of a kludge; client classes should simply be modified to replace all instances of "THa" with "Podd::" or "HallA::". We should write a translation script for that.
Namespaces are not consistently implemented yet; that's next.