Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

RawDataCnvSvc Class Reference

#include <RawDataCnvSvc.h>

Inheritance diagram for RawDataCnvSvc:

IRawDataCnvSvc IRawDataCnvSvc PackedRawDataCnvSvc PackedRawDataCnvSvc List of all members.

Public Member Functions

virtual StatusCode createAddress (long storageType, const CLID &clid, const std::string &, IOpaqueAddress *&refpAddress)
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
virtual StatusCode createAddress (long storageType, const CLID &clid, const std::string &, IOpaqueAddress *&refpAddress)
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&refpAddress)
virtual StatusCode declareObject (const Leaf &leaf)=0
 Declare target leaf.
virtual StatusCode declareObject (const IRawDataCnvSvc::Leaf &leaf)
 Associates a path on TDS with a particular converter.
virtual StatusCode declareObject (const IRawDataCnvSvc::Leaf &leaf)
 Associates a path on TDS with a particular converter.
virtual StatusCode finalize ()
virtual StatusCode finalize ()
virtual StatusCode initialize ()
virtual StatusCode initialize ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Override inherited queryInterface due to enhanced interface.
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
 Override inherited queryInterface due to enhanced interface.

Protected Member Functions

virtual StatusCode addConverters ()=0
virtual StatusCode addConverters ()=0
 RawDataCnvSvc (const std::string &name, ISvcLocator *svc, long storageTyp)
 RawDataCnvSvc (const std::string &name, ISvcLocator *svc, long storageTyp)
StatusCode updateServiceState (IOpaqueAddress *pAddress)
StatusCode updateServiceState (IOpaqueAddress *pAddress)
 Update state of the service.
virtual ~RawDataCnvSvc ()
virtual ~RawDataCnvSvc ()

Private Types

typedef std::map< std::string,
Leaf * > 
LeafMap
 Map with leaf entries containing TDS paths.
typedef std::map< std::string,
Leaf * > 
LeafMap
 Map with leaf entries containing TDS paths.

Private Attributes

LeafMap m_leaves

Friends

class SvcFactory<RawDataCnvSvc>

Detailed Description

class RawDataCnvSvc Conversion Service which coordinates all of converters.

When a component requests an item not yet available on the TDS, the RawDataCnvSvc is called to find the appropriate converter to gain access to the data and put it on the TDS.

Based on GLAST's EfbCnvSvc


Member Typedef Documentation

typedef std::map<std::string, Leaf*> RawDataCnvSvc::LeafMap [private]
 

Map with leaf entries containing TDS paths.

typedef std::map<std::string, Leaf*> RawDataCnvSvc::LeafMap [private]
 

Map with leaf entries containing TDS paths.


Constructor & Destructor Documentation

RawDataCnvSvc::RawDataCnvSvc const std::string &  name,
ISvcLocator *  svc,
long  storageTyp
[protected]
 

00024 : ConversionSvc(name, svc, storageType)              
00025 {
00026 }

virtual RawDataCnvSvc::~RawDataCnvSvc  )  [inline, protected, virtual]
 

00061 { };

RawDataCnvSvc::RawDataCnvSvc const std::string &  name,
ISvcLocator *  svc,
long  storageTyp
[protected]
 

virtual RawDataCnvSvc::~RawDataCnvSvc  )  [inline, protected, virtual]
 

00061 { };


Member Function Documentation

virtual StatusCode RawDataCnvSvc::addConverters  )  [protected, pure virtual]
 

Implemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

virtual StatusCode RawDataCnvSvc::addConverters  )  [protected, pure virtual]
 

Implemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

virtual StatusCode RawDataCnvSvc::createAddress long  storageType,
const CLID &  clid,
const std::string &  ,
IOpaqueAddress *&  refpAddress
[virtual]
 

virtual StatusCode RawDataCnvSvc::createAddress long  svc_type,
const CLID &  clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress
[virtual]
 

StatusCode RawDataCnvSvc::createAddress long  storageType,
const CLID &  clid,
const std::string &  ,
IOpaqueAddress *&  refpAddress
[virtual]
 

00188 {
00189   return createAddress(storageType, clid, NULL, NULL, refpAddress);
00190 }

StatusCode RawDataCnvSvc::createAddress long  svc_type,
const CLID &  clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  refpAddress
[virtual]
 

00167 {
00168     MsgStream log( msgSvc(), name() );
00169     
00170     if (storageType != repSvcType() ) {
00171         log << MSG::ERROR << "bad storage type" << storageType << endreq;
00172         return StatusCode::FAILURE;
00173     }
00174 
00175     refpAddress = new GenericAddress(storageType,
00176                                      clid,
00177                                      "",  
00178                                      "",
00179                                      0);
00180 
00181     return StatusCode::SUCCESS;
00182 }

virtual StatusCode IRawDataCnvSvc::declareObject const Leaf leaf  )  [pure virtual, inherited]
 

Declare target leaf.

virtual StatusCode RawDataCnvSvc::declareObject const IRawDataCnvSvc::Leaf leaf  )  [virtual]
 

Associates a path on TDS with a particular converter.

StatusCode RawDataCnvSvc::declareObject const IRawDataCnvSvc::Leaf leaf  )  [virtual]
 

Associates a path on TDS with a particular converter.

00083                                                                         {
00084     // Purpose and Method:  Callback from each of the individual converters that allows
00085     //  association of TDS path and converter.
00086     Leaf* ll = new Leaf(leaf);
00087     std::pair<LeafMap::iterator, bool> p = m_leaves.insert(LeafMap::value_type( leaf.path, ll) );
00088     if( p.second )    {
00089         return StatusCode::SUCCESS;
00090     }
00091     delete ll;
00092     return StatusCode::FAILURE;
00093 }

virtual StatusCode RawDataCnvSvc::finalize  )  [virtual]
 

StatusCode RawDataCnvSvc::finalize  )  [virtual]
 

00074                                        {
00075     StatusCode status = ConversionSvc::finalize();
00076     for (LeafMap::iterator k = m_leaves.begin(); k != m_leaves.end(); k++ )   {
00077         delete (*k).second;
00078     }
00079     m_leaves.erase(m_leaves.begin(), m_leaves.end());
00080     return status;
00081 }

virtual StatusCode RawDataCnvSvc::initialize  )  [virtual]
 

Reimplemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

StatusCode RawDataCnvSvc::initialize  )  [virtual]
 

Reimplemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

00028                                          {
00029     // Purpose and Method:  Setup Converter Service.
00030     //   Associate RawDataCnvSvc with the EventDataSvc
00031     //   Associate the list of known converters with this RawDataCnvSvc.
00032 
00033     MsgStream log(messageService(), name());
00034  
00035     StatusCode iret;
00036     StatusCode status = ConversionSvc::initialize();
00037     if ( status.isSuccess() )   {
00038 
00039         IDataProviderSvc *pIDP = 0;
00040         // Set event data service
00041         status = service("EventDataSvc", pIDP, true);
00042         if ( status.isSuccess() )   {
00043             status = setDataProvider ( pIDP );
00044         }
00045         else    {
00046             return status;
00047         }
00048 
00049         // Add converters to the service 
00050         status = addConverters();
00051         if ( !status.isSuccess() )   {
00052           log << MSG::ERROR << "Unable to add converters to the service" << endreq;
00053           return status;
00054         }
00055 
00056         // Now we have to configure the map of leaves
00057         // Which should contain the association of converters with 
00058         // paths on the TDS
00059         for (LeafMap::iterator k = m_leaves.begin(); k != m_leaves.end(); k++ )   {
00060             std::string path = (*k).first;
00061             for (LeafMap::iterator j = m_leaves.begin(); j != m_leaves.end(); j++ )   {
00062                 std::string pp = (*j).first.substr(0, (*j).first.rfind("/"));
00063                 if ( path == pp && path != (*j).first )   {
00064                     (*k).second->push_back((*j).second);
00065                 }
00066             }
00067         }
00068         
00069     }
00070 
00071     return status;
00072 }

virtual StatusCode RawDataCnvSvc::queryInterface const InterfaceID &  riid,
void **  ppvInterface
[virtual]
 

Override inherited queryInterface due to enhanced interface.

Reimplemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

StatusCode RawDataCnvSvc::queryInterface const InterfaceID &  riid,
void **  ppvInterface
[virtual]
 

Override inherited queryInterface due to enhanced interface.

Reimplemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

00150                                                                                       {
00151     if ( IID_IRawDataCnvSvc == riid )  {
00152         *ppvInterface = (IRawDataCnvSvc*)this;
00153     }
00154     else  {
00155         // Interface is not directly availible: try out a base class
00156         return ConversionSvc::queryInterface(riid, ppvInterface);
00157     }
00158     addRef();
00159     return StatusCode::SUCCESS;
00160 }

StatusCode RawDataCnvSvc::updateServiceState IOpaqueAddress *  pAddress  )  [protected]
 

Reimplemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

StatusCode RawDataCnvSvc::updateServiceState IOpaqueAddress *  pAddress  )  [protected]
 

Update state of the service.

Reimplemented in PackedRawDataCnvSvc, and PackedRawDataCnvSvc.

00096                                                                         {
00097     
00098     // not sure about the use of recid or bank...
00099     MsgStream log(msgSvc(), name());
00100     
00101     StatusCode status = INVALID_ADDRESS;
00102     IRegistry* ent = pAddress->registry();
00103 
00104     if ( 0 != ent )   {
00105       SmartIF<IDataManagerSvc> iaddrReg(IID_IDataManagerSvc, dataProvider());
00106  //       if ( 0 != iaddrReg )   {
00107       status = StatusCode::SUCCESS;
00108       std::string path = ent->identifier();
00109 
00110       LeafMap::iterator itm = m_leaves.find(path);
00111       if ( itm != m_leaves.end() ) {
00112         IRawDataCnvSvc::Leaf* leaf = (*itm).second;
00113         if ( 0 != leaf )    {
00114           //ipar[0] = leaf->userParameter;
00115           for ( Leaf::iterator il = leaf->begin(); il != leaf->end(); il++ )   {
00116             IOpaqueAddress* newAddr = 0;
00117             unsigned long ipars[2] = {0, 0}; //{(*il)->userParameter, new_rid};
00118             const std::string spars[2] = {"", ""}; //{par[0], (*il)->bank};
00119             /* fix for Gaidi V16r4  -- Weidong Li 2005.10.25 
00120             StatusCode ir =
00121               addressCreator()->createAddress(storageType, 
00122                                               (*il)->clid, 
00123                                               spars, 
00124                                               ipars,
00125                                               newAddr);
00126             */
00127             StatusCode ir = createAddress(repSvcType(), 
00128                                               (*il)->clid, 
00129                                               spars, 
00130                                               ipars,
00131                                               newAddr);
00132             if ( ir.isSuccess() )   {
00133               ir = iaddrReg->registerAddress((*il)->path, newAddr);            
00134               if ( !ir.isSuccess() )    {
00135                 newAddr->release();
00136                 status = ir;
00137               }
00138             }
00139           }
00140         }
00141       }
00142     }
00143     else  {
00144        status = NO_INTERFACE;
00145     }
00146     
00147     return status;
00148 }


Friends And Related Function Documentation

SvcFactory<RawDataCnvSvc> [friend]
 


Member Data Documentation

LeafMap RawDataCnvSvc::m_leaves [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:42:12 2011 for BOSS6.5.5 by  doxygen 1.3.9.1