/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
HEIHandler Class Reference

#include <DybBipELM_HEIHandler.h>

Collaboration diagram for HEIHandler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 HEIHandler (IEventProcessor *&theEventProcessor, IEventProcessor *eventProcessor1, IEventProcessor *eventProcessor2, MsgStream &msg)
void handle (const Incident &incident)
virtual ~HEIHandler ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
virtual unsigned long addRef ()
 Increment the reference count of Interface instance.
virtual unsigned long release ()
 Release Interface instance.
 HEIHandler (ELMState *&theState, ELMState *state1, ELMState *state2)
void handle (const Incident &incident)
virtual ~HEIHandler ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
virtual unsigned long addRef ()
 Increment the reference count of Interface instance.
virtual unsigned long release ()
 Release Interface instance.

Private Attributes

IEventProcessor *& m_theEventProcessor
MsgStream & log
IEventProcessor * procs [2]
unsigned long m_refCount
ELMState *& m_theState
ELMStatem_states [2]

Detailed Description

Definition at line 11 of file DybBipELM_HEIHandler.h.


Constructor & Destructor Documentation

HEIHandler::HEIHandler ( IEventProcessor *&  theEventProcessor,
IEventProcessor *  eventProcessor1,
IEventProcessor *  eventProcessor2,
MsgStream &  msg 
) [inline]

Definition at line 18 of file DybBipELM_HEIHandler.h.

        : m_theEventProcessor(theEventProcessor)
        , log(msg) 
    {
        procs[0] = eventProcessor1;
        procs[1] = eventProcessor2;
    }
HEIHandler::~HEIHandler ( ) [inline, virtual]

Definition at line 58 of file DybBipELM_HEIHandler.h.

{}
HEIHandler::HEIHandler ( ELMState *&  theState,
ELMState state1,
ELMState state2 
)

Definition at line 9 of file DybDualELM_HEIHandler.cpp.

    : m_theState(theState)
    , m_refCount(0)
{
    m_states[0] = state1;
    m_states[1] = state2;
}
virtual HEIHandler::~HEIHandler ( ) [virtual]

Member Function Documentation

void HEIHandler::handle ( const Incident &  incident) [inline]

Definition at line 29 of file DybBipELM_HEIHandler.h.

                                          {
        log << MSG::DEBUG 
            << "Handling incident of type \"" << incident.type() << "\" "
            << "coming from \"" << incident.source() << "\"" 
            << endreq;

        // Handle the incident in a trivial manner
        const HybridExecutionIncident* heinc = dynamic_cast<const HybridExecutionIncident*>(&incident);
        if (!heinc) {
            log << MSG::WARNING
                << "Ignoring unexpected incident not of class HybridExecutionIncident" 
                << endreq;
            return;
        }

        int branch = heinc->branch();
        if (branch < 1 || branch > 2) {
            log << MSG::WARNING
                << "Got bogus branch number: " << branch << endreq;
            return;
        }

        m_theEventProcessor = procs[branch-1];
        log << MSG::DEBUG
            << "Switched to event processor #" << branch << endreq;
    }
StatusCode HEIHandler::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
) [inline, virtual]

Definition at line 60 of file DybBipELM_HEIHandler.h.

                                                          {
      if ( 0 == ppvInterface ) {
        return StatusCode::FAILURE;
      }
      if ( IIncidentListener::interfaceID().versionMatch(riid) ) {
        *ppvInterface = static_cast<IIncidentListener*>( this );
      }
      else if ( IInterface::interfaceID().versionMatch(riid) ) {
        *ppvInterface = static_cast<IInterface*>( this );
      }
      else {
        *ppvInterface = 0;
        return NO_INTERFACE;
      } 
      // increment reference counter 
      addRef();
      return SUCCESS;
    }
unsigned long HEIHandler::addRef ( ) [inline, virtual]

Increment the reference count of Interface instance.

Definition at line 81 of file DybBipELM_HEIHandler.h.

{return ++m_refCount;}
unsigned long HEIHandler::release ( ) [inline, virtual]

Release Interface instance.

Definition at line 84 of file DybBipELM_HEIHandler.h.

                                    {
      unsigned long count = --m_refCount;
      if( count == 0 ) {
        delete this;
      }
      return count;
    }
void HEIHandler::handle ( const Incident &  incident)
virtual StatusCode HEIHandler::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
) [virtual]
virtual unsigned long HEIHandler::addRef ( ) [virtual]

Increment the reference count of Interface instance.

virtual unsigned long HEIHandler::release ( ) [virtual]

Release Interface instance.


Member Data Documentation

IEventProcessor*& HEIHandler::m_theEventProcessor [private]

Definition at line 13 of file DybBipELM_HEIHandler.h.

MsgStream& HEIHandler::log [private]

Definition at line 14 of file DybBipELM_HEIHandler.h.

IEventProcessor* HEIHandler::procs[2] [private]

Definition at line 16 of file DybBipELM_HEIHandler.h.

unsigned long HEIHandler::m_refCount [private]

Definition at line 93 of file DybBipELM_HEIHandler.h.

Definition at line 14 of file DybDualELM_HEIHandler.h.

Definition at line 15 of file DybDualELM_HEIHandler.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