rivet is hosted by Hepforge, IPPP Durham
Projection.fhh
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #ifndef Rivet_Projection_FHH
00003 #define Rivet_Projection_FHH
00004 
00005 /// @todo Is there a reason that this stuff can't go into Projection.hh?
00006 
00007 #include "Rivet/Cmp.fhh"
00008 
00009 
00010 namespace Rivet {
00011   class Projection;
00012   typedef Projection* ProjectionPtr;
00013   typedef const Projection* ConstProjectionPtr;
00014 }
00015 
00016 
00017 namespace std {
00018 
00019   /// This is the function called when comparing two (const) pointers to Rivet::Projection.
00020   template <>
00021   struct less<const Rivet::Projection*>
00022     : public binary_function<const Rivet::Projection*, const Rivet::Projection*, bool> {
00023     bool operator()(const Rivet::Projection* x, const Rivet::Projection* y) const;
00024   };
00025 
00026 }
00027 
00028 
00029 namespace Rivet {
00030 
00031   /// Convenience method for casting to a const Projection reference.
00032   template <typename PROJ>
00033   inline const PROJ& pcast(const Projection& p) {
00034     return dynamic_cast<const PROJ&>(p);
00035   }
00036 
00037 
00038   /// Convenience method for casting to a const Projection pointer.
00039   template <typename PROJ>
00040   inline const PROJ* pcast(const Projection* p) {
00041     return dynamic_cast<const PROJ*>(p);
00042   }
00043 
00044 }
00045 
00046 #endif