NIST Biometric Evaluation Framework
Software components for biometric technology evaluations
Public Member Functions | List of all members
BiometricEvaluation::Process::CommandParser< T > Class Template Referenceabstract

Abstraction to parse messages received via CommandCenter. More...

#include <be_process_commandcenter.h>

Inherits BiometricEvaluation::Process::CommandCenter< T, typename >.

Public Member Functions

virtual void parse (const typename CommandCenter< T >::Command &command)=0
 Parse command. More...
 
bool getNextCommand (typename CommandCenter< T >::Command &command, int numSeconds=-1)
 Get the next command. More...
 
void setUsage (const std::string &usage)
 String sent when an invalid command is received. More...
 
std::string getUsage () const
 
 CommandParser (uint16_t port=MessageCenter::DEFAULT_PORT)
 Constructor. More...
 
virtual ~CommandParser ()=default
 Virtual destructor (default). More...
 
- Public Member Functions inherited from BiometricEvaluation::Process::CommandCenter< T, typename >
 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>
class BiometricEvaluation::Process::CommandParser< T >

Abstraction to parse messages received via CommandCenter.

Definition at line 207 of file be_process_commandcenter.h.

Constructor & Destructor Documentation

◆ CommandParser()

template<typename T >
BiometricEvaluation::Process::CommandParser< T >::CommandParser ( uint16_t  port = MessageCenter::DEFAULT_PORT)
inline

Constructor.

Parameters
portPort to listen on for commands.

Definition at line 277 of file be_process_commandcenter.h.

◆ ~CommandParser()

template<typename T >
virtual BiometricEvaluation::Process::CommandParser< T >::~CommandParser ( )
virtualdefault

Virtual destructor (default).

Member Function Documentation

◆ parse()

template<typename T >
virtual void BiometricEvaluation::Process::CommandParser< T >::parse ( const typename CommandCenter< T >::Command &  command)
pure virtual

Parse command.

Implement this method as a switch statement of your command enumeration.

◆ getNextCommand()

template<typename T >
bool BiometricEvaluation::Process::CommandParser< T >::getNextCommand ( typename CommandCenter< T >::Command &  command,
int  numSeconds = -1 
)
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.
Returns
true if command has been populated, false otherwise.

Definition at line 237 of file be_process_commandcenter.h.

◆ setUsage()

template<typename T >
void BiometricEvaluation::Process::CommandParser< T >::setUsage ( const std::string &  usage)
inline

String sent when an invalid command is received.

Parameters
usageString to send when an invalid command is received.
Note
If not set, no additional usage is sent.

Definition at line 256 of file be_process_commandcenter.h.

◆ getUsage()

template<typename T >
std::string BiometricEvaluation::Process::CommandParser< T >::getUsage ( ) const
inline
Returns
Usage string.

Definition at line 264 of file be_process_commandcenter.h.


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