| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# OutputStream.h

Go to the documentation of this file.

    00001 // $Id: OutputStream.h,v 1.4 2010/05/20 17:07:50 marcocle Exp $
    00002 #ifndef GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
    00003 #define GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H
    00004
    00005
    00006 // Required for inheritance
    00007 #include "GaudiKernel/IDataSelector.h"
    00008 #include "GaudiKernel/Algorithm.h"
    00009 #include "GaudiKernel/Property.h"
    00010
    00011 // STL include files
    00012 #include <memory>
    00013 #include <vector>
    00014 #include <string>
    00015
    00016 // forward declarations
    00017 template <class ConcreteAlgorithm> class AlgFactory;
    00018 namespace { template <class P, class S> class Factory; }
    00019
    00020 class IIncidentSvc;
    00021 class IRegistry;
    00022 class IConversionSvc;
    00023 class IDataManagerSvc;
    00024 class OutputStreamAgent;
    00025 class DataStoreItem;
    00026
    00032 class OutputStream : public Algorithm     {
    00033   friend class AlgFactory<OutputStream>;
    00034   friend class Factory<OutputStream,IAlgorithm* (std::string,ISvcLocator *)>;
    00035
    00036 public:
    00037   typedef std::vector<DataStoreItem*> Items;
    00038   typedef std::vector<std::string>    ItemNames;
    00039 protected:
    00041   SmartIF<IIncidentSvc> m_incidentSvc;
    00043   bool                     m_doPreLoad;
    00045   bool                     m_doPreLoadOpt;
    00047   bool                     m_verifyItems;
    00049   std::string              m_storeName;
    00051   std::string              m_persName;
    00053   std::string              m_output;
    00055   std::string              m_outputName;
    00057   std::string              m_outputType;
    00059   OutputStreamAgent*       m_agent;
    00061   SmartIF<IDataProviderSvc>        m_pDataProvider;
    00063   SmartIF<IDataManagerSvc>         m_pDataManager;
    00065   SmartIF<IConversionSvc>          m_pConversionSvc;
    00067   DataStoreItem*           m_currentItem;
    00069   ItemNames                m_itemNames;
    00071   Items                    m_itemList;
    00073   ItemNames                m_optItemNames;
    00075   Items                    m_optItemList;
    00077   IDataSelector            m_objects;
    00079   int                      m_events;
    00081   StringArrayProperty      m_acceptNames;
    00083   StringArrayProperty      m_requireNames;
    00085   StringArrayProperty      m_vetoNames;
    00087   std::vector<Algorithm*>* m_acceptAlgs;
    00089   std::vector<Algorithm*>* m_requireAlgs;
    00091   std::vector<Algorithm*>* m_vetoAlgs;
    00092
    00093 public:
    00095         OutputStream(const std::string& name, ISvcLocator* pSvcLocator);
    00097   virtual ~OutputStream();
    00098 protected:
    00100   StatusCode decodeAcceptAlgs( );
    00102   void acceptAlgsHandler( Property& theProp );
    00104   StatusCode decodeRequireAlgs( );
    00106   void requireAlgsHandler( Property& theProp );
    00108   StatusCode decodeVetoAlgs( );
    00110   void vetoAlgsHandler( Property& theProp );
    00112   StatusCode decodeAlgorithms( StringArrayProperty& theNames,
    00113                                std::vector<Algorithm*>* theAlgs );
    00115   bool isEventAccepted( ) const;
    00117   DataStoreItem* findItem(const std::string& path);
    00119   virtual StatusCode writeObjects();
    00120
    00122   bool m_fireIncidents;
    00123
    00125   virtual bool hasInput() const;
    00126
    00127 public:
    00129         virtual StatusCode initialize();
    00131         virtual StatusCode finalize();
    00133         virtual StatusCode execute();
    00134   // Connect to proper conversion service
    00135   virtual StatusCode connectConversionSvc();
    00137   virtual bool collect(IRegistry* dir, int level);
    00139   virtual StatusCode collectObjects();
    00141   void clearItems(Items& itms);
    00143   void addItem(Items& itms, const std::string& descriptor);
    00145   void clearSelection();
    00147   IDataSelector* selectedObjects()    {
    00148     return &m_objects;
    00149   }
    00150 };
    00151
    00152 #endif // GAUDISVC_PERSISTENCYSVC_OUTPUTSTREAM_H