///////////////////////////////////////////////////////////// // // PndRpcContFact // // Factory for the parameter containers in libRpc // ///////////////////////////////////////////////////////////// using namespace std; #include "PndRpcContFact.h" #include "FairRuntimeDb.h" #include "PndRpcGeoPar.h" #include #include ClassImp(PndRpcContFact) static PndRpcContFact gRpcContFact; PndRpcContFact::PndRpcContFact() { // Constructor (called when the library is loaded) fName="PndRpcContFact"; fTitle="Factory for parameter containers in libRpc"; setAllContainers(); FairRuntimeDb::instance()->addContFactory(this); } void PndRpcContFact::setAllContainers() { /** Creates the Container objects with all accepted contexts and adds them to * the list of containers for the Rpc library.*/ FairContainer* p= new FairContainer("PndRpcGeoPar", "Rpc Geometry Parameters", "TestDefaultContext"); p->addContext("TestNonDefaultContext"); containers->Add(p); } FairParSet* PndRpcContFact::createContainer(FairContainer* c) { /** Calls the constructor of the corresponding parameter container. * For an actual context, which is not an empty string and not the default context * of this container, the name is concatinated with the context. */ const char* name=c->GetName(); FairParSet* p=NULL; if (strcmp(name,"PndRpcGeoPar")==0) { p=new PndRpcGeoPar(c->getConcatName().Data(),c->GetTitle(),c->getContext()); } return p; }