Project

General

Profile

Actions

Feature #276

closed

Pointer to extension structure

Added by Ole Hansen almost 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
03/07/2018
Due date:
% Done:

100%

Estimated time:
2.00 h
Spent time:
Responsible:

Description

To help with maintaining binary compatibility for future patch releases of a given main release, add a pointer to an extension data structure to THaAnalysisObject. By default, this is a null pointer. If a bug fix or new feature in a certain class requires new data members (something which happens rather often), its constructor would allocate a structure containing those data members. They would be accessed like

MyDetectorExtraData* ex = static_cast<MyDetectorExtraData*>(fExtra);
if( ex->fSomeData > 0 )
  // do something

The fExtra pointer should be to some kind of "extra data" base class that offers a minimal common API, e.g. to find out the stucture's size, stream the info etc. Maybe it is easiest to let the base class just be TObject.

Actions #1

Updated by Ole Hansen almost 7 years ago

  • Status changed from New to Closed
  • Start date set to 03/07/2018
  • % Done changed from 0 to 100

Implemented for THaAnalysisObject, THaAnalyzer, THaRunBase and THaOutput in commit f1c2db6

Actions

Also available in: Atom PDF