TBoldSubscriber¶
TBoldSubscriber is an abstract superclass for classes subscribing to events.
Unit: BoldSubscription
Declaration¶
Hierarchy¶
- TObject
TBoldMemoryManagedObject- TBoldSubscriber
- Direct subclasses
TBoldAbstractDeriverTBoldComClientSubscriberTBoldComServerSubscriberTBoldFollowerSubscriberTBoldLogReceiverSubscriber- TBoldPassthroughSubscriber
TBoldRegion
Description¶
Concrete classes become subscribable either by subclassing TBoldSubscriber, e.g. TBoldFollower, or by using a TBoldPassthroughSubscriber.
Properties¶
| Name | Summary | Notes |
|---|---|---|
| ContextString | read-only | |
| HandlesExtendedEvents | read-only |
ContextString¶
This property returns a string describing the subscriber. The default implementation returns '', this can be changed by overriding GetContextString.
HandlesExtendedEvents¶
This property is used by the subscription mechanism to know if Receive or ReceiveExtended should be called when notifying a subscriber.
| Note |
|---|
| Default is to return false, override the GethandlesExtendedEvents to change this |
|---|
Methods¶
| Name | Summary | Notes |
|---|---|---|
| Answer | protected, virtual | |
| CancelAllSubscriptions | ||
| CloneSubscriptions | ||
| Destroy | override | |
| GetContextString | protected, virtual | |
| GetHandlesExtendedEvents | protected, virtual | |
| Receive | This method is called each time a event occurs that the subscriber holds a subscription to occurs. | protected, abstract |
| ReceiveExtended | protected, virtual |
Answer¶
function Answer(Originator: TObject; OriginalEvent: TBoldEvent; RequestedEvent: TBoldRequestedEvent; const Args: array of const; Subscriber: TBoldSubscriber): Boolean; virtual;
Each time SendQuery is called on a TBoldPublisher, TBoldSubscriber_Answer is be called on each subscriber holding a subscription matching the event. If all Answer calls return True, SendQuery will return True. If any Answer returns False, SendQuery returns False. The process is terminated on the first False reply, so there is no guarantee that Answer will be called for all subscribers.
This function is only called by TBoldPublisher.
| Parameters |
|---|
| Originator | The object originating the event, given as parameter to SendQuery. |
|---|---|
| OriginalEvent | The event send by Originator |
| RequestedEvent | The requested event given when placing the subscription with AddSubscription or AddSmallSubscription. |
CancelAllSubscriptions¶
This method cancels all the subscribers subscriptions.
CloneSubscriptions¶
procedure CloneSubscriptions(Subscriber: TBoldSubscriber; OldRequestedEvent: TBoldRequestedEvent; NewRequestedEvent: TBoldRequestedEvent);
Destroy¶
GetContextString¶
Default implementation of property ContextString, returns ''
GetHandlesExtendedEvents¶
Implements the property HandlesExtendedEvents. The base implementation always returns false, but subclasses may override this.
Receive¶
procedure Receive(Originator: TObject; OriginalEvent: TBoldEvent; RequestedEvent: TBoldRequestedEvent); virtual; abstract;
Receive is an abstract method that must be implemented in each concrete subclass. This procedure is only called by TBoldPublisher.
| Parameters |
|---|
| OriginalEvent | the event that triggers the subscription |
|---|---|
| Originator | the object on which OriginalEvent occurred |
| RequestedEvent | the event requested when placing the subscription with AddSubscription or AddSmallSubscription |
ReceiveExtended¶
procedure ReceiveExtended(Originator: TObject; OriginalEvent: TBoldEvent; RequestedEvent: TBoldRequestedEvent; const Args: array of const); virtual;
This method is similar to Receive, but it also get a set of arguments that were provided by the object who sent the event. Subscribers that implements ReceiveExtended should always override the GetHandlesExtendedEvents otherwise this method will never be called.
Generated from the Bold 4.0 help (Help/BfD.chm) by Tools/chm2mkdocs.py; member lists reflect Bold 4.0, see the source for members added since.