EMANE  1.0.1
EMANE::NEMLayerState Class Referenceabstract

Encapsulated behavior associated with an NEMLayer depending on the layer's current context. More...

#include <nemlayerstate.h>

Inheritance diagram for EMANE::NEMLayerState:
EMANE::NEMLayerStateConfigured EMANE::NEMLayerStateDestroyed EMANE::NEMLayerStateInitialized EMANE::NEMLayerStateRunning EMANE::NEMLayerStateStopped EMANE::NEMLayerStateUninitialized

Public Member Functions

virtual ~NEMLayerState ()=0
 
virtual void handleInitialize (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, Registrar &registrar)
 
virtual void handleConfigure (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, const ConfigurationUpdate &update)
 
virtual void handleStart (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer)
 
virtual void handlePostStart (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer)
 
virtual void handleStop (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer)
 
virtual void handleDestroy (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer) throw ()
 
virtual void processConfiguration (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, const ConfigurationUpdate &update)
 
virtual void processDownstreamControl (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, const ControlMessages &msgs)
 
virtual void processDownstreamPacket (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, DownstreamPacket &pkt, const ControlMessages &msgs)
 
virtual void processUpstreamPacket (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, UpstreamPacket &pkt, const ControlMessages &msgs)
 
virtual void processUpstreamControl (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, const ControlMessages &msgs)
 
virtual void processEvent (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, const EventId &id, const Serialization &serialization)
 
virtual void processTimedEvent (NEMStatefulLayer *pStatefulLayer, NEMLayer *pLayer, TimerEventId eventId, const TimePoint &expireTime, const TimePoint &scheduleTime, const TimePoint &fireTime, const void *arg)
 
std::string getStateName () const
 

Protected Member Functions

 NEMLayerState (const char *pzStateName)
 
void changeState (NEMStatefulLayer *pStatefulLayer, NEMLayerState *pState)
 

Protected Attributes

const char * pzStateName_
 

Detailed Description

Encapsulated behavior associated with an NEMLayer depending on the layer's current context.

Definition at line 50 of file nemlayerstate.h.

Constructor & Destructor Documentation

◆ ~NEMLayerState()

EMANE::NEMLayerState::~NEMLayerState ( )
pure virtual

Definition at line 41 of file nemlayerstate.cc.

◆ NEMLayerState()

EMANE::NEMLayerState::NEMLayerState ( const char *  pzStateName)
protected

Definition at line 38 of file nemlayerstate.cc.

Member Function Documentation

◆ changeState()

void EMANE::NEMLayerState::changeState ( NEMStatefulLayer pStatefulLayer,
NEMLayerState pState 
)
protected

Definition at line 192 of file nemlayerstate.cc.

◆ getStateName()

std::string EMANE::NEMLayerState::getStateName ( ) const

Get state name

Returns
state Name of current state

Definition at line 198 of file nemlayerstate.cc.

◆ handleConfigure()

void EMANE::NEMLayerState::handleConfigure ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
const ConfigurationUpdate update 
)
virtual

Handle configuration

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
updateConfiguration update
Exceptions
ConfigureException
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateConfigured, and EMANE::NEMLayerStateInitialized.

Definition at line 54 of file nemlayerstate.cc.

◆ handleDestroy()

void EMANE::NEMLayerState::handleDestroy ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer 
)
throw (
)
virtual

Handle destroy

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateStopped.

Definition at line 95 of file nemlayerstate.cc.

◆ handleInitialize()

void EMANE::NEMLayerState::handleInitialize ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
Registrar registrar 
)
virtual

Handle initialize

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
registrarRegistrar reference
Exceptions
InitializeException
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateUninitialized.

Definition at line 43 of file nemlayerstate.cc.

◆ handlePostStart()

void EMANE::NEMLayerState::handlePostStart ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer 
)
virtual

Handle post start

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 75 of file nemlayerstate.cc.

◆ handleStart()

void EMANE::NEMLayerState::handleStart ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer 
)
virtual

Handle start

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
Exceptions
StartException
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateConfigured.

Definition at line 65 of file nemlayerstate.cc.

◆ handleStop()

void EMANE::NEMLayerState::handleStop ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer 
)
virtual

Handle stop

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
Exceptions
StopException
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 85 of file nemlayerstate.cc.

◆ processConfiguration()

void EMANE::NEMLayerState::processConfiguration ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
const ConfigurationUpdate update 
)
virtual

Process configuration update

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
updateReference to the configuration update
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 106 of file nemlayerstate.cc.

◆ processDownstreamControl()

void EMANE::NEMLayerState::processDownstreamControl ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
const ControlMessages msgs 
)
virtual

Process downstream control

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
msgsReference to the Control message
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 117 of file nemlayerstate.cc.

◆ processDownstreamPacket()

void EMANE::NEMLayerState::processDownstreamPacket ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
DownstreamPacket pkt,
const ControlMessages msgs 
)
virtual

Process downstream packet

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
pktReference to the Downstream packet
msgsreference to the ControlMessage
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 128 of file nemlayerstate.cc.

◆ processEvent()

void EMANE::NEMLayerState::processEvent ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
const EventId id,
const Serialization serialization 
)
virtual

Process event

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
idEvent Id
serializationEvent object serialization
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 163 of file nemlayerstate.cc.

◆ processTimedEvent()

void EMANE::NEMLayerState::processTimedEvent ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
TimerEventId  eventId,
const TimePoint expireTime,
const TimePoint scheduleTime,
const TimePoint fireTime,
const void *  arg 
)
virtual

Process timed event

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
eventIdIdentifier corresponding to the timer being processed
expireTimeThe time the timer was scheduled to expire
scheduleTimeThe Time the timer was scheduled
fireTimeTime time The time the timer actually fired
argOpaque timed event data
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 176 of file nemlayerstate.cc.

◆ processUpstreamControl()

void EMANE::NEMLayerState::processUpstreamControl ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
const ControlMessages msgs 
)
virtual

Process upstream control

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
msgsReference to the Control message
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 152 of file nemlayerstate.cc.

◆ processUpstreamPacket()

void EMANE::NEMLayerState::processUpstreamPacket ( NEMStatefulLayer pStatefulLayer,
NEMLayer pLayer,
UpstreamPacket pkt,
const ControlMessages msgs 
)
virtual

Process downstream packet

Parameters
pStatefulLayerReference to the stateful layer
pLayerReference to the wrapped layer
pktReference to the Upstream packet
msgsreference to the ControlMessage
Note
Default implementation generates a log error

Reimplemented in EMANE::NEMLayerStateRunning.

Definition at line 140 of file nemlayerstate.cc.

Member Data Documentation

◆ pzStateName_

const char* EMANE::NEMLayerState::pzStateName_
protected

Definition at line 252 of file nemlayerstate.h.


The documentation for this class was generated from the following files: