25 virtual void Create(JSONObject &) = 0;
45 virtual void Create(JSONObject &)
override;
86 virtual void Create(JSONObject &)
override;
89 const std::vector<std::string> &m_names;
Provide the names of the RF cavities.
Definition: response.h:82
virtual void Create(JSONObject &) override
Add the cavity names as a JSON array value tagged as "cavities".
Definition: response.cpp:96
CavityNameResponse(const std::vector< std::string > &names)
Construct an instance.
Definition: response.cpp:87
An "error" response with a text diagnostic.
Definition: response.h:70
Failure(const char *)
An error response with a diagnostic using the JSON tag "message".
Definition: response.cpp:77
Abstract base for all responses.
Definition: response.h:16
JsonResponse(Response_t type)
Construct with the outcome enumeration.
Definition: response.h:20
Response_t
Status of processed request.
Definition: response.h:18
virtual void Create(JSONObject &)=0
Create the JSON encoded response.
std::string operator()(void)
Get the JSON encoded response string.
Definition: response.cpp:13
An "ok" response.
Definition: response.h:52
Success(void)
A successful outcome with no additional message.
Definition: response.cpp:60
Response with an optional text message.
Definition: response.h:37
TextResponse(Response_t, const char *=0, const char *=0)
Construct an instance.
Definition: response.cpp:41
virtual void Create(JSONObject &) override
Add the optional text message if one was provided.
Definition: response.cpp:52
An "warning" response with a text diagnostic.
Definition: response.h:61
Warning(const char *)
A warning response with a diagnostic using the JSON tag "message".
Definition: response.cpp:68