Rivet API documentation

Rivet 4.1.3
Projection.fhh
1// -*- C++ -*-
2#ifndef Rivet_Projection_FHH
3#define Rivet_Projection_FHH
4
5/// @todo Is there a reason that this stuff can't go into Projection.hh?
6
7#include "Rivet/Config/RivetCommon.hh"
8#include "Rivet/Tools/Cmp.fhh"
9
10
11namespace Rivet {
12 class Projection;
13 typedef Projection* ProjectionPtr;
14 typedef const Projection* ConstProjectionPtr;
15}
16
17
18namespace std {
19
20 /// This is the function called when comparing two (const) pointers to Rivet::Projection.
21 template <>
22 struct less<const Rivet::Projection*> {
23 bool operator()(const Rivet::Projection* x, const Rivet::Projection* y) const;
24 };
25
26}
27
28
29namespace Rivet {
30
31 /// Convenience method for casting to a const Projection reference.
32 template <typename PROJ>
33 inline const PROJ& pcast(const Projection& p) {
34 return dynamic_cast<const PROJ&>(p);
35 }
36
37
38 /// Convenience method for casting to a const Projection pointer.
39 template <typename PROJ>
40 inline const PROJ* pcast(const Projection* p) {
41 return dynamic_cast<const PROJ*>(p);
42 }
43
44}
45
46#endif