Warning, /include/Rivet/Projection.fhh is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 #ifndef Rivet_Projection_FHH
0003 #define Rivet_Projection_FHH
0004
0005 /// @todo Is there a reason that this stuff can't go into Projection.hh?
0006
0007 #include "Rivet/Config/RivetCommon.hh"
0008 #include "Rivet/Tools/Cmp.fhh"
0009
0010
0011 namespace Rivet {
0012 class Projection;
0013 typedef Projection* ProjectionPtr;
0014 typedef const Projection* ConstProjectionPtr;
0015 }
0016
0017
0018 namespace std {
0019
0020 /// This is the function called when comparing two (const) pointers to Rivet::Projection.
0021 template <>
0022 struct less<const Rivet::Projection*>
0023 {
0024 bool operator()(const Rivet::Projection* x, const Rivet::Projection* y) const;
0025 };
0026
0027 }
0028
0029
0030 namespace Rivet {
0031
0032 /// Convenience method for casting to a const Projection reference.
0033 template <typename PROJ>
0034 inline const PROJ& pcast(const Projection& p) {
0035 return dynamic_cast<const PROJ&>(p);
0036 }
0037
0038
0039 /// Convenience method for casting to a const Projection pointer.
0040 template <typename PROJ>
0041 inline const PROJ* pcast(const Projection* p) {
0042 return dynamic_cast<const PROJ*>(p);
0043 }
0044
0045 }
0046
0047 #endif