00001 // -*- C++ -*- 00002 // 00003 // Package: EDProduct 00004 // Class : EDProductGetter 00005 // 00006 // Implementation: 00007 // <Notes on implementation> 00008 // 00009 // Original Author: Chris Jones 00010 // Created: Tue Nov 1 15:06:41 EST 2005 00011 // 00012 00013 // system include files 00014 00015 // user include files 00016 #include "DataFormats/Common/interface/EDProductGetter.h" 00017 #include "FWCore/Utilities/interface/EDMException.h" 00018 00019 namespace edm { 00020 // 00021 // constants, enums and typedefs 00022 // 00023 00024 // 00025 // static data member definitions 00026 // 00027 00028 // 00029 // constructors and destructor 00030 // 00031 EDProductGetter::EDProductGetter() 00032 { 00033 } 00034 00035 // EDProductGetter::EDProductGetter(EDProductGetter const& rhs) 00036 // { 00037 // // do actual copying here; 00038 // } 00039 00040 EDProductGetter::~EDProductGetter() 00041 { 00042 } 00043 00044 // 00045 // assignment operators 00046 // 00047 // EDProductGetter const& EDProductGetter::operator=(EDProductGetter const& rhs) 00048 // { 00049 // //An exception safe implementation is 00050 // EDProductGetter temp(rhs); 00051 // swap(rhs); 00052 // 00053 // return *this; 00054 // } 00055 00056 // 00057 // member functions 00058 // 00059 00060 // 00061 // const member functions 00062 // 00063 00064 // 00065 // static member functions 00066 // 00067 ProductID 00068 EDProductGetter::oldToNewProductID_(ProductID const&) const { 00069 throw edm::Exception(errors::LogicError) 00070 << "Internal error: Call of oldToNewProductID_ for non-EventPrincipal.\n" 00071 << "Please report this error to the Framework group\n"; 00072 } 00073 00074 EDProductGetter const* 00075 mustBeNonZero(EDProductGetter const* prodGetter, std::string refType, ProductID const& productID) { 00076 if (prodGetter != 0) return prodGetter; 00077 throw Exception(errors::InvalidReference, refType) 00078 << "Attempt to construct a " << refType << " with ProductID " << productID << "\n" 00079 << "but with a null pointer to a product getter.\n" 00080 << "The product getter pointer passed to the constructor must refer\n" 00081 << "to a real getter, such as an EventPrincipal.\n"; 00082 } 00083 00084 static EDProductGetter const* s_productGetter=0; 00085 EDProductGetter const* 00086 EDProductGetter::switchProductGetter(EDProductGetter const* iNew) 00087 { 00088 //std::cout <<"switch from "<<s_productGetter<<" to "<<iNew<<std::endl; 00089 EDProductGetter const* old = s_productGetter; 00090 s_productGetter = iNew; 00091 return old; 00092 } 00093 void 00094 EDProductGetter::assignEDProductGetter(EDProductGetter const* & iGetter) 00095 { 00096 //std::cout <<"assign "<<s_productGetter<<std::endl; 00097 00098 iGetter = s_productGetter; 00099 } 00100 00101 00102 }