| Qore ServerSentEventClient Module Reference 1.0

Loading...
Searching...
No Matches
ServerSentEventClientDataProviderBase.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
4/* ServerSentEventClientDataProviderBase.qc Copyright 2025 Qore Technologies, s.r.o.
5
6 Permission is hereby granted, free of charge, to any person obtaining a
7 copy of this software and associated documentation files (the "Software"),
8 to deal in the Software without restriction, including without limitation
9 the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 and/or sell copies of the Software, and to permit persons to whom the
11 Software is furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 DEALINGS IN THE SOFTWARE.
23*/
24
26 namespace ServerSentEventClient {
28
30 class ServerSentEventClientDataProviderBase : public DataProvider::AbstractDataProvider {
31
32 public:
34 const ProviderInfo = ...;
35
36
38 const ConstructorOptions = ...;
39
40
42 const RequiredConstructorOptions = "url|sseclient";
43
45 const ApiClasses = ...;
46
47
48 protected:
50 ServerSentEventClient client;
51
53 Mutex m();
54
56 ServerSentEventClientWaitForMessageDataProvider child;
57
59 QueuedObserver queued_observer;
60
61 public:
62
64 constructor(*hash<auto> options);
65
66
67 destructor();
68
69
70 string getName();
71
72
74 setLogger(*LoggerInterface logger);
75
76
78 register(ServerSentEventClientWaitForMessageDataProvider child);
79
80
82 deregister();
83
84
86 Queue getQueue();
87
88
90 registerObserver(object observer, ...);
91
92
94
98 bool deregisterObserver(object observer);
99
100
102
104 observersReady();
105
106
108 bool isConnected();
109
110
112 reconnect();
113
114
116
121 protected:
122 *hash<DataProviderConnectionInfo> getConnectionInfoImpl();
123 public:
124
125
127
129 protected:
130 *list<string> getChildProviderNamesImpl();
131 public:
132
133
135
141 protected:
142 *AbstractDataProvider getChildProviderImpl(string name);
143 public:
144
145
147
151 protected:
152 hash<string, hash<DataProviderMessageInfo>> getEventTypesImpl();
153 public:
154
155
157 static hash<auto> getOptionsFromTemplate(hash<auto> template_options, *hash<auto> options);
158};
159};
ServerSentEventClient::ServerSentEventClientDataProviderBase
Event-based data provider for ServerSentEvent client-side events.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:30
ServerSentEventClient::ServerSentEventClientDataProviderBase::deregister
deregister()
Dergister a child data provider.
ServerSentEventClient::ServerSentEventClientDataProviderBase::getOptionsFromTemplate
static hash< auto > getOptionsFromTemplate(hash< auto > template_options, *hash< auto > options)
Returns options from a template.
ServerSentEventClient::ServerSentEventClientDataProviderBase::RequiredConstructorOptions
const RequiredConstructorOptions
Required constructor option combinations.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:42
ServerSentEventClient::ServerSentEventClientDataProviderBase::setLogger
setLogger(*LoggerInterface logger)
Accepts a LoggerInterface object for logging (or clears it)
ServerSentEventClient::ServerSentEventClientDataProviderBase::ApiClasses
const ApiClasses
Registered API classes.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:45
ServerSentEventClient::ServerSentEventClientDataProviderBase::ConstructorOptions
const ConstructorOptions
Constructor options.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:38
ServerSentEventClient::ServerSentEventClientDataProviderBase::getEventTypesImpl
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl()
Returns a hash of all supported event types.
ServerSentEventClient::ServerSentEventClientDataProviderBase::queued_observer
QueuedObserver queued_observer
Queued observer.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:59
ServerSentEventClient::ServerSentEventClientDataProviderBase::getConnectionInfoImpl
*hash< DataProviderConnectionInfo > getConnectionInfoImpl()
Returns connection info.
ServerSentEventClient::ServerSentEventClientDataProviderBase::observersReady
observersReady()
Called when all observers have been added to the object.
ServerSentEventClient::ServerSentEventClientDataProviderBase::child
ServerSentEventClientWaitForMessageDataProvider child
Wait for message API data provider.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:56
ServerSentEventClient::ServerSentEventClientDataProviderBase::deregisterObserver
bool deregisterObserver(object observer)
The method deregisters the given observer.
ServerSentEventClient::ServerSentEventClientDataProviderBase::registerObserver
registerObserver(object observer,...)
The method registers the given observer.
ServerSentEventClient::ServerSentEventClientDataProviderBase::isConnected
bool isConnected()
Returns True if the object is currently connected.
ServerSentEventClient::ServerSentEventClientDataProviderBase::m
Mutex m()
Mutex for wait for message child data provider handling.
ServerSentEventClient::ServerSentEventClientDataProviderBase::ProviderInfo
const ProviderInfo
Provider info.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:34
ServerSentEventClient::ServerSentEventClientDataProviderBase::getChildProviderNamesImpl
*list< string > getChildProviderNamesImpl()
Returns a list of child data provider names.
ServerSentEventClient::ServerSentEventClientDataProviderBase::getChildProviderImpl
*AbstractDataProvider getChildProviderImpl(string name)
Returns the given child provider or NOTHING if the given child is unknown.
ServerSentEventClient::ServerSentEventClientDataProviderBase::client
ServerSentEventClient client
The SSE client itself.
Definition ServerSentEventClientDataProviderBase.qc.dox.h:50
ServerSentEventClient::ServerSentEventClientDataProviderBase::constructor
constructor(*hash< auto > options)
Creates the object from constructor options.
ServerSentEventClient::ServerSentEventClientDataProviderBase::getQueue
Queue getQueue()
Returs the child message queue.
ServerSentEventClient::ServerSentEventClientDataProviderBase::reconnect
reconnect()
Initiate a reconnect action on the client.
ServerSentEventClient::ServerSentEventClientWaitForMessageDataProvider
ServerSentEvent client wait for message from server API data provider.
Definition ServerSentEventClientWaitForMessageDataProvider.qc.dox.h:28
ServerSentEventClient
the ServerSentEventClient namespace contains all the definitions in the ServerSentEventClient module
Definition ServerSentEventClient.qc.dox.h:26