Rivet: /Users/chrisg/software/rivet/include/Rivet/Projection.fhh Source File

| Rivet 3.1.9

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 {
24 bool operator()(const Rivet::Projection* x, const Rivet::Projection* y) const;
25 };
26
27}
28
29
30namespace Rivet {
31
32 /// Convenience method for casting to a const Projection reference.
33 template <typename PROJ>
34 inline const PROJ& pcast(const Projection& p) {
35 return dynamic_cast<const PROJ&>(p);
36 }
37
38
39 /// Convenience method for casting to a const Projection pointer.
40 template <typename PROJ>
41 inline const PROJ* pcast(const Projection* p) {
42 return dynamic_cast<const PROJ*>(p);
43 }
44
45}
46
47#endif