Bdb packages | Design docs | Source docs | Guidelines | Recent releases

Search | Site Map .

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/BdbEvent/BdbEidContainer.cc

Go to the documentation of this file.
00001 //--------------------------------------------------------------------------
00002 // File and Version Information:
00003 //  $Id: BdbEidContainer.cc,v 1.3 2000/03/24 02:49:29 patton Exp $
00004 //
00005 // Description:
00006 //  Class BdbEidContainer implementation.  See .hh for details.
00007 //
00008 // Environment:
00009 //  Software developed for the BaBar Detector at the SLAC B-Factory.
00010 //
00011 // Author List:
00012 //  Ed Frank                   University of Pennsylvania
00013 //
00014 // Copyright Information:
00015 //  Copyright (C) 1999
00016 //
00017 // History:
00018 //      Ed Frank  07Jun99      First version.
00019 //
00020 //------------------------------------------------------------------------
00021 
00022 //-----------------------
00023 // This Class's Header --
00024 //-----------------------
00025 #include "BdbEvent/BdbEidContainer.hh"
00026 
00027 //-------------
00028 // C Headers --
00029 //-------------
00030 
00031 //---------------
00032 // C++ Headers --
00033 //---------------
00034 
00035 #include "EidData/EidInfo.hh"
00036 #include "EidData/EidEventTriplet.hh"
00037 #include "EidData/EidCondKeyTriplet.hh"
00038 #include "OdfCommon/odfTime.hh"
00039 #include "AbsEvent/AbsEventID.hh"
00040 
00041 //-------------------------------
00042 // Collaborating Class Headers --
00043 //-------------------------------
00044 
00045 //-----------------------------------------------------------------------
00046 // Local Macros, Typedefs, Structures, Unions and Forward Declarations --
00047 //-----------------------------------------------------------------------
00048 
00049 static const char rcsid[] = "$Id: BdbEidContainer.cc,v 1.3 2000/03/24 02:49:29 patton Exp $";
00050 
00051 //      ----------------------------------------
00052 //      -- Public Function Member Definitions --
00053 //      ----------------------------------------
00054 
00055 //----------------
00056 // Constructors --
00057 //----------------
00058 
00059 BdbEidContainer::BdbEidContainer()
00060 {
00061 }
00062 
00063 BdbEidContainer::BdbEidContainer( const BdbEidContainer& eid )
00064 {
00065    operator=( eid ) ;
00066 }
00067 
00068 BdbEidContainer::BdbEidContainer( const AbsEventID& eid  )
00069   : _eventPlatform( eid.eventIdTriplet().platform() )
00070   , _eventPartitionMask( eid.eventIdTriplet().partitionMask() )
00071   , _itsUpper( eid.eventIdTriplet().timeStamp().binary().upper )
00072   , _itsLower( eid.eventIdTriplet().timeStamp().binary().lower )
00073 
00074   , _condKeyPlatform( eid.condKeyTriplet().platform() )
00075   , _condKeyPartitionMask( eid.condKeyTriplet().partitionMask() )
00076   , _condKeyKey( eid.condKeyTriplet().key() )
00077 
00078   , _configKey( eid.configKey() )
00079   , _run( eid.run() )
00080   
00081 {
00082 }
00083 
00084 
00085 //---------------
00086 // Destructors --
00087 //---------------
00088 
00089 BdbEidContainer::~BdbEidContainer( )
00090 {
00091 }
00092 
00093 //-------------
00094 // Selectors --
00095 //-------------
00096 
00097 EidInfo*
00098 BdbEidContainer::eidInfo( void ) const {
00099   // caller owns what is returned
00100 
00101   EidEventTriplet eid( _eventPlatform, _eventPartitionMask,
00102                        odfTime( _itsUpper, _itsLower ) );
00103 
00104   EidCondKeyTriplet condId( _condKeyPlatform, _condKeyPartitionMask,
00105                             _condKeyKey );
00106 
00107   return new EidInfo( eid, condId, _configKey,  _run );
00108 
00109 }
00110 
00111 //--------------
00112 // Modifiers --
00113 //--------------
00114 
00115 const BdbEidContainer&
00116 BdbEidContainer::operator = ( const BdbEidContainer& eid )
00117 {
00118    AbsEventID* tmp( eid.eidInfo() ) ;
00119    operator=( *tmp ) ;
00120    delete tmp ;
00121    return( *this ) ;
00122 }
00123 
00124 BdbEidContainer&
00125 BdbEidContainer::operator = ( const AbsEventID& eid ) {
00126   // ignores X(X&) problem but should work.
00127 
00128   _eventPlatform        =  eid.eventIdTriplet().platform();
00129   _eventPartitionMask   = eid.eventIdTriplet().partitionMask();
00130   _itsUpper             =  eid.eventIdTriplet().timeStamp().binary().upper;
00131   _itsLower             = eid.eventIdTriplet().timeStamp().binary().lower;
00132   
00133   _condKeyPlatform      = eid.condKeyTriplet().platform();
00134   _condKeyPartitionMask = eid.condKeyTriplet().partitionMask();
00135   _condKeyKey           =  eid.condKeyTriplet().key();
00136   
00137   _configKey            =  eid.configKey();
00138   _run                  = eid.run();
00139 
00140   return *this;
00141 
00142 }
00143 
00144 //--------------
00145 // Operations --
00146 //--------------
00147 
00148 

 


BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us

Page Owner: Jacek Becla
Last Update: October 04, 2002