Safir SDK Core
Loading...
Searching...
No Matches
Consumer.h
Go to the documentation of this file.
1/******************************************************************************
2*
3* Copyright Saab AB, 2006-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
25#ifndef _SAFIR_DOB_CONSUMER_H
26#define _SAFIR_DOB_CONSUMER_H
27
29#include <Safir/Dob/Defs.h>
31#include <Safir/Dob/Entity.h>
34#include <Safir/Dob/Message.h>
36#include <Safir/Dob/Response.h>
39#include <Safir/Dob/Service.h>
44
45namespace Safir
46{
47namespace Dob
48{
49
54 public virtual Internal::ConsumerBase
55 {
56 public:
58 virtual ~StopHandler() {}
59
63 virtual void OnStopOrder() = 0;
64
65 private:
66 StopHandler * ToStopHandler() override {return this;}
67 };
68
73 public virtual Internal::ConsumerBase
74 {
75 public:
77 virtual ~Dispatcher() {}
78
88 virtual void OnDoDispatch() = 0;
89
90 private:
91 Dispatcher * ToDispatcher() override {return this;}
92 };
93
113 : public virtual RevokedRegistrationBase,
114 public virtual EntityRequestBase
115 {
116
117 private:
118 EntityHandler * ToEntityHandler() override {return this;}
119 };
120
153 : public virtual RevokedRegistrationBase,
154 public virtual EntityInjectionBase
155 {
156
157 private:
158 EntityHandlerInjection * ToEntityHandlerInjection() override {return this;}
159 };
160
195 : public virtual CompletedRegistrationBase,
196 public virtual EntityInjectionBase
197 {
198
199 private:
200 EntityHandlerPending * ToEntityHandlerPending() override {return this;}
201 };
202
216 : public virtual RevokedRegistrationBase,
217 public virtual ServiceRequestBase
218 {
219
220 private:
221 ServiceHandler * ToServiceHandler() override {return this;}
222 };
223
240 : public virtual CompletedRegistrationBase,
241 public virtual ServiceRequestBase
242 {
243
244 private:
245 ServiceHandlerPending * ToServiceHandlerPending() override {return this;}
246 };
247
253 public virtual Internal::ConsumerBase
254 {
255 public:
257 virtual ~Requestor() {}
258
264 virtual void OnResponse(const Safir::Dob::ResponseProxy responseProxy) = 0;
265
269 virtual void OnNotRequestOverflow() = 0;
270
271 private:
272 Requestor * ToRequestor() override {return this;}
273 };
274
279 public virtual Internal::ConsumerBase
280 {
281 public:
283 virtual ~MessageSender() {}
284
288 virtual void OnNotMessageOverflow() = 0;
289
290 private:
291 MessageSender * ToMessageSender() override {return this;}
292 };
293
298 public virtual Internal::ConsumerBase
299 {
300 public:
303
311 const Safir::Dob::Typesystem::HandlerId& handlerId) = 0;
312
320 const Safir::Dob::Typesystem::HandlerId& handlerId) = 0;
321
322 private:
323 RegistrationSubscriber * ToRegistrationSubscriber() override {return this;}
324 };
325
330 public virtual Internal::ConsumerBase
331 {
332 public:
335
341 virtual void OnMessage(const Safir::Dob::MessageProxy messageProxy) = 0;
342
343 private:
344 MessageSubscriber * ToMessageSubscriber() override {return this;}
345 };
346
351 public virtual Internal::ConsumerBase
352 {
353 public:
355 virtual ~EntitySubscriber() {}
356
362 virtual void OnNewEntity(const Safir::Dob::EntityProxy entityProxy) = 0;
363
375 virtual void OnUpdatedEntity(const Safir::Dob::EntityProxy entityProxy) = 0;
376
383 virtual void OnDeletedEntity(const Safir::Dob::EntityProxy entityProxy,
384 const bool deprecated) = 0;
385
386 private:
387 EntitySubscriber * ToEntitySubscriber() override {return this;}
388 };
389
390}
391}
392
393
394#endif
#define DOSE_CPP_API
Definition DoseCppExportDefs.h:33
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
DotsC_TypeId TypeId
A unique type identifier.
Definition Defs.h:218
Interface for reception of a stop order.
Definition Consumer.h:55
virtual ~StopHandler()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:58
virtual void OnStopOrder()=0
When called the application owning the connection shall stop its execution.
Interface for reception of a dispatch order.
Definition Consumer.h:74
virtual ~Dispatcher()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:77
virtual void OnDoDispatch()=0
Indicates that there is incoming data for the connection so the application shall call Dispatch().
Interface to be implemented by an entity handler that makes a non-pending registration and that doesn...
Definition Consumer.h:115
Interface to be implemented by an entity handler that makes a non-pending registration for a type tha...
Definition Consumer.h:155
Interface to be implemented by an entity handler that makes a pending registration.
Definition Consumer.h:197
Interface to be implemented by a service handler that makes a non-pending registration.
Definition Consumer.h:218
Interface to be implemented by a service handler that makes a pending registration.
Definition Consumer.h:242
Interface to be implemented by an application that sends requests (Request on entities or service req...
Definition Consumer.h:254
virtual void OnNotRequestOverflow()=0
Called to indicate that it is meningful to make a retry after an overflow situation.
virtual ~Requestor()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:257
virtual void OnResponse(const Safir::Dob::ResponseProxy responseProxy)=0
Called when a response is received on a sent request.
Interface to be implemented by senders of messages.
Definition Consumer.h:280
virtual void OnNotMessageOverflow()=0
Called to indicate that it is meningful to make a retry after an overflow situation.
virtual ~MessageSender()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:283
Interface to be implemented by subscribers of handler registrations.
Definition Consumer.h:299
virtual void OnRegistered(const Safir::Dob::Typesystem::TypeId typeId, const Safir::Dob::Typesystem::HandlerId &handlerId)=0
Called when a handler for an entity or service has been registered.
virtual void OnUnregistered(const Safir::Dob::Typesystem::TypeId typeId, const Safir::Dob::Typesystem::HandlerId &handlerId)=0
Called when a handler for an entity or service has been unregistered.
virtual ~RegistrationSubscriber()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:302
Interface to be implemented by subscribers of messages.
Definition Consumer.h:331
virtual void OnMessage(const Safir::Dob::MessageProxy messageProxy)=0
Called when a message is received.
virtual ~MessageSubscriber()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:334
Interface to be implemented by subscribers of entities.
Definition Consumer.h:352
virtual void OnDeletedEntity(const Safir::Dob::EntityProxy entityProxy, const bool deprecated)=0
Called when an entity is deleted.
virtual ~EntitySubscriber()
Virtual destructor is needed since we have virtual member functions.
Definition Consumer.h:355
virtual void OnNewEntity(const Safir::Dob::EntityProxy entityProxy)=0
Called when a new entity is available.
virtual void OnUpdatedEntity(const Safir::Dob::EntityProxy entityProxy)=0
Called when an entity is updated.
Base class used when composing more elaborated interfaces.
Definition ConsumerBase.h:87
Base class used when composing more elaborated interfaces.
Definition ConsumerBase.h:209
Base class used when composing more elaborated interfaces.
Definition ConsumerBase.h:233
Interface to receive entity requests.
Definition ConsumerBase.h:255
This Consumer Base class contains callback methods that can be overridden by an entity handler that r...
Definition ConsumerBase.h:347
Interface to receive service requests.
Definition ConsumerBase.h:418
Proxy class for an entity.
Definition EntityProxy.h:54
Proxy class for a message.
Definition MessageProxy.h:59
Proxy class for a response.
Definition ResponseProxy.h:53
Class containing the identity of a handler.
Definition HandlerId.h:46