Action #492

Feature #490: Avoid casts for derived classes

Rework GEvents interface

Added by Knödlseder Jürgen about 12 years ago. Updated almost 12 years ago.

Status:ClosedStart date:09/20/2012
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:00-07-00
Duration:

Description

Here a list of the additional methods that are implement in the derived classes of GEvents:

GEventList:
  • virtual void roi(const GRoi& roi) = 0;
  • virtual const GRoi& roi(void) const = 0;
GCTAEventList:
  • void append(const GCTAEventAtom& event);
  • void reserve(const int& number);

GLATEventList:
None

GEventCube:
  • virtual int dim(void) const = 0;
  • virtual int naxis(int axis) const = 0;
GCOMEventCube:
  • void map(const GSkymap& map, const double& phimin, const double& dphi);
  • const GSkymap& map(void) const;
  • int nchi(void) const;
  • int npsi(void) const;
  • int nphi(void) const;
  • int npix(void) const;

Note that the nchi(), npsi(), nphi(), and npix() method functionalities can all be satisfied using dim() and naxis(), hence we do not strictly need these methods.

GCTAEventCube:
  • void map(const GSkymap& map);
  • const GSkymap& map(void) const;
  • int nx(void) const;
  • int ny(void) const;
  • int npix(void) const;
  • int ebins(void) const;

Note that the nx(), ny(), npix(), and ebins() method functionalities can all be satisfied using dim() and naxis(), hence we do not strictly need these methods.

GLATEventCube:
  • void time(const GTime& time);
  • void map(const GSkymap& map);
  • void enodes(const GNodeArray& enodes);
  • void ontime(const double& ontime);
  • const GTime& time(void) const;
  • const GSkymap& map(void) const;
  • const GNodeArray& enodes(void);
  • const double& ontime(void) const;
  • int nx(void) const;
  • int ny(void) const;
  • int npix(void) const;
  • int ebins(void) const;
  • int ndiffrsp(void) const;
  • std::string diffname(const int& index) const;
  • GSkymap* diffrsp(const int& index) const;
  • double maxrad(const GSkyDir& dir) const;

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen about 12 years ago

  • Description updated (diff)

#2 Updated by Knödlseder Jürgen about 12 years ago

  • Description updated (diff)

#3 Updated by Knödlseder Jürgen about 12 years ago

  • Start date set to 09/20/2012

due to changes in a related task

#4 Updated by Knödlseder Jürgen about 12 years ago

  • Assigned To set to Knödlseder Jürgen

#5 Updated by Knödlseder Jürgen almost 12 years ago

A GEvents* output typemap has been added to GObservation.i that automatically casts to GEventList and GEventCube and a GEvent* output typemap has been added to GEvents.i that automatically casts to GEventAtom and GEventBin.

We thus have to make sure that the instrument specific implementations to these interfaces do not add new methods.

#6 Updated by Knödlseder Jürgen almost 12 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
  • Remaining (hours) set to 0.0

All casts in the instrument specific classes have been removed. No rework has been done on the GEvents interface. Not clear whether we really need a rework, as long as we don’t have the need for a cast.

Also available in: Atom PDF