EMANE  1.2.1
EMANE::NEMStatefulLayer Class Reference

A layer stack that enforces component state transition rules. The stateful layer is not a fully functional layer it wraps a real NEM layer allowing only correct transitions and state actions. More...

#include <nemstatefullayer.h>

Inheritance diagram for EMANE::NEMStatefulLayer:
EMANE::NEMLayer EMANE::Component EMANE::UpstreamTransport EMANE::DownstreamTransport EMANE::PlatformServiceUser EMANE::Buildable EMANE::RunningStateMutable EMANE::EventServiceUser EMANE::TimerServiceUser

Public Member Functions

 NEMStatefulLayer (NEMId id, NEMLayer *pLayer, PlatformServiceProvider *pPlatformService)
 
 ~NEMStatefulLayer ()
 
void initialize (Registrar &registrar) override
 initialize More...
 
void configure (const ConfigurationUpdate &update) override
 
void start () override
 
void postStart () override
 
void stop () override
 
void destroy () override throw ()
 
void processConfiguration (const ConfigurationUpdate &update) override
 
void processUpstreamControl (const ControlMessages &msgs) override
 
void processUpstreamPacket (UpstreamPacket &pkt, const ControlMessages &msgs) override
 
void processDownstreamControl (const ControlMessages &msgs) override
 
void processDownstreamPacket (DownstreamPacket &pkt, const ControlMessages &msgs) override
 
void processEvent (const EventId &eventId, const Serialization &serialization) override
 
void processTimedEvent (TimerEventId eventId, const TimePoint &expireTime, const TimePoint &scheduleTime, const TimePoint &fireTime, const void *arg) override
 
void setUpstreamTransport (UpstreamTransport *pUpstreamTransport) override
 
void setDownstreamTransport (DownstreamTransport *pDownstreamTransport) override
 
void changeState (NEMLayerState *pState)
 
NEMId getNEMId () const
 
void sendDownstreamPacket (DownstreamPacket &pkt, const ControlMessages &msgs=empty)
 
void sendDownstreamControl (const ControlMessages &msgs)
 
void sendUpstreamPacket (UpstreamPacket &pkt, const ControlMessages &msgs=empty)
 
void sendUpstreamControl (const ControlMessages &msgs)
 
BuildId getBuildId () const
 
void setBuildId (BuildId bid)
 

Static Public Attributes

static const ControlMessages empty
 
static const ControlMessages empty
 

Protected Attributes

NEMId id_
 
PlatformServiceProviderpPlatformService_
 

Detailed Description

A layer stack that enforces component state transition rules. The stateful layer is not a fully functional layer it wraps a real NEM layer allowing only correct transitions and state actions.

Definition at line 54 of file nemstatefullayer.h.

Constructor & Destructor Documentation

◆ NEMStatefulLayer()

EMANE::NEMStatefulLayer::NEMStatefulLayer ( NEMId  id,
NEMLayer pLayer,
EMANE::PlatformServiceProvider pPlatformService 
)

Constructor

Parameters
idNEM id
pLayerLayer to statefully wrap
pPlatformServicepointer to the PlatformServiceProvider
Note
Initial state is NEMLayerStateUninitialized

Definition at line 38 of file nemstatefullayer.cc.

◆ ~NEMStatefulLayer()

EMANE::NEMStatefulLayer::~NEMStatefulLayer ( )

Definition at line 45 of file nemstatefullayer.cc.

Member Function Documentation

◆ changeState()

void EMANE::NEMStatefulLayer::changeState ( NEMLayerState pState)

Change state

Parameters
pStateNew state to transition to

Definition at line 121 of file nemstatefullayer.cc.

◆ configure()

void EMANE::NEMStatefulLayer::configure ( const ConfigurationUpdate update)
overridevirtual

Configure the component.

Parameters
updateConfiguration update values
Exceptions
ConfigureExceptionthrown when a unexpected configuration item is encountered or there is a problem with the specified item value

Implements EMANE::Component.

Definition at line 52 of file nemstatefullayer.cc.

◆ destroy()

void EMANE::NEMStatefulLayer::destroy ( )
throw (
)
overridevirtual

Destroy the component.

Implements EMANE::Component.

Definition at line 72 of file nemstatefullayer.cc.

◆ getBuildId()

EMANE::BuildId EMANE::Buildable::getBuildId ( ) const
inlineinherited

Gets the application wide unique BuildId of this object.

Returns
the BuildId

Definition at line 34 of file buildable.inl.

◆ getNEMId()

NEMId EMANE::NEMLayer::getNEMId ( ) const
inlineinherited

Get the NEM identifier.

Returns
NEM identifier

Definition at line 72 of file nemlayer.h.

◆ initialize()

void EMANE::NEMStatefulLayer::initialize ( Registrar registrar)
overridevirtual

initialize

Implements EMANE::Component.

Definition at line 47 of file nemstatefullayer.cc.

◆ postStart()

void EMANE::NEMStatefulLayer::postStart ( )
overridevirtual

Hook to run any post start functionaililty. Called after all the components have been started.

Reimplemented from EMANE::Component.

Definition at line 62 of file nemstatefullayer.cc.

◆ processConfiguration()

void EMANE::NEMStatefulLayer::processConfiguration ( const ConfigurationUpdate update)
overridevirtual

Process dynamic running-state configuration updates

Parameters
updateConfiguration update
Note
Running state configuration errors are indicated using a validator. Validators can be registered using the ConfigurationRegistrar.

Reimplemented from EMANE::RunningStateMutable.

Definition at line 78 of file nemstatefullayer.cc.

◆ processDownstreamControl()

void EMANE::NEMStatefulLayer::processDownstreamControl ( const ControlMessages msgs)
overridevirtual

Process downstream control message

Parameters
msgsReference to the ControlMessages

Implements EMANE::DownstreamTransport.

Definition at line 83 of file nemstatefullayer.cc.

◆ processDownstreamPacket()

void EMANE::NEMStatefulLayer::processDownstreamPacket ( DownstreamPacket pkt,
const ControlMessages msgs 
)
overridevirtual

Process downstream packet

Parameters
pktReference to the DownstreamPacket to process
msgsoptional reference to the ControlMessages

Implements EMANE::DownstreamTransport.

Definition at line 88 of file nemstatefullayer.cc.

◆ processEvent()

void EMANE::NEMStatefulLayer::processEvent ( const EventId eventId,
const Serialization serialization 
)
overridevirtual

Process an event.

Parameters
eventIdevent identifier corresponding to the serialized event
serializationopaque event object data

Reimplemented from EMANE::EventServiceUser.

Definition at line 105 of file nemstatefullayer.cc.

◆ processTimedEvent()

void EMANE::NEMStatefulLayer::processTimedEvent ( TimerEventId  eventId,
const TimePoint expireTime,
const TimePoint scheduleTime,
const TimePoint fireTime,
const void *  arg 
)
overridevirtual

Process a timed event

Parameters
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
All times are abosulte using CLOCK_REALTIME

Reimplemented from EMANE::TimerServiceUser.

Definition at line 126 of file nemstatefullayer.cc.

◆ processUpstreamControl()

void EMANE::NEMStatefulLayer::processUpstreamControl ( const ControlMessages msgs)
overridevirtual

Process upstream control message

Parameters
msgsreference to the ControlMessages

Implements EMANE::UpstreamTransport.

Definition at line 100 of file nemstatefullayer.cc.

◆ processUpstreamPacket()

void EMANE::NEMStatefulLayer::processUpstreamPacket ( UpstreamPacket pkt,
const ControlMessages msgs 
)
overridevirtual

Process upstream packet

Parameters
pktreference to the UpstreamPacket to process
msgsoptional reference to the ControlMessages

Implements EMANE::UpstreamTransport.

Definition at line 94 of file nemstatefullayer.cc.

◆ sendDownstreamControl()

void EMANE::UpstreamTransport::sendDownstreamControl ( const ControlMessages msgs)
inlineinherited

Send downstream control message

Parameters
msgsreference to the ControlMessages

Definition at line 44 of file upstreamtransport.inl.

◆ sendDownstreamPacket()

void EMANE::UpstreamTransport::sendDownstreamPacket ( DownstreamPacket pkt,
const ControlMessages msgs = empty 
)
inlineinherited

Send downsteam packet

Parameters
pktreference to the DownstreamPacket to process
msgsoptional reference to the ControlMessages

Definition at line 37 of file upstreamtransport.inl.

◆ sendUpstreamControl()

void EMANE::DownstreamTransport::sendUpstreamControl ( const ControlMessages msgs)
inlineinherited

Send upstream control message

Parameters
msgsReference to the ControlMessages

Definition at line 44 of file downstreamtransport.inl.

◆ sendUpstreamPacket()

void EMANE::DownstreamTransport::sendUpstreamPacket ( UpstreamPacket pkt,
const ControlMessages msgs = empty 
)
inlineinherited

Send upstream packet

Parameters
pktReference to the UpstreamPacket to process
msgsoptional reference to the ControlMessages

Definition at line 37 of file downstreamtransport.inl.

◆ setBuildId()

void EMANE::Buildable::setBuildId ( BuildId  bid)
inlineinherited

Sets the application wide unique BuildId of this object. Builders assign a BuildId to objects at instantiation.

Parameters
bidthe BuildId
Note
: This method is for internal framework use only.

Definition at line 40 of file buildable.inl.

◆ setDownstreamTransport()

void EMANE::NEMStatefulLayer::setDownstreamTransport ( DownstreamTransport pDownstreamTransport)
overridevirtual

Set the downstream transport.

Parameters
pDownstreamTransportPointer to the downstream transport of this upstream transport.
Note
: This method is for internal framework use only.

Reimplemented from EMANE::UpstreamTransport.

Definition at line 116 of file nemstatefullayer.cc.

◆ setUpstreamTransport()

void EMANE::NEMStatefulLayer::setUpstreamTransport ( UpstreamTransport pUpstreamTransport)
overridevirtual

Set the upstream transport.

Parameters
pUpstreamTransportPointer to the upstream transport of this downstream transport.

Reimplemented from EMANE::DownstreamTransport.

Definition at line 111 of file nemstatefullayer.cc.

◆ start()

void EMANE::NEMStatefulLayer::start ( )
overridevirtual

Start the component.

Exceptions
StartExceptionthrown when an error is encountered during start.

Implements EMANE::Component.

Definition at line 57 of file nemstatefullayer.cc.

◆ stop()

void EMANE::NEMStatefulLayer::stop ( )
overridevirtual

Stop the component.

Exceptions
StopExceptionthrown when an error is encountered during stop

Implements EMANE::Component.

Definition at line 67 of file nemstatefullayer.cc.

Member Data Documentation

◆ empty [1/2]

const EMANE::ControlMessages EMANE::DownstreamTransport::empty
staticinherited

Definition at line 102 of file downstreamtransport.h.

◆ empty [2/2]

const EMANE::ControlMessages EMANE::UpstreamTransport::empty
staticinherited

Definition at line 106 of file upstreamtransport.h.

◆ id_

NEMId EMANE::NEMLayer::id_
protectedinherited

Definition at line 81 of file nemlayer.h.

◆ pPlatformService_

PlatformServiceProvider* EMANE::PlatformServiceUser::pPlatformService_
protectedinherited

Definition at line 64 of file platformserviceuser.h.


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