Safir SDK Core
Loading...
Searching...
No Matches
ResponseSender.h
Go to the documentation of this file.
1/******************************************************************************
2*
3* Copyright Saab AB, 2005-2013 (http://safirsdkcore.com)
4*
5* Created by: Joel Ottosson / stjoot
6*
7*******************************************************************************
8*
9* This file is part of Safir SDK Core.
10*
11* Safir SDK Core is free software: you can redistribute it and/or modify
12* it under the terms of version 3 of the GNU General Public License as
13* published by the Free Software Foundation.
14*
15* Safir SDK Core is distributed in the hope that it will be useful,
16* but WITHOUT ANY WARRANTY; without even the implied warranty of
17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18* GNU General Public License for more details.
19*
20* You should have received a copy of the GNU General Public License
21* along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22*
23******************************************************************************/
24#pragma once
25
27#include <memory>
28#include <Safir/Dob/Response.h>
29
30namespace Safir
31{
32namespace Dob
33{
46 {
47 public:
51 ResponseSender() = default;
52
53 // noncopyable
56
65 virtual ~ResponseSender() = default;
66
79 virtual void Send(const Safir::Dob::ResponsePtr & response) = 0;
80
87 virtual bool IsDone() = 0;
88
99 virtual void Discard() = 0;
100
101 };
102
103 //-------------------------------
104 // Smart pointer to ResponseSender
105 //-------------------------------
106 typedef std::shared_ptr<ResponseSender> ResponseSenderPtr;
107}
108}
#define DOSE_CPP_API
Definition DoseCppExportDefs.h:33
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
std::shared_ptr< Response > ResponsePtr
Definition Response.h:34
std::shared_ptr< ResponseSender > ResponseSenderPtr
Definition ResponseSender.h:106
Class used for responding to received requests.
Definition ResponseSender.h:46
ResponseSender()=default
Default constructor.
virtual bool IsDone()=0
Check if an instance is still waiting for a response to be sent.
virtual void Send(const Safir::Dob::ResponsePtr &response)=0
Sends a response for the request that this instance was obtained with.
ResponseSender(const ResponseSender &)=delete
ResponseSender & operator=(const ResponseSender &)=delete
virtual void Discard()=0
Discard this ResponseSender.
virtual ~ResponseSender()=default
Destructor.