signal_target_rpc.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  *
22  * Authors: Christoph Rösmann
23  *********************************************************************/
24 
25 #ifndef SRC_COMMUNICATION_INCLUDE_CORBO_COMMUNICATION_SIGNAL_TARGET_RPC_H_
26 #define SRC_COMMUNICATION_INCLUDE_CORBO_COMMUNICATION_SIGNAL_TARGET_RPC_H_
27 
28 #ifdef RPC_SUPPORT
29 
30 #include <corbo-communication/services/master_service.grpc.pb.h>
32 
33 #include <memory>
34 #include <string>
35 #include <vector>
36 
37 namespace corbo {
38 
55 class SignalTargetRPC : public SignalTargetInterface
56 {
57  public:
58  using Ptr = std::shared_ptr<SignalTargetRPC>;
59 
64  explicit SignalTargetRPC(grpc::ServerWriter<messages::Signal>* signal_writer) : _signal_writer(signal_writer) {}
65 
66  // implements interface method
67  void registerMeasurement(const std::string& unique_name, int value_dimension, const std::vector<std::string>& value_labels = {},
68  bool zero_order_hold = false) override;
69  // implements interface method
70  void registerTimeSeries(const std::string& unique_name, int value_dimension, bool zero_order_hold = false) override;
71 
72  // implements interface method
73  void sendMeasurement(Measurement::ConstPtr measurement) override;
74  // implements interface method
75  void sendTimeSeries(TimeSeriesSignal::Ptr time_series) override;
76 
77  // implements interface method
78  void sendIndexedValues(IndexedValuesSignal::Ptr indexed_values) override;
79 
80  // implements interface method
81  void sendIndexedValuesSet(IndexedValuesSetSignal::Ptr indexed_values_set) override;
82 
83  // implements interface method
84  void sendMatrix(MatrixSignal::Ptr matrix) override;
85 
86  private:
87  grpc::ServerWriter<messages::Signal>* _signal_writer;
88 };
89 
90 } // namespace corbo
91 
92 #endif // RPC_SUPPORT
93 
94 #endif // SRC_COMMUNICATION_INCLUDE_CORBO_COMMUNICATION_SIGNAL_TARGET_RPC_H_
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:102
std::shared_ptr< TimeSeriesSignal > Ptr
Definition: signals.h:247
std::shared_ptr< const Measurement > ConstPtr
Definition: signals.h:175
std::shared_ptr< MatrixSignal > Ptr
Definition: signals.h:542
std::shared_ptr< IndexedValuesSignal > Ptr
Definition: signals.h:393
std::shared_ptr< IndexedValuesSetSignal > Ptr
Definition: signals.h:477


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:07:18