/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
TestIOIncidentAlg Class Reference

Test the RootIOIncidents emitted by RootIO. More...

#include <TestIOIncidentAlg.h>

List of all members.

Public Member Functions

 TestIOIncidentAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TestIOIncidentAlg ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
virtual void handle (const Incident &incident)

Private Attributes

IIncidentSvc * m_incsvc

Detailed Description

Test the RootIOIncidents emitted by RootIO.

Brett Viren <bv@bnl.gov> Fri Feb 18 15:45:11 2011

Definition at line 23 of file TestIOIncidentAlg.h.


Constructor & Destructor Documentation

TestIOIncidentAlg::TestIOIncidentAlg ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Definition at line 6 of file TestIOIncidentAlg.cc.

    : GaudiAlgorithm(name,pSvcLocator)
{
}
TestIOIncidentAlg::~TestIOIncidentAlg ( ) [virtual]

Definition at line 12 of file TestIOIncidentAlg.cc.

{
}

Member Function Documentation

StatusCode TestIOIncidentAlg::initialize ( ) [virtual]

Definition at line 16 of file TestIOIncidentAlg.cc.

{
    StatusCode sc = GaudiAlgorithm::initialize();
    if (sc.isFailure()) return sc;

    // Get and hold on to the incident service and add ourself.
    m_incsvc = svc<IIncidentSvc>("IncidentSvc",true);
    m_incsvc->addListener(this,"RootIOIncident");

    info() << "initialize()" << endreq;

    return StatusCode::SUCCESS;
}
StatusCode TestIOIncidentAlg::execute ( ) [virtual]

Definition at line 30 of file TestIOIncidentAlg.cc.

{
    info() << "execute()" << endreq;

    return StatusCode::SUCCESS;
}
StatusCode TestIOIncidentAlg::finalize ( ) [virtual]

Definition at line 37 of file TestIOIncidentAlg.cc.

{
    info() << "finalize()" << endreq;

    // Must remove self.  O.w. we may finalize before RootIOSvc and
    // leave beind a dangling handler.
    m_incsvc->removeListener(this,"RootIOIncident");
    m_incsvc->release();

    return GaudiAlgorithm::finalize();
}
void TestIOIncidentAlg::handle ( const Incident &  incident) [virtual]

Definition at line 49 of file TestIOIncidentAlg.cc.

{
    // Handle the incident in a trivial manner

    info() << "Got incident from \"" << incident.source()
           << "\" and type \"" << incident.type() << "\"" << endreq;
    const RootIOIncident* rioinc = dynamic_cast<const RootIOIncident*>(&incident);
    if (!rioinc) {
        warning() 
            << "Ignoring unexpected incident not of class RootIOIncident" 
            << endreq;
        return;
    }
    info () << "File name: \"" << rioinc->filename() 
            << "\" file state: \"" << rioinc->state() << "\"" 
            << endreq;
}

Member Data Documentation

IIncidentSvc* TestIOIncidentAlg::m_incsvc [private]

Definition at line 39 of file TestIOIncidentAlg.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:15:57 for DybIO by doxygen 1.7.4