/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 | Static Public Member Functions | Private Member Functions | Private Attributes
ArchiveTrimSvc Class Reference

#include <ArchiveTrimSvc.h>

Inheritance diagram for ArchiveTrimSvc:
Inheritance graph
[legend]
Collaboration diagram for ArchiveTrimSvc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ArchiveTrimSvc (const std::string &name, ISvcLocator *svc)
 Standard Service Constructor.
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode trim (IDataManagerSvc *dataStore, const TimeStamp &latest)
 IArchiveTrimSvc methods.
virtual const TimeStampwindow (const std::string &path)
virtual StatusCode queryInterface (const InterfaceID &id, void **interface)
 Methods required by ServiceManager.
void updateWindow (Property &property)
 Callback method for window value.

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Member Functions

void _update ()

Private Attributes

DoubleProperty m_defaultWindowSeconds
 The Time window used by this service in seconds (no system of units!)
TrimmingAgentm_agent
 The DataStoreAgent used to timr the contents of the store.

Detailed Description

Definition at line 13 of file ArchiveTrimSvc.h.


Constructor & Destructor Documentation

ArchiveTrimSvc::ArchiveTrimSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Standard Service Constructor.

Definition at line 9 of file ArchiveTrimSvc.cpp.

                                                 :
                                 Service(name,
                                         svc),
                                 m_agent(0) {
  declareProperty("DefaultWindowSeconds",
                  m_defaultWindowSeconds=0,
                  "The default length of the trim window in seconds.");
  m_defaultWindowSeconds.declareUpdateHandler(&ArchiveTrimSvc::updateWindow,
                                              this);
}

Member Function Documentation

StatusCode ArchiveTrimSvc::initialize ( ) [virtual]

Definition at line 36 of file ArchiveTrimSvc.cpp.

                                      {
  StatusCode status = Service::initialize();
  if (status.isFailure()) {
    throw GaudiException("Could not initialize super class",
                         name(),
                         status);
  }

  IIncidentSvc* incsvc = 0;
  status = service("IncidentSvc",incsvc,true);
  if (status.isFailure()) {
      return status;
  }

  m_agent = new TrimmingAgent(new MsgStream(msgSvc(), name()),
                              incsvc);
  this->_update();
  return StatusCode::SUCCESS;
}
StatusCode ArchiveTrimSvc::finalize ( ) [virtual]

Definition at line 56 of file ArchiveTrimSvc.cpp.

                                    {
  if (0 != m_agent) {
    delete m_agent;
  }
  
  return Service::finalize();
}
StatusCode ArchiveTrimSvc::trim ( IDataManagerSvc *  dataStore,
const TimeStamp latest 
) [virtual]

IArchiveTrimSvc methods.

Implements IArchiveTrimSvc.

Definition at line 83 of file ArchiveTrimSvc.cpp.

                                                         {
  m_agent->setLatest(latest);
  return dataStore->traverseTree(m_agent);
}
const TimeStamp & ArchiveTrimSvc::window ( const std::string &  path) [virtual]

Implements IArchiveTrimSvc.

Definition at line 89 of file ArchiveTrimSvc.cpp.

                                                             {
  if ( 0 == m_agent) {
    throw GaudiException("Service not yet initialized",
                         name(),
                         StatusCode::FAILURE);
  }
  return m_agent->window(path);
}
StatusCode ArchiveTrimSvc::queryInterface ( const InterfaceID &  id,
void **  interface 
) [virtual]

Methods required by ServiceManager.

Definition at line 21 of file ArchiveTrimSvc.cpp.

                                                            {
  if (IArchiveTrimSvc::interfaceID().versionMatch(id)) {
    // If good enough match return this object.
    *interface = (IArchiveTrimSvc*)this;
    addRef();
  } else {
    // Interface is not directly available: try out a base class.
    return Service::queryInterface(id,
                                   interface);
  }

  return StatusCode::SUCCESS;
}
void ArchiveTrimSvc::updateWindow ( Property &  property)

Callback method for window value.

Definition at line 64 of file ArchiveTrimSvc.cpp.

                                            {
    if (! m_agent) return;
    this->_update();
}
void ArchiveTrimSvc::_update ( ) [private]

Definition at line 69 of file ArchiveTrimSvc.cpp.

{
    MsgStream log(msgSvc(), name());

    TimeStamp dt(m_defaultWindowSeconds);

    log << MSG::INFO
        << "Setting default AES window to "
        << double(dt)
        << " seconds" << endreq;
    
    m_agent->setWindow(dt);
}

Member Data Documentation

DoubleProperty ArchiveTrimSvc::m_defaultWindowSeconds [private]

The Time window used by this service in seconds (no system of units!)

Definition at line 42 of file ArchiveTrimSvc.h.

The DataStoreAgent used to timr the contents of the store.

Definition at line 48 of file ArchiveTrimSvc.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:09:08 for DybEventMgr by doxygen 1.7.4