Fast DDS  Version 3.6.1.0
Fast DDS
Requester.hpp
1 // Copyright 2025 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef FASTDDS_DDS_RPC__REQUESTER_HPP
16 #define FASTDDS_DDS_RPC__REQUESTER_HPP
17 
18 #include <fastdds/dds/core/LoanableSequence.hpp>
19 #include <fastdds/dds/rpc/RPCEntity.hpp>
20 #include <fastdds/dds/rpc/RequestInfo.hpp>
21 
22 namespace eprosima {
23 namespace fastdds {
24 namespace dds {
25 
26 class LoanableCollection;
27 class DataWriter;
28 class DataReader;
29 
30 } // namespace dds
31 
32 namespace dds {
33 namespace rpc {
34 
38 class Requester : public RPCEntity
39 {
40 
41 public:
42 
46  virtual const std::string& get_service_name() const = 0;
47 
59  void* data,
60  RequestInfo& info) = 0;
61 
70  void* data,
71  RequestInfo& info) = 0;
72 
82  LoanableCollection& data,
84 
96  LoanableCollection& data,
98 
102  virtual DataWriter* get_requester_writer() const = 0;
103 
107  virtual DataReader* get_requester_reader() const = 0;
108 
109 protected:
110 
114  ~Requester() = default;
115 
116 };
117 
118 } // namespace rpc
119 } // namespace dds
120 } // namespace fastdds
121 } // namespace eprosima
122 
123 #endif // FASTDDS_DDS_RPC__REQUESTER_HPP
Class DataReader, contains the actual implementation of the behaviour of the Subscriber.
Definition: DataReader.hpp:85
Class DataWriter, contains the actual implementation of the behaviour of the DataWriter.
Definition: DataWriter.hpp:68
A collection of generic opaque pointers that can receive the buffer from outside (loan).
Definition: LoanableCollection.hpp:34
A type-safe, ordered collection of elements that can receive the buffer from outside (loan).
Definition: LoanableSequence.hpp:63
Abstract base class for all RPC Objects.
Definition: RPCEntity.hpp:30
Base class for a Requester in the RPC communication.
Definition: Requester.hpp:39
virtual const std::string & get_service_name() const =0
Returns the name of the service to which the requester belongs.
virtual ReturnCode_t take_reply(void *data, RequestInfo &info)=0
Take a reply message from the Requester DataReader's history.
virtual DataReader * get_requester_reader() const =0
Getter for the Requester's DataReader.
virtual ReturnCode_t take_reply(LoanableCollection &data, LoanableSequence< RequestInfo > &info)=0
Take all reply messages stored in the Requester DataReader's history.
virtual ReturnCode_t return_loan(LoanableCollection &data, LoanableSequence< RequestInfo > &info)=0
This operation indicates to the Requester's DataReader that the application is done accessing the col...
virtual ReturnCode_t send_request(void *data, RequestInfo &info)=0
Send a request message.
virtual DataWriter * get_requester_writer() const =0
Getter for the Requester's DataWriter.
Definition: DomainParticipant.hpp:46
int32_t ReturnCode_t
Definition: DDSReturnCode.hpp:59
SampleInfo is the information that accompanies each sample that is ‘read’ or ‘taken.
Definition: SampleInfo.hpp:42