// // $Id: RcpGeometerRegistry.cpp,v 1.3 2001/06/14 21:04:16 hobbs Exp $ // // File: RcpGeometerRegistry.cpp // Purpose: // Created: 29-NOV-2000 John Hobbs // // $Revision: 1.3 $ // // // Include files #include "geometry_system/management/RcpGeometerRegistry.hpp" // Global definitions using namespace std; using namespace dgs; using namespace edm; // Constructors/Destructors // Accessors RcpGeometerRegistry* RcpGeometerRegistry::_theInstance=0; RcpGeometerRegistry* RcpGeometerRegistry::get_instance() { if( !_theInstance ) _theInstance = new RcpGeometerRegistry(); return _theInstance; } bool RcpGeometerRegistry::add(absRcpGeometer *aGeometer) { // Make sure it doesn't exist. if( d_geometers.find(aGeometer) != d_geometers.end() ) return false; // and then add it if it's OK d_geometers[aGeometer]=RCPID(); return true; } bool RcpGeometerRegistry::remove(absRcpGeometer *aGeometer) { // Make sure it exists if( d_geometers.find(aGeometer) == d_geometers.end() ) return false; // and then remove it d_geometers.erase(aGeometer); return true; } bool RcpGeometerRegistry::update_environment(absRcpGeometer *aGeometer, RCPID& newrcp) { // Make sure it exists if( d_geometers.find(aGeometer) == d_geometers.end() ) return false; // and then add it if it's OK d_geometers[aGeometer]=newrcp; return true; } std::set RcpGeometerRegistry::known_geometers() const { d_tmp.clear(); map::const_iterator i = d_geometers.begin(); while( i != d_geometers.end() ) { d_tmp.insert((*i).first); ++i; } return d_tmp; } // Get the RCPID's of the currently loaded parameter sets for all geometers const map* RcpGeometerRegistry::environment() const { return &d_geometers; }