25 #ifndef _SAFIR_DOB_CONSUMER_BASE_H
26 #define _SAFIR_DOB_CONSUMER_BASE_H
43 #pragma warning (disable: 4250)
51 class RevokedRegistrationBase;
52 class CompletedRegistrationBase;
53 class EntityRequestBase;
54 class EntityInjectionBase;
55 class ServiceRequestBase;
59 class EntityHandlerInjection;
60 class EntityHandlerPending;
62 class ServiceHandlerPending;
65 class RegistrationSubscriber;
66 class MessageSubscriber;
67 class EntitySubscriber;
88 friend class Safir::Dob::Internal::Callbacks;
92 (L
"Call to ConsumerBase::ToRevokedRegistrationBase is illegal. Method must be overridden!",
96 (L
"Call to ConsumerBase::ToCompletedRegistrationBase is illegal. Method must be overridden!",
100 (L
"Call to ConsumerBase::ToEntityRequestBase is illegal. Method must be overridden!",
102 virtual EntityInjectionBase * ToEntityInjectionBase()
104 (L
"Call to ConsumerBase::ToEntityInjectionBase is illegal. Method must be overridden!",
106 virtual ServiceRequestBase * ToServiceRequestBase()
107 {
throw Dob::Typesystem::SoftwareViolationException
108 (L
"Call to ConsumerBase::ToServiceRequestBase is illegal. Method must be overridden!",
110 virtual StopHandler * ToStopHandler()
111 {
throw Dob::Typesystem::SoftwareViolationException
112 (L
"Call to ConsumerBase::ToStopHandler is illegal. Method must be overridden!",
114 virtual Dispatcher * ToDispatcher()
115 {
throw Dob::Typesystem::SoftwareViolationException
116 (L
"Call to ConsumerBase::ToDispatcher is illegal. Method must be overridden!",
118 virtual EntityHandler * ToEntityHandler()
119 {
throw Dob::Typesystem::SoftwareViolationException
120 (L
"Call to ConsumerBase::ToEntityHandler is illegal. Method must be overridden!",
122 virtual EntityHandlerInjection * ToEntityHandlerInjection()
123 {
throw Dob::Typesystem::SoftwareViolationException
124 (L
"Call to ConsumerBase::ToEntityHandlerInjection is illegal. Method must be overridden!",
126 virtual EntityHandlerPending * ToEntityHandlerPending()
127 {
throw Dob::Typesystem::SoftwareViolationException
128 (L
"Call to ConsumerBase::ToEntityHandlerPending is illegal. Method must be overridden!",
130 virtual ServiceHandler * ToServiceHandler()
131 {
throw Dob::Typesystem::SoftwareViolationException
132 (L
"Call to ConsumerBase::ToServiceHandler is illegal. Method must be overridden!",
134 virtual ServiceHandlerPending * ToServiceHandlerPending()
135 {
throw Dob::Typesystem::SoftwareViolationException
136 (L
"Call to ConsumerBase::ToServiceHandlerPending is illegal. Method must be overridden!",
138 virtual Requestor * ToRequestor()
139 {
throw Dob::Typesystem::SoftwareViolationException
140 (L
"Call to ConsumerBase::ToRequestor is illegal. Method must be overridden!",
142 virtual MessageSender * ToMessageSender()
143 {
throw Dob::Typesystem::SoftwareViolationException
144 (L
"Call to ConsumerBase::ToMessageSender is illegal. Method must be overridden!",
146 virtual RegistrationSubscriber * ToRegistrationSubscriber()
147 {
throw Dob::Typesystem::SoftwareViolationException
148 (L
"Call to ConsumerBase::ToRegistrationSubscriber is illegal. Method must be overridden!",
150 virtual MessageSubscriber * ToMessageSubscriber()
151 {
throw Dob::Typesystem::SoftwareViolationException
152 (L
"Call to ConsumerBase::ToMessageSubscriber is illegal. Method must be overridden!",
154 virtual EntitySubscriber * ToEntitySubscriber()
155 {
throw Dob::Typesystem::SoftwareViolationException
156 (L
"Call to ConsumerBase::ToEntitySubscriber is illegal. Method must be overridden!",
161 static RevokedRegistrationBase * ToRevokedRegistrationBase(
void * consumerBase)
162 {
return static_cast<ConsumerBase*
>(consumerBase)->ToRevokedRegistrationBase();}
163 static CompletedRegistrationBase * ToCompletedRegistrationBase(
void * consumerBase)
164 {
return static_cast<ConsumerBase*
>(consumerBase)->ToCompletedRegistrationBase();}
165 static EntityRequestBase * ToEntityRequestBase(
void * consumerBase)
166 {
return static_cast<ConsumerBase*
>(consumerBase)->ToEntityRequestBase();}
167 static EntityInjectionBase * ToEntityInjectionBase(
void * consumerBase)
168 {
return static_cast<ConsumerBase*
>(consumerBase)->ToEntityInjectionBase();}
169 static ServiceRequestBase * ToServiceRequestBase(
void * consumerBase)
170 {
return static_cast<ConsumerBase*
>(consumerBase)->ToServiceRequestBase();}
171 static StopHandler * ToStopHandler(
void * consumerBase)
172 {
return static_cast<ConsumerBase*
>(consumerBase)->ToStopHandler();}
173 static Dispatcher * ToDispatcher(
void * consumerBase)
174 {
return static_cast<ConsumerBase*
>(consumerBase)->ToDispatcher();}
175 static EntityHandler * ToEntityHandler(
void * consumerBase)
176 {
return static_cast<ConsumerBase*
>(consumerBase)->ToEntityHandler();}
177 static EntityHandlerInjection * ToEntityHandlerInjection(
void * consumerBase)
178 {
return static_cast<ConsumerBase*
>(consumerBase)->ToEntityHandlerInjection();}
179 static EntityHandlerPending * ToEntityHandlerPending(
void * consumerBase)
180 {
return static_cast<ConsumerBase*
>(consumerBase)->ToEntityHandlerPending();}
181 static ServiceHandler * ToServiceHandler(
void * consumerBase)
182 {
return static_cast<ConsumerBase*
>(consumerBase)->ToServiceHandler();}
183 static ServiceHandlerPending * ToServiceHandlerPending(
void * consumerBase)
184 {
return static_cast<ConsumerBase*
>(consumerBase)->ToServiceHandlerPending();}
185 static Requestor * ToRequestor(
void * consumerBase)
186 {
return static_cast<ConsumerBase*
>(consumerBase)->ToRequestor();}
187 static MessageSender * ToMessageSender(
void * consumerBase)
188 {
return static_cast<ConsumerBase*
>(consumerBase)->ToMessageSender();}
189 static RegistrationSubscriber * ToRegistrationSubscriber(
void * consumerBase)
190 {
return static_cast<ConsumerBase*
>(consumerBase)->ToRegistrationSubscriber();}
191 static MessageSubscriber * ToMessageSubscriber(
void * consumerBase)
192 {
return static_cast<ConsumerBase*
>(consumerBase)->ToMessageSubscriber();}
193 static EntitySubscriber * ToEntitySubscriber(
void * consumerBase)
194 {
return static_cast<ConsumerBase*
>(consumerBase)->ToEntitySubscriber();}
boost::shared_ptr< ResponseSender > ResponseSenderPtr
Definition: ResponseSender.h:107
Class containing the identity of a handler.
Definition: HandlerId.h:45
Proxy class for a service request.
Definition: ServiceRequestProxy.h:52
virtual ~ServiceRequestBase()
Virtual destructor is needed since we have virtual member functions.
Definition: ConsumerBase.h:398
Base class used when composing more elaborated interfaces.
Definition: ConsumerBase.h:224
virtual void OnInjectedUpdatedEntity(const Safir::Dob::InjectedEntityProxy injectedEntityProxy)
Called when an updated entity is about to be injected in the system.
Definition: ConsumerBase.h:351
Meant to be used when something goes very wrong.
Definition: Exceptions.h:360
virtual ~ConsumerBase()
Definition: ConsumerBase.h:85
DotsC_TypeId TypeId
A unique type identifier.
Definition: Dob/Typesystem/Defs.h:221
Proxy class for an entity request.
Definition: EntityRequestProxy.h:53
virtual void OnInitialInjectionsDone(const Safir::Dob::Typesystem::TypeId typeId, const Dob::Typesystem::HandlerId &handlerId)
Indicates that all initial injection data has been transfered to the handler.
Definition: ConsumerBase.h:377
Base class used when composing more elaborated interfaces.
Definition: ConsumerBase.h:82
#define __WFILE__
Definition: Exceptions.h:31
Proxy class for entity injections.
Definition: InjectedEntityProxy.h:52
virtual ~EntityRequestBase()
Virtual destructor is needed since we have virtual member functions.
Definition: ConsumerBase.h:248
virtual ~RevokedRegistrationBase()
Virtual destructor is needed since we have virtual member functions.
Definition: ConsumerBase.h:206
This Consumer Base class contains callback methods that can be overridden by an entity handler that r...
Definition: ConsumerBase.h:334
Interface to receive entity requests.
Definition: ConsumerBase.h:243
virtual void OnInjectedDeletedEntity(const Safir::Dob::InjectedEntityProxy injectedEntityProxy)
Called when an entity delete is about to be injected in the system.
Definition: ConsumerBase.h:359
virtual void OnInjectedNewEntity(const Safir::Dob::InjectedEntityProxy injectedEntityProxy)
Called when a new entity is about to be injected in the system.
Definition: ConsumerBase.h:343
Base class used when composing more elaborated interfaces.
Definition: ConsumerBase.h:201
Interface to receive service requests.
Definition: ConsumerBase.h:393