winss
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
winss::SuperviseController Class Reference

A controller for supervised processes. More...

#include <controller.hpp>

Inheritance diagram for winss::SuperviseController:
Inheritance graph
[legend]
Collaboration diagram for winss::SuperviseController:
Collaboration graph
[legend]

Public Member Functions

 SuperviseController (winss::NotOwningPtr< winss::Supervise > supervise, winss::NotOwningPtr< winss::OutboundPipeServer > outbound, winss::NotOwningPtr< winss::InboundPipeServer > inbound)
 Supervise controller constructor. More...
 
 SuperviseController (const SuperviseController &)=delete
 No copy. More...
 
 SuperviseController (SuperviseController &&)=delete
 No move. More...
 
bool Notify (winss::SuperviseNotification notification, const winss::SuperviseState &state)
 Supervisor listener handler. More...
 
bool Received (const std::vector< char > &data)
 Pipe server received handler. More...
 
SuperviseControlleroperator= (const SuperviseController &)=delete
 No copy. More...
 
SuperviseControlleroperator= (SuperviseController &&)=delete
 No move. More...
 
- Public Member Functions inherited from winss::SuperviseListener
virtual ~SuperviseListener ()
 Default virtual destructor. More...
 
- Public Member Functions inherited from winss::PipeServerReceiveListener
virtual ~PipeServerReceiveListener ()
 Default destructor. More...
 

Static Public Member Functions

static winss::SuperviseNotification GetNotification (char c)
 Gets the notification for the given control char. More...
 

Static Public Attributes

static const char kSvcUp = 'u'
 Up control char. More...
 
static const char kSvcOnce = 'o'
 Up once code. More...
 
static const char kSvcOnceAtMost = 'O'
 Up once at most control char. More...
 
static const char kSvcDown = 'd'
 Down control char. More...
 
static const char kSvcKill = 'k'
 Kill control char. More...
 
static const char kSvcTerm = 't'
 Terminate control char. More...
 
static const char kSvcExit = 'x'
 Exit control char. More...
 
static const char kSuperviseStart = 's'
 Start event. More...
 
static const char kSuperviseRun = 'u'
 Run event. More...
 
static const char kSuperviseEnd = 'd'
 End event. More...
 
static const char kSuperviseBroken = 'O'
 Broken event. More...
 
static const char kSuperviseFinished = 'D'
 Finished event. More...
 
static const char kSuperviseExit = 'x'
 Exit event. More...
 

Detailed Description

A controller for supervised processes.

Brokers the communication to and from the supervised process for control and event notification.

Constructor & Destructor Documentation

winss::SuperviseController::SuperviseController ( winss::NotOwningPtr< winss::Supervise supervise,
winss::NotOwningPtr< winss::OutboundPipeServer outbound,
winss::NotOwningPtr< winss::InboundPipeServer inbound 
)

Supervise controller constructor.

Parameters
superviseThe supervisor.
outboundThe outbound named pipe server.
inboundThe inbound named pipe server.

References winss::InboundPipeServerTmpl< TPipeInstance >::AddListener(), winss::SuperviseTmpl< TMutex, TProcess >::AddListener(), and winss::NotOwned().

winss::SuperviseController::SuperviseController ( const SuperviseController )
delete

No copy.

winss::SuperviseController::SuperviseController ( SuperviseController &&  )
delete

No move.

Member Function Documentation

winss::SuperviseNotification winss::SuperviseController::GetNotification ( char  c)
static

Gets the notification for the given control char.

Parameters
[in]cThe control char.
Returns
The notification.

References winss::END, winss::EXIT, winss::FINISHED, kSuperviseEnd, kSuperviseExit, kSuperviseFinished, kSuperviseRun, kSuperviseStart, winss::RUN, winss::START, and winss::UNKNOWN.

Referenced by winss::SuperviseStateListener::HandleReceived().

bool winss::SuperviseController::Notify ( winss::SuperviseNotification  notification,
const winss::SuperviseState state 
)
virtual

Supervisor listener handler.

Parameters
[in]notificationThe event which occurred.
[in]stateThe current state of the supervisor.
Returns
Always true.

Implements winss::SuperviseListener.

References winss::BROKEN, winss::END, winss::EXIT, winss::FINISHED, kSuperviseBroken, kSuperviseEnd, kSuperviseExit, kSuperviseFinished, kSuperviseRun, kSuperviseStart, winss::RUN, and winss::START.

SuperviseController& winss::SuperviseController::operator= ( const SuperviseController )
delete

No copy.

SuperviseController& winss::SuperviseController::operator= ( SuperviseController &&  )
delete

No move.

bool winss::SuperviseController::Received ( const std::vector< char > &  data)
virtual

Pipe server received handler.

Parameters
[in]dataThe received data.
Returns
Always true.

Implements winss::PipeServerReceiveListener.

References kSvcDown, kSvcExit, kSvcKill, kSvcOnce, kSvcOnceAtMost, kSvcTerm, and kSvcUp.

Member Data Documentation

const char winss::SuperviseController::kSuperviseBroken = 'O'
static

Broken event.

Referenced by Notify().

const char winss::SuperviseController::kSuperviseEnd = 'd'
static

End event.

Referenced by GetNotification(), and Notify().

const char winss::SuperviseController::kSuperviseExit = 'x'
static

Exit event.

Referenced by GetNotification(), and Notify().

const char winss::SuperviseController::kSuperviseFinished = 'D'
static

Finished event.

Referenced by GetNotification(), and Notify().

const char winss::SuperviseController::kSuperviseRun = 'u'
static

Run event.

Referenced by GetNotification(), and Notify().

const char winss::SuperviseController::kSuperviseStart = 's'
static

Start event.

Referenced by GetNotification(), and Notify().

const char winss::SuperviseController::kSvcDown = 'd'
static

Down control char.

Referenced by Received().

const char winss::SuperviseController::kSvcExit = 'x'
static

Exit control char.

Referenced by Received().

const char winss::SuperviseController::kSvcKill = 'k'
static

Kill control char.

Referenced by Received().

const char winss::SuperviseController::kSvcOnce = 'o'
static

Up once code.

Referenced by Received().

const char winss::SuperviseController::kSvcOnceAtMost = 'O'
static

Up once at most control char.

Referenced by Received().

const char winss::SuperviseController::kSvcTerm = 't'
static

Terminate control char.

Referenced by Received().

const char winss::SuperviseController::kSvcUp = 'u'
static

Up control char.

Referenced by Received().


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