Skip to content

Namespace reeflogic::reef_server_common::command_envelope C++ API Reference

Headers at a Glance

Header Classes Functions Macros
reef_server_common/command_envelope.h 0 9 0

Header reef_server_common/command_envelope.h

Shared command-envelope templates used by admin and survey command handlers.

Header-only templates that abstract the RequestT/ReplyT/KindEnumT shape common to AdminExecuteRequest/Reply and RuntimeExecuteRequest/Reply: AuthorizationPolicy resolution from reeflogic.cmd.v1 enum option extensions (permission_label, permission_mask), the (std::invalid_argument | pqxx::failure | commons::ReefLogicRuntimeError) try/catch wrapper inside HandleCommandRequest, the DispatchWithKindCheck kind/oneof alignment guard, and the SetOkStatus / SetInvalidArgument / SetAlreadyExists / SetUnimplemented / SetInternal reply-envelope helpers that all echo request.request_id() and write into a google.rpc.Status.

command-handler translation unit; the matching definitions live in command_envelope.tcc.

Note: Each concrete server instantiates the templates once in its own

See also: server_survey/command_handler.h, reef_server_common/runtime_support.h

Functions

Signature Description Referenced Types
[[nodiscard]] inline std::optional<grpc::Status> ResolveCommandAuthorizationPolicy( KindEnumT kind, KindEnumT unspecified_value, AuthorizationPolicy *policy, std::string_view kind_label ); - -
[[nodiscard]] inline ReplyT *HandleCommandRequest( const RequestT &request, ReplyT *response, const Dispatcher &dispatch ); - -
[[nodiscard]] inline ReplyT *SetResponseStatus( const RequestT &request, ReplyT *response, grpc::StatusCode code, std::string_view message ); - -
[[nodiscard]] inline ReplyT *SetOkStatus( const RequestT &request, ReplyT *response ); - -
[[nodiscard]] inline ReplyT *SetInvalidArgument( const RequestT &request, ReplyT *response, std::string_view message ); - -
[[nodiscard]] inline ReplyT *SetAlreadyExists( const RequestT &request, ReplyT *response, std::string_view message ); - -
[[nodiscard]] inline ReplyT *SetUnimplemented( const RequestT &request, ReplyT *response, std::string_view message ); - -
[[nodiscard]] inline ReplyT *SetInternal( const RequestT &request, ReplyT *response, std::string_view message ); - -
[[nodiscard]] inline ReplyT *DispatchWithKindCheck( const RequestT &request, ReplyT *response, KindT expected_kind, std::string_view payload_name, const SuccessHandler &handler ); - -