NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
Classes | Public Member Functions | List of all members
BiometricEvaluation::Process::CommandCenter< T, typename > Class Template Reference

Receive enumerations as commands over the network. More...

#include <be_process_commandcenter.h>

Inherited by BiometricEvaluation::Process::CommandParser< T >.

Classes

class  Command
 Parsed command received from the network. More...
 

Public Member Functions

 CommandCenter (uint16_t port=MessageCenter::DEFAULT_PORT)
 Constructor. More...
 
 ~CommandCenter ()=default
 Destructor (default). More...
 
bool hasPendingCommands ()
 Determine if there are commands waiting. More...
 
bool getNextCommand (Command &command, int numSeconds=-1, std::string invalidCommandResponse="")
 Get the next command. More...
 
void sendResponse (uint32_t clientID, const std::string &response, const std::string prefix=">> ", const std::string suffix="\n")
 Send a string response to a client. More...
 
void disconnectClient (uint32_t clientID)
 Break the connection with a client. More...
 

Detailed Description

template<typename T, typename = typename std::enable_if<std::is_enum<T>::value>>
class BiometricEvaluation::Process::CommandCenter< T, typename >

Receive enumerations as commands over the network.

Definition at line 31 of file be_process_commandcenter.h.

Constructor & Destructor Documentation

◆ CommandCenter()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value>>
BiometricEvaluation::Process::CommandCenter< T, typename >::CommandCenter ( uint16_t  port = MessageCenter::DEFAULT_PORT)
inline

Constructor.

Parameters
portPort to listen on for commands.

Definition at line 56 of file be_process_commandcenter.h.

◆ ~CommandCenter()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value>>
BiometricEvaluation::Process::CommandCenter< T, typename >::~CommandCenter ( )
default

Destructor (default).

Member Function Documentation

◆ hasPendingCommands()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value>>
bool BiometricEvaluation::Process::CommandCenter< T, typename >::hasPendingCommands ( )
inline

Determine if there are commands waiting.

Returns
true if there are commands waiting, false otherwise.
Note
Returns immediately.
See also
BiometricEvaluation::Process::CommandCenter:: getNextCommand()

Definition at line 80 of file be_process_commandcenter.h.

◆ getNextCommand()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value>>
bool BiometricEvaluation::Process::CommandCenter< T, typename >::getNextCommand ( Command command,
int  numSeconds = -1,
std::string  invalidCommandResponse = "" 
)
inline

Get the next command.

Parameters
commandReference to a Command that will be populated when this method returns true.
numSecondsNumber of seconds to wait for a command, or -1 to block indefinitely.
invalidCommandResponseOptional string to send, such as usage, that will be sent when an unrecognized command is received.
Returns
true if command has been populated, false otherwise.

Definition at line 104 of file be_process_commandcenter.h.

◆ sendResponse()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value>>
void BiometricEvaluation::Process::CommandCenter< T, typename >::sendResponse ( uint32_t  clientID,
const std::string &  response,
const std::string  prefix = ">> ",
const std::string  suffix = "\n" 
)
inline

Send a string response to a client.

Parameters
clientIDID of client to communicate with.
responsePrintable string to send to client.
prefixString to prefix to responses.
suffixString to append to responses.

Definition at line 172 of file be_process_commandcenter.h.

◆ disconnectClient()

template<typename T , typename = typename std::enable_if<std::is_enum<T>::value>>
void BiometricEvaluation::Process::CommandCenter< T, typename >::disconnectClient ( uint32_t  clientID)
inline

Break the connection with a client.

Parameters
clientIDID of the client to disconect.

Definition at line 193 of file be_process_commandcenter.h.


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