Safir SDK Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Consumer.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2006-2013 (http://safir.sourceforge.net)
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 
28 #include <Safir/Dob/ConsumerBase.h>
29 #include <Safir/Dob/Defs.h>
31 #include <Safir/Dob/Entity.h>
32 #include <Safir/Dob/EntityProxy.h>
34 #include <Safir/Dob/Message.h>
35 #include <Safir/Dob/MessageProxy.h>
36 #include <Safir/Dob/Response.h>
39 #include <Safir/Dob/Service.h>
44 
45 namespace Safir
46 {
47 namespace Dob
48 {
49 
54  public virtual Internal::ConsumerBase
55  {
56  public:
58  virtual ~StopHandler() {}
59 
63  virtual void OnStopOrder() = 0;
64 
65  private:
66  virtual StopHandler * ToStopHandler() {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  virtual Dispatcher * ToDispatcher() {return this;}
92  };
93 
113  : public virtual RevokedRegistrationBase,
114  public virtual EntityRequestBase
115  {
116 
117  private:
118  virtual EntityHandler * ToEntityHandler() {return this;}
119  };
120 
153  : public virtual RevokedRegistrationBase,
154  public virtual EntityInjectionBase
155  {
156 
157  private:
158  virtual EntityHandlerInjection * ToEntityHandlerInjection() {return this;}
159  };
160 
195  : public virtual CompletedRegistrationBase,
196  public virtual EntityInjectionBase
197  {
198 
199  private:
200  virtual EntityHandlerPending * ToEntityHandlerPending() {return this;}
201  };
202 
216  : public virtual RevokedRegistrationBase,
217  public virtual ServiceRequestBase
218  {
219 
220  private:
221  virtual ServiceHandler * ToServiceHandler() {return this;}
222  };
223 
240  : public virtual CompletedRegistrationBase,
241  public virtual ServiceRequestBase
242  {
243 
244  private:
245  virtual ServiceHandlerPending * ToServiceHandlerPending() {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  virtual Requestor * ToRequestor() {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  virtual MessageSender * ToMessageSender() {return this;}
292  };
293 
298  public virtual Internal::ConsumerBase
299  {
300  public:
303 
310  virtual void OnRegistered(const Safir::Dob::Typesystem::TypeId typeId,
311  const Safir::Dob::Typesystem::HandlerId& handlerId) = 0;
312 
319  virtual void OnUnregistered(const Safir::Dob::Typesystem::TypeId typeId,
320  const Safir::Dob::Typesystem::HandlerId& handlerId) = 0;
321 
322  private:
323  virtual RegistrationSubscriber * ToRegistrationSubscriber() {return this;}
324  };
325 
330  public virtual Internal::ConsumerBase
331  {
332  public:
334  virtual ~MessageSubscriber() {}
335 
341  virtual void OnMessage(const Safir::Dob::MessageProxy messageProxy) = 0;
342 
343  private:
344  virtual MessageSubscriber * ToMessageSubscriber() {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  virtual EntitySubscriber * ToEntitySubscriber() {return this;}
388  };
389 
390 }
391 }
392 
393 
394 #endif
Interface to be implemented by subscribers of messages.
Definition: Consumer.h:329
Interface to be implemented by subscribers of handler registrations.
Definition: Consumer.h:297
Interface to be implemented by senders of messages.
Definition: Consumer.h:278
Interface for reception of a dispatch order.
Definition: Consumer.h:72
Class containing the identity of a handler.
Definition: HandlerId.h:44
virtual ~MessageSender()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:283
virtual ~StopHandler()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:58
Base class used when composing more elaborated interfaces.
Definition: ConsumerBase.h:230
Interface to be implemented by an application that sends requests (Request on entities or service req...
Definition: Consumer.h:252
Interface to be implemented by subscribers of entities.
Definition: Consumer.h:350
DotsC_TypeId TypeId
A unique type identifier.
Definition: Defs.h:219
Interface to be implemented by an entity handler that makes a pending registration.
Definition: Consumer.h:194
virtual ~RegistrationSubscriber()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:302
virtual ~Dispatcher()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:77
Base class used when composing more elaborated interfaces.
Definition: ConsumerBase.h:84
virtual ~MessageSubscriber()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:334
virtual ~EntitySubscriber()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:355
virtual ~Requestor()
Virtual destructor is needed since we have virtual member functions.
Definition: Consumer.h:257
Proxy class for a response.
Definition: ResponseProxy.h:52
Interface to be implemented by an entity handler that makes a non-pending registration for a type tha...
Definition: Consumer.h:152
This Consumer Base class contains callback methods that can be overridden by an entity handler that r...
Definition: ConsumerBase.h:344
#define DOSE_CPP_API
Definition: DoseCppExportDefs.h:33
Interface to be implemented by a service handler that makes a non-pending registration.
Definition: Consumer.h:215
Interface to receive entity requests.
Definition: ConsumerBase.h:251
Interface to be implemented by an entity handler that makes a non-pending registration and that doesn...
Definition: Consumer.h:112
Interface to be implemented by a service handler that makes a pending registration.
Definition: Consumer.h:239
Base class used when composing more elaborated interfaces.
Definition: ConsumerBase.h:205
Proxy class for a message.
Definition: MessageProxy.h:59
Proxy class for an entity.
Definition: EntityProxy.h:53
Interface for reception of a stop order.
Definition: Consumer.h:53
Interface to receive service requests.
Definition: ConsumerBase.h:405