Philote-Cpp
C++ bindings for the Philote MDO standard
Loading...
Searching...
No Matches
discipline_server.h
Go to the documentation of this file.
1/*
2 Philote C++ Bindings
3
4 Copyright 2022-2025 Christopher A. Lupp
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 This work has been cleared for public release, distribution unlimited, case
19 number: AFRL-2023-5716.
20
21 The views expressed are those of the authors and do not reflect the
22 official guidance or position of the United States Government, the
23 Department of Defense or of the United States Air Force.
24
25 Statement from DoD: The Appearance of external hyperlinks does not
26 constitute endorsement by the United States Department of Defense (DoD) of
27 the linked websites, of the information, products, or services contained
28 therein. The DoD does not exercise any editorial, security, or other
29 control over the information you may find at these locations.
30*/
31#pragma once
32
33#include <google/protobuf/empty.pb.h>
34#include <grpcpp/impl/codegen/status.h>
35#include <grpcpp/impl/codegen/status_code_enum.h>
36#include <grpcpp/server_context.h>
37#include <grpcpp/support/status.h>
38
39#include <disciplines.grpc.pb.h>
40#include "discipline.h"
41
42namespace philote
43{
44 // forward declaration
45 class Discipline;
46
56 class DisciplineServer : public DisciplineService::Service
57 {
58 public:
63 DisciplineServer() = default;
64
70 ~DisciplineServer() noexcept override;
71
77 bool DisciplinePointerNull() noexcept;
78
84 void LinkPointers(std::shared_ptr<philote::Discipline> discipline);
85
90
99 grpc::Status GetInfo(grpc::ServerContext *context,
100 const google::protobuf::Empty *request,
101 ::philote::DisciplineProperties *response) override;
102
111 grpc::Status SetStreamOptions(grpc::ServerContext *context,
112 const ::philote::StreamOptions *request,
113 google::protobuf::Empty *response) override;
114
123 grpc::Status SetOptions(grpc::ServerContext *context,
124 const ::philote::DisciplineOptions *request,
125 google::protobuf::Empty *response) override;
126
127 ::grpc::Status GetAvailableOptions(::grpc::ServerContext *context,
128 const ::google::protobuf::Empty *request,
129 ::philote::OptionsList *response) override;
130
139 grpc::Status GetVariableDefinitions(grpc::ServerContext *context,
140 const google::protobuf::Empty *request,
141 grpc::ServerWriter<::philote::VariableMetaData> *writer) override;
142
151 grpc::Status GetPartialDefinitions(grpc::ServerContext *context,
152 const google::protobuf::Empty *request,
153 grpc::ServerWriter<::philote::PartialsMetaData> *writer) override;
154
163 grpc::Status Setup(grpc::ServerContext *context,
164 const google::protobuf::Empty *request,
165 google::protobuf::Empty *response) override;
166
167 private:
169 std::shared_ptr<philote::Discipline> discipline_;
170 };
171} // namespace philote
Base class for all analysis discipline servers.
Definition discipline_server.h:57
grpc::Status GetPartialDefinitions(grpc::ServerContext *context, const google::protobuf::Empty *request, grpc::ServerWriter<::philote::PartialsMetaData > *writer) override
RPC to define the discipline partials on the client side.
void UnlinkPointers()
Unlinks all pointers.
bool DisciplinePointerNull() noexcept
Checks if the Discipline pointer is null.
void LinkPointers(std::shared_ptr< philote::Discipline > discipline)
Links all pointers needed by the discipline base class.
grpc::Status SetOptions(grpc::ServerContext *context, const ::philote::DisciplineOptions *request, google::protobuf::Empty *response) override
Set the discipline options.
DisciplineServer()=default
Construct a new Discipline Server object.
::grpc::Status GetAvailableOptions(::grpc::ServerContext *context, const ::google::protobuf::Empty *request, ::philote::OptionsList *response) override
grpc::Status SetStreamOptions(grpc::ServerContext *context, const ::philote::StreamOptions *request, google::protobuf::Empty *response) override
RPC to define the discipline stream options to the client.
grpc::Status Setup(grpc::ServerContext *context, const google::protobuf::Empty *request, google::protobuf::Empty *response) override
RPC that invokes the discipline setup function.
grpc::Status GetVariableDefinitions(grpc::ServerContext *context, const google::protobuf::Empty *request, grpc::ServerWriter<::philote::VariableMetaData > *writer) override
RPC to define the discipline variables on the client side.
grpc::Status GetInfo(grpc::ServerContext *context, const google::protobuf::Empty *request, ::philote::DisciplineProperties *response) override
RPC to send the discipline properties to the client.
~DisciplineServer() noexcept override
Destroy the Discipline Server object.
Definition of the discipline base class.
Definition discipline.h:62
Definition discipline.h:43