Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Transport/SubscriberConnection.h (1 of 28 files). Show all
Unified · Split
| @@ -37,6 +37,9 @@ namespace Transport · 36 unmodified lines | ||
| 37 | 37 | class DataPublisher; |
| 38 | 38 | typedef GSF::SharedPtr<DataPublisher> DataPublisherPtr; |
| 39 | 39 | |
| 40 | + class SubscriberConnection; | |
| 41 | + typedef GSF::SharedPtr<SubscriberConnection> SubscriberConnectionPtr; | |
| 42 | + | |
| 40 | 43 | // Represents a subscriber connection to a data publisher |
| 41 | 44 | class SubscriberConnection : public GSF::EnableSharedThisPtr<SubscriberConnection> // NOLINT |
| 42 | 45 | { |
| @@ -49,6 +52,9 @@ namespace Transport · 6 unmodified lines | ||
| 49 | 52 | std::string m_subscriptionInfo; |
| 50 | 53 | uint32_t m_operationalModes; |
| 51 | 54 | uint32_t m_encoding; |
| 55 | + GSF::datetime_t m_startTimeConstraint; | |
| 56 | + GSF::datetime_t m_stopTimeConstraint; | |
| 57 | + int32_t m_processingInterval; | |
| 52 | 58 | bool m_usePayloadCompression; |
| 53 | 59 | bool m_useCompactMeasurementFormat; |
| 54 | 60 | bool m_includeTime; |
| @@ -79,17 +85,18 @@ namespace Transport · 24 unmodified lines | ||
| 79 | 85 | SignalIndexCachePtr m_signalIndexCache; |
| 80 | 86 | int32_t m_timeIndex; |
| 81 | 87 | int64_t m_baseTimeOffsets[2]; |
| 82 | − DateTime m_lastPublishTime; | |
| 88 | + datetime_t m_lastPublishTime; | |
| 83 | 89 | //TSSCMeasurementParser m_tsscMeasurementParser; |
| 84 | 90 | //bool m_tsscResetRequested; |
| 85 | 91 | //uint16_t m_tsscSequenceNumber; |
| 86 | 92 | |
| 87 | 93 | // Server request handlers |
| 88 | 94 | void HandleSubscribe(uint8_t* data, uint32_t length); |
| 95 | + void HandleSubscribeFailure(const std::string& message); | |
| 89 | 96 | void HandleUnsubscribe(); |
| 90 | 97 | void HandleMetadataRefresh(uint8_t* data, uint32_t length); |
| 91 | 98 | void HandleRotateCipherKeys(); |
| 92 | − void HandleUpdateProcessingInterval(uint8_t* data, uint32_t length); | |
| 99 | + void HandleUpdateProcessingInterval(const uint8_t* data, uint32_t length); | |
| 93 | 100 | void HandleDefineOperationalModes(uint8_t* data, uint32_t length); |
| 94 | 101 | void HandleConfirmNotification(uint8_t* data, uint32_t length); |
| 95 | 102 | void HandleConfirmBufferBlock(uint8_t* data, uint32_t length); |
| @@ -112,43 +119,78 @@ namespace Transport · 16 unmodified lines | ||
| 112 | 119 | ~SubscriberConnection(); |
| 113 | 120 | |
| 114 | 121 | const DataPublisherPtr& GetParent() const; |
| 122 | + SubscriberConnectionPtr GetReference(); | |
| 115 | 123 | |
| 116 | 124 | GSF::TcpSocket& CommandChannelSocket(); |
| 117 | 125 | |
| 118 | − // Gets or sets subscriber identification used when subscriber is known and pre-established | |
| 126 | + // Gets or sets subscriber UUID used when subscriber is known and pre-established | |
| 119 | 127 | const GSF::Guid& GetSubscriberID() const; |
| 120 | 128 | void SetSubscriberID(const GSF::Guid& id); |
| 121 | 129 | |
| 130 | + // Gets subscriber connection identification, e.g., remote IP/port, for display and logging references | |
| 122 | 131 | const std::string& GetConnectionID() const; |
| 132 | + | |
| 133 | + // Gets subscriber remote IP address | |
| 123 | 134 | const GSF::IPAddress& GetIPAddress() const; |
| 135 | + | |
| 136 | + // Gets subscriber communications port | |
| 124 | 137 | const std::string& GetHostName() const; |
| 125 | 138 | |
| 139 | + // Gets or sets established subscriber operational modes | |
| 126 | 140 | uint32_t GetOperationalModes() const; |
| 127 | 141 | void SetOperationalModes(uint32_t value); |
| 128 | 142 | |
| 143 | + // Gets established subscriber string encoding | |
| 129 | 144 | uint32_t GetEncoding() const; |
| 130 | 145 | |
| 146 | + // Gets flags that determines if this subscription is temporal based | |
| 147 | + bool GetIsTemporalSubscription() const; | |
| 148 | + | |
| 149 | + // Gets or sets the start time temporal processing constraint | |
| 150 | + const GSF::datetime_t& GetStartTimeConstraint() const; | |
| 151 | + void SetStartTimeConstraint(const GSF::datetime_t& value); | |
| 152 | + | |
| 153 | + // Gets or sets the stop time temporal processing constraint | |
| 154 | + const GSF::datetime_t& GetStopTimeConstraint() const; | |
| 155 | + void SetStopTimeConstraint(const GSF::datetime_t& value); | |
| 156 | + | |
| 157 | + // Gets or sets the desired temporal processing interval, in milliseconds | |
| 158 | + // With the exception of the values of -1 and 0, this value specifies the desired processing interval for data, i.e., | |
| 159 | + // basically a delay, or timer interval, over which to process data. A value of -1 means to use the default processing | |
| 160 | + // interval while a value of 0 means to process data as fast as possible. | |
| 161 | + int32_t GetProcessingInterval() const; | |
| 162 | + void SetProcessingInterval(int32_t value); | |
| 163 | + | |
| 164 | + // Gets or sets flag that determines if payload compression should be enabled in data packets | |
| 131 | 165 | bool GetUsePayloadCompression() const; |
| 132 | 166 | void SetUsePayloadCompression(bool value); |
| 133 | 167 | |
| 168 | + // Gets or sets flag that determines if the compact measurement format should be used in data packets | |
| 134 | 169 | bool GetUseCompactMeasurementFormat() const; |
| 135 | 170 | void SetUseCompactMeasurementFormat(bool value); |
| 136 | 171 | |
| 172 | + // Gets or sets flag that determines if time should be included in data packets when the compact measurement format used | |
| 137 | 173 | bool GetIncludeTime() const; |
| 138 | 174 | void SetIncludeTime(bool value); |
| 139 | 175 | |
| 176 | + // Gets or sets flag that determines if time should be restricted to millisecond resolution in data packets when the | |
| 177 | + // compact measurement format used; otherwise, full resolution time will be used | |
| 140 | 178 | bool GetUseMillisecondResolution() const; |
| 141 | 179 | void SetUseMillisecondResolution(bool value); |
| 142 | 180 | |
| 181 | + // Gets or sets flag that determines if NaN values should be excluded from data packets | |
| 143 | 182 | bool GetIsNaNFiltered() const; |
| 144 | 183 | void SetIsNaNFiltered(bool value); |
| 145 | 184 | |
| 185 | + // Gets or sets flag that determines if subscriber connection is currently subscribed | |
| 146 | 186 | bool GetIsSubscribed() const; |
| 147 | 187 | void SetIsSubscribed(bool value); |
| 148 | 188 | |
| 189 | + // Gets or sets subscription details about subscriber | |
| 149 | 190 | const std::string& GetSubscriptionInfo() const; |
| 150 | 191 | void SetSubscriptionInfo(const std::string& value); |
| 151 | 192 | |
| 193 | + // Gets or sets signal index cache for subscriber representing run-time mappings for subscribed points | |
| 152 | 194 | const SignalIndexCachePtr& GetSignalIndexCache() const; |
| 153 | 195 | void SetSignalIndexCache(SignalIndexCachePtr signalIndexCache); |
| 154 | 196 | |
| @@ -164,15 +206,16 @@ namespace Transport · 9 unmodified lines | ||
| 164 | 206 | void Start(); |
| 165 | 207 | void Stop(); |
| 166 | 208 | |
| 167 | − void PublishMeasurements(const std::vector<Measurement>& measurements); | |
| 168 | 209 | void PublishMeasurements(const std::vector<MeasurementPtr>& measurements); |
| 210 | + void CompleteTemporalSubscription(); | |
| 169 | 211 | |
| 170 | 212 | void CommandChannelSendAsync(uint8_t* data, uint32_t offset, uint32_t length); |
| 171 | 213 | void DataChannelSendAsync(uint8_t* data, uint32_t offset, uint32_t length); |
| 172 | 214 | void WriteHandler(const ErrorCode& error, uint32_t bytesTransferred); |
| 173 | 215 | |
| 216 | + bool SendResponse(uint8_t responseCode, uint8_t commandCode); | |
| 174 | 217 | bool SendResponse(uint8_t responseCode, uint8_t commandCode, const std::string& message); |
| 175 | − bool SendResponse(uint8_t responseCode, uint8_t commandCode, const std::vector<uint8_t>& data = {}); | |
| 218 | + bool SendResponse(uint8_t responseCode, uint8_t commandCode, const std::vector<uint8_t>& data); | |
| 176 | 219 | |
| 177 | 220 | std::string DecodeString(const uint8_t* data, uint32_t offset, uint32_t length) const; |
| 178 | 221 | std::vector<uint8_t> EncodeString(const std::string& value) const; |