Skip to content

Commit

Permalink
chore(deprecated): __attribute__ to [[]]
Browse files Browse the repository at this point in the history
C++14 allows us to use [[deprecated]].
So let's use it instead of __attribute__.

Add Changelog Entry declaring the scheduling.
  • Loading branch information
ChristianTackeGSI authored and dennisklein committed Nov 11, 2022
1 parent f386f3b commit 9459446
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 35 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
* Deprecate some singleton-like APIs:
* `FairRunAnaProof::Instance()` - keep a pointer to the
object after `new` in your code.
* Many items were already deprecated in prior versions.
Marked them with proper C++14 deprecation warnings.
Scheduled them for removal in v20.
### Other Notable Changes
* Tests using Geant3 have been disabled by default, because
Expand Down
8 changes: 5 additions & 3 deletions base/sim/FairModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ class FairModule : public TNamed
virtual void ConstructRootGeometry(TGeoMatrix* shiftM = nullptr);
/**construct geometry from standard ASSCII files (Hades Format)*/
virtual void ConstructASCIIGeometry();
/** Modify the geometry for the simulation run using methods of the Root geometry package */
virtual void ModifyGeometry()
__attribute__((deprecated("Use FairAlignmentHandler instead, see Tutorial4 for examples")))
/**
* Modify the geometry for the simulation run using methods of the Root geometry package
* \deprecated Deprecated pre-v19, will be removed in v20.
*/
[[deprecated("Use FairAlignmentHandler instead, see Tutorial4 for examples")]] virtual void ModifyGeometry()
{
LOG(warn) << "This function is deprecated. Use FairAlignmentHandler instead, see Tutorial4 for examples.";
}
Expand Down
3 changes: 2 additions & 1 deletion base/steer/FairRunAnaProof.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
class FairRunAnaProof : public FairRunAna
{
public:
[[deprecated]] static FairRunAnaProof* Instance(); ///< \deprecated
/** \deprecated Deprecated in v19, will be removed in v20. */
[[deprecated]] static FairRunAnaProof* Instance();
virtual ~FairRunAnaProof();
FairRunAnaProof(const char* proofName = "");

Expand Down
71 changes: 40 additions & 31 deletions geane/FairGeanePro.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,21 @@ class FairGeanePro : public FairPropagator
virtual bool SetPropagateOnlyParameters();

/* ====== Depracated functions ====== */
__attribute__((deprecated("Function PropagateToPlane depracated, use SetDestinationPlane."))) bool
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateToPlane depracated, use SetDestinationPlane.")]] bool
PropagateToPlane(const TVector3& v0, const TVector3& v1, const TVector3& v2);
__attribute__((deprecated("Function PropagateFromPlane depracated, use SetOriginPlane."))) bool PropagateFromPlane(
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateFromPlane depracated, use SetOriginPlane.")]] bool PropagateFromPlane(
const TVector3& v1,
const TVector3& v2);
__attribute__((deprecated("Function PropagateToVolume depracated, use SetDestinationVolume."))) bool
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateToVolume depracated, use SetDestinationVolume.")]] bool
PropagateToVolume(TString VolName, int CopyNo, int option);
__attribute__((deprecated("Function PropagateToLength depracated, use SetDestinationLength."))) bool
PropagateToLength(float length);
__attribute__((deprecated("Function PropagateOnlyParameters depracated, use SetPropagateOnlyParameters."))) bool
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateToLength depracated, use SetDestinationLength.")]] bool PropagateToLength(
float length);
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateOnlyParameters depracated, use SetPropagateOnlyParameters.")]] bool
PropagateOnlyParameters();
/* ====== ====== ====== ====== ====== */

Expand Down Expand Up @@ -125,8 +130,9 @@ class FairGeanePro : public FairPropagator

public:
/* ====== Depracated functions ====== */
__attribute__((deprecated("Function FindPCA(many parameters) depracated, it is replaced by PCAOutputStruct "
"FindPCA(pca, PDGCode, point, wire1, wire2, maxdistance)."))) int
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function FindPCA(many parameters) depracated, it is replaced by PCAOutputStruct "
"FindPCA(pca, PDGCode, point, wire1, wire2, maxdistance).")]] int
FindPCA(int pca,
int PDGCode,
TVector3 point,
Expand All @@ -139,49 +145,52 @@ class FairGeanePro : public FairPropagator
double& Di,
float& trklength);

__attribute__((deprecated("Function SetWire depracated, contact FairRoot group if you need it."))) bool SetWire(
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function SetWire depracated, contact FairRoot group if you need it.")]] bool SetWire(
TVector3 extremity1,
TVector3 extremity2);
__attribute__((deprecated("Function SetPoint depracated, contact FairRoot group if you need it."))) bool SetPoint(
TVector3 pnt);
__attribute__((deprecated("Function PropagateToPCA depracated, use SetPCAPropagation."))) bool PropagateToPCA(
int pca);
__attribute__((deprecated("Function PropagateToPCA depracated, use SetPCAPropagation."))) bool PropagateToPCA(
int pca,
int dir);
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function SetPoint depracated, contact FairRoot group if you need it.")]] bool SetPoint(TVector3 pnt);
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateToPCA depracated, use SetPCAPropagation.")]] bool PropagateToPCA(int pca);
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateToPCA depracated, use SetPCAPropagation.")]] bool PropagateToPCA(int pca, int dir);
// function to call the FindPCA alone to retrieve
// the PCA.
__attribute__((deprecated("Function ActualFindPCA depracated, use SetPCAPropagation."))) bool
ActualFindPCA(int pca, FairTrackParP* par, int dir);
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function ActualFindPCA depracated, use SetPCAPropagation.")]] bool ActualFindPCA(int pca,
FairTrackParP* par,
int dir);

TVector3 GetPCAOnWire()
__attribute__((deprecated("Function GetPCAOnWire obsolete, contact FairRoot group if you need it.")))
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function GetPCAOnWire obsolete, contact FairRoot group if you need it.")]] TVector3 GetPCAOnWire()
{
return fvwi;
}
TVector3 GetPCAOnTrack()
__attribute__((deprecated("Function GetPCAOnTrack obsolete, contact FairRoot group if you need it.")))
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function GetPCAOnTrack obsolete, contact FairRoot group if you need it.")]] TVector3 GetPCAOnTrack()
{
return fvpf;
}
float GetLengthAtPCA()
__attribute__((deprecated("Function GetLengthAtPCA obsolete, contact FairRoot group if you need it.")))
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function GetLengthAtPCA obsolete, contact FairRoot group if you need it.")]] float GetLengthAtPCA()
{
return ftrklength;
}
float GetTimeAtPCA()
__attribute__((deprecated("Function GetTimeAtPCA obsolete, contact FairRoot group if you need it.")))
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function GetTimeAtPCA obsolete, contact FairRoot group if you need it.")]] float GetTimeAtPCA()
{
return ftrktime;
}

__attribute__((
deprecated("Function PropagateToVirtualPlaneAtPCA questionable, contact FairRoot if you need it."))) bool
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function PropagateToVirtualPlaneAtPCA questionable, contact FairRoot if you need it.")]] bool
PropagateToVirtualPlaneAtPCA(int pca);
__attribute__((deprecated("Function BackTrackToVertex questionable, contact FairRoot if you need it."))) bool
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function BackTrackToVertex questionable, contact FairRoot if you need it.")]] bool
BackTrackToVertex();
__attribute__((
deprecated("Function BackTrackToVirtualPlaneAtPCA questionable, contact FairRoot if you need it."))) bool
/** \deprecated Deprecated pre-v19, will be removed in v20. */
[[deprecated("Function BackTrackToVirtualPlaneAtPCA questionable, contact FairRoot if you need it.")]] bool
BackTrackToVirtualPlaneAtPCA(int pca);
/* ====== ====== ====== ====== ====== */

Expand Down

0 comments on commit 9459446

Please sign in to comment.