pianod2
multisource multiuser scriptable networked music player
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
PandoraCommands Class Reference

Interpreter for tonegenerator commands. More...

#include <pandoracommand.h>

Inheritance diagram for PandoraCommands:
Inheritance graph
[legend]
Collaboration diagram for PandoraCommands:
Collaboration graph
[legend]

Public Member Functions

virtual const Parsnip::Parser::DefinitionsgetParserDefinitions () override
 Retrieve the parser definitions handled by the interpreter. More...
 
- Public Member Functions inherited from PianodInterpreter
virtual void registerInterpreter (PianodDispatcher &dispatcher)
 Register the interpreter with a dispatcher. More...
 
const HelpList getHelp (const std::vector< std::string > &search, std::set< std::string > *option_parsers)
 Search the interpreter's definitions for any definitions matching search criteria. More...
 

Static Public Member Functions

static const Parsnip::Parser::Definitionsparser_definitions ()
 
static const PianodSchema::CommandIdsjson_request_names ()
 Retrieve names for our JSON requests. More...
 
- Static Public Member Functions inherited from PianodInterpreter
static bool optionIs (const Parsnip::Data &options, const char *name, const char *expected)
 Check if a string value exists and is case-blind equal to a particular value. More...
 
template<typename ValueType , typename LookupType >
static ValueType optionalValue (const Parsnip::Data &options, const char *name, const LookupType &lookup, const ValueType default_value)
 Retrieve the ID of a string value. More...
 

Private Member Functions

virtual bool authorizedCommand (Parsnip::Parser::CommandId, PianodConnection &conn) override
 Check whether a command is authorized. More...
 
virtual ResponseCollector handleCommand (Parsnip::Parser::CommandId, const Parsnip::Data &options, PianodConnection &conn) override
 Command handler. More...
 

Additional Inherited Members

- Public Types inherited from PianodInterpreter
using HelpList = PianodDispatcher::HelpList
 
- Protected Types inherited from PianodInterpreter
using StringVector = std::vector< std::string >
 
- Static Protected Attributes inherited from PianodInterpreter
static const Parsnip::Data EmptyDictionary {Parsnip::Data::Dictionary}
 An empty dictionary, often used as a default with Parsnip::Data::getOr. More...
 
static const StringVector EmptyStringVector
 An empty string vector, often used as a default with Parsnip::Data::getOr. More...
 

Detailed Description

Interpreter for tonegenerator commands.

Member Function Documentation

◆ authorizedCommand()

bool PandoraCommands::authorizedCommand ( Parsnip::Parser::CommandId  command_id,
PianodConnection context 
)
overrideprivatevirtual

Check whether a command is authorized.

Parameters
command_idThe command requesting execution.
contextConnection details, including authentication state and privileges.
Returns
True if allowed, false otherwise.

Implements PianodInterpreter.

Here is the call graph for this function:

◆ getParserDefinitions()

const Parsnip::Parser::Definitions & PandoraCommands::getParserDefinitions ( )
overridevirtual

Retrieve the parser definitions handled by the interpreter.

Returns
Parser definitions.

Implements PianodInterpreter.

Here is the call graph for this function:

◆ handleCommand()

ResponseCollector PandoraCommands::handleCommand ( Parsnip::Parser::CommandId  command_id,
const Parsnip::Data parameters,
PianodConnection context 
)
overrideprivatevirtual

Command handler.

Parameters
command_idCommand to execute.
parametersCommand parameters.
contextConnection details, including authentication state and privileges.
Returns
Data or success/failure indications.
Exceptions
CommandErroror other exception if an error occurs.

Implements PianodInterpreter.

Here is the call graph for this function:

◆ json_request_names()

const PianodSchema::CommandIds & PandoraCommands::json_request_names ( )
static

Retrieve names for our JSON requests.

Returns
Request name to command ID mappings.
Here is the caller graph for this function:

◆ parser_definitions()

const Parsnip::Parser::Definitions & PandoraCommands::parser_definitions ( void  )
static
Here is the caller graph for this function:

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