//-------------------------------------------------------------------------- // File and Version Information: // $Id: Ifd.cxx,v 1.1.1.1 2005/03/29 17:13:30 steinke Exp $ // // Description: // See the .h file. // // Implementation notes. // // 2. Some compilers do not support default args in // templated member functions. That's why we // have pairs of member functions, one w/ a 2ndary // key and one without. // // 3. Ideally, the pairs of functions above would call // into a common implementation helper function. Too // bad. // // // // EXCLUDE THIS FILE FROM THE LIST OF .CC FILE TO COMPILE! // // Environment: // Software developed for the BaBar Detector at the SLAC B-Factory. // // Author List: // Ed Frank University of Pennsylvania // // Copyright Information: // Copyright (C) 1997 // //------------------------------------------------------------------------ //----------------------- // This Class's Header -- //----------------------- #include "Ifd.h" #include "IfdProxyDict.h" #include "IfdDictKey.h" #include "IfdKey.h" #include "IfdTypeKey.h" #include "IfdStrKey.h" #include "IfdDataProxyTemplate.h" #include "IfdDataProxy.h" //#include "AbsArgVal.h" // ---------------------------------------- // -- Public Function Member Definitions -- // ---------------------------------------- //---------------- // Constructors -- //---------------- //-------------- // Destructor -- //-------------- //------------- // Methods -- //------------- //********************************************************************** //template //Ifd::~Ifd() //********************************************************************** //{} //********************************************************************** template AbsArg& Ifd::nullArg() { //********************************************************************** static AbsArgVal _nullArg( (T*) 0 ); return _nullArg; } //********************************************************************** template T* Ifd::get( IfdProxyDict *d ) { //********************************************************************** static IfdTypeKey< Ifd > tK; // The static keeps us from creating one on // each call. static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); return (T*) d->get( *dictKey, nullArg() ); } //********************************************************************** template T* Ifd::get( IfdProxyDict *d, AbsArg& a ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); return (T*) d->get( *dictKey, a ); } //********************************************************************** template T* Ifd::get( IfdProxyDict *d, const IfdKey &k) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->reset(); dictKey->add( k ); return (T*) d->get( *dictKey, nullArg() ); } //********************************************************************** template T* Ifd::get( IfdProxyDict *d, const IfdKey &k, AbsArg& a) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->reset(); dictKey->add( k ); return (T*) d->get( *dictKey, a); } //********************************************************************** template T* Ifd::get( IfdProxyDict *d, const char *s) { //********************************************************************** IfdStrKey k( s ); return Ifd::get(d, k); } //********************************************************************** template T* Ifd::get( IfdProxyDict *d, const char *s, AbsArg& a) { //********************************************************************** IfdStrKey k( s ); return Ifd::get(d, k, a); } //********************************************************************** template bool Ifd::put( IfdProxyDict *d, IfdDataProxyTemplate *p ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); return d->put(*dictKey, p); } //********************************************************************** template bool Ifd::put(IfdProxyDict *d, IfdDataProxyTemplate *p, const IfdKey &k){ //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->reset(); dictKey->add( k ); return d->put(*dictKey, p); } //********************************************************************** template bool Ifd::put(IfdProxyDict *d, IfdDataProxyTemplate *p, const char *s ) { //********************************************************************** IfdStrKey k( s ); return Ifd::put( d, p, k ); } //********************************************************************** template bool Ifd::put(IfdProxyDict *d, T* t) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); // Make a proxy for the (lazy rotten) user. IfdDataProxy *p = new IfdDataProxy( t ); bool result = d->put(*dictKey, p); return result; } //********************************************************************** template bool Ifd::put(IfdProxyDict *d, T* t, const IfdKey &k) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); // Make a proxy for the (lazy rotten) user. IfdDataProxy *p = new IfdDataProxy( t ); dictKey->reset(); dictKey->add( k ); return d->put(*dictKey, p); } //********************************************************************** template bool Ifd::put(IfdProxyDict *d, T* t, const char *s) { //********************************************************************** IfdStrKey k( s ); return Ifd::put( d, t, k ); } //********************************************************************** template bool Ifd::markForStore(IfdProxyDict *d ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); return d->markForStore(*dictKey, nullArg()); } //********************************************************************** template bool Ifd::markForStore(IfdProxyDict *d, AbsArg& a ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); return d->markForStore(*dictKey, a); } //********************************************************************** template bool Ifd::markForStore(IfdProxyDict *d, const IfdKey& k ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->reset(); dictKey->add( k ); return d->markForStore(*dictKey, nullArg()); } //********************************************************************** template bool Ifd::markForStore(IfdProxyDict *d, const IfdKey& k, AbsArg& a ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->reset(); dictKey->add( k ); return d->markForStore(*dictKey, a); } //********************************************************************** template bool Ifd::markForStore(IfdProxyDict *d, const char *s) { //********************************************************************** IfdStrKey k( s ); return Ifd::markForStore(d, k); } //********************************************************************** template bool Ifd::markForStore(IfdProxyDict *d, const char *s, AbsArg& a) { //********************************************************************** IfdStrKey k( s ); return Ifd::markForStore(d, k, a); } //********************************************************************** template void Ifd::storeItem(IfdProxyDict *d ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); d->storeItem(*dictKey, nullArg()); return; } //********************************************************************** template void Ifd::storeItem(IfdProxyDict *d, AbsArg& a ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); d->storeItem(*dictKey, a); return; } //********************************************************************** template void Ifd::storeItem(IfdProxyDict *d, const IfdKey& k ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->add( k ); d->storeItem(*dictKey, nullArg()); dictKey->reset(); return; } //********************************************************************** template void Ifd::storeItem(IfdProxyDict *d, const IfdKey& k, AbsArg& a ) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->add( k ); d->storeItem(*dictKey, a); dictKey->reset(); return; } //********************************************************************** template void Ifd::storeItem(IfdProxyDict *d, const char* s) { //********************************************************************** IfdStrKey k(s); Ifd::storeItem(d, k); return; } //********************************************************************** template void Ifd::storeItem(IfdProxyDict *d, const char* s, AbsArg& a) { //********************************************************************** IfdStrKey k(s); Ifd::storeItem(d, k, a); return; } //********************************************************************** template bool Ifd::keyUsed(IfdProxyDict *d) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK); return ( 0 != d->find( *dictKey ) ); } //********************************************************************** template bool Ifd::keyUsed(IfdProxyDict *d, const IfdKey& k) { //********************************************************************** static IfdTypeKey< Ifd > tK; static IfdDictKey* dictKey=IfdProxyDictFrontEnd::newDictKey( tK ); dictKey->reset(); dictKey->add( k ); return ( 0 != d->find( *dictKey ) ); } //------------- // Operators -- //------------- //------------- // Selectors -- //------------- //------------- // Modifiers -- //------------- // ----------------------------------------------- // -- Static Data & Function Member Definitions -- // ----------------------------------------------- // ------------------------------------------- // -- Protected Function Member Definitions -- // ------------------------------------------- // ----------------------------------------- // -- Private Function Member Definitions -- // ----------------------------------------- // ----------------------------------- // -- Internal Function Definitions -- // -----------------------------------