Lightstreamer C++ Client SDK
Loading...
Searching...
No Matches
ItemUpdate.h
1/*
2 * Copyright (C) 2023 Lightstreamer Srl
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef INCLUDED_Lightstreamer_ItemUpdate
17#define INCLUDED_Lightstreamer_ItemUpdate
18
19#include "../Lightstreamer.h"
20
21namespace Lightstreamer {
22
48 HaxeObject _delegate;
49public:
50 ItemUpdate() = delete;
51 ItemUpdate(const ItemUpdate&) = delete;
52 ItemUpdate& operator=(const ItemUpdate&) = delete;
53
55 explicit ItemUpdate(HaxeObject hxObj) : _delegate(hxObj) {}
56
57 ~ItemUpdate() {
58 Lightstreamer_releaseHaxeObject(_delegate);
59 }
67 std::string getItemName() {
68 return ItemUpdate_getItemName(_delegate);
69 }
77 int getItemPos() {
78 return ItemUpdate_getItemPos(_delegate);
79 }
96 std::string getValue(const std::string& fieldName) {
97 return ItemUpdate_getValueByName(_delegate, &fieldName);
98 }
116 std::string getValue(int fieldPos) {
117 return ItemUpdate_getValueByPos(_delegate, fieldPos);
118 }
132 bool isNull(const std::string& fieldName) {
133 return ItemUpdate_isNullByName(_delegate, &fieldName);
134 }
148 bool isNull(int fieldPos) {
149 return ItemUpdate_isNullByPos(_delegate, fieldPos);
150 }
173 bool isSnapshot() {
174 return ItemUpdate_isSnapshot(_delegate);
175 }
199 bool isValueChanged(const std::string& fieldName) {
200 return ItemUpdate_isValueChangedByName(_delegate, &fieldName);
201 }
226 bool isValueChanged(int fieldPos) {
227 return ItemUpdate_isValueChangedByPos(_delegate, fieldPos);
228 }
245 std::map<std::string, std::string> getChangedFields() {
246 return ItemUpdate_getChangedFields(_delegate);
247 }
262 std::map<int, std::string> getChangedFieldsByPosition() {
263 return ItemUpdate_getChangedFieldsByPosition(_delegate);
264 }
276 std::map<std::string, std::string> getFields() {
277 return ItemUpdate_getFields(_delegate);
278 }
288 std::map<int, std::string> getFieldsByPosition() {
289 return ItemUpdate_getFieldsByPosition(_delegate);
290 }
291};
292
293} // namespace Lightstreamer
294
295
296#endif // INCLUDED_Lightstreamer_ItemUpdate
Contains all the information related to an update of the field values for an item.
Definition ItemUpdate.h:47
bool isNull(const std::string &fieldName)
Returns whether the current value received from the Server for the specified field is null.
Definition ItemUpdate.h:132
std::string getValue(int fieldPos)
Returns the current value for the specified field.
Definition ItemUpdate.h:116
std::string getValue(const std::string &fieldName)
Returns the current value for the specified field.
Definition ItemUpdate.h:96
std::string getItemName()
Inquiry method that retrieves the name of the item to which this update pertains.
Definition ItemUpdate.h:67
bool isValueChanged(int fieldPos)
Inquiry method that asks whether the value for a field has changed after the reception of the last up...
Definition ItemUpdate.h:226
bool isValueChanged(const std::string &fieldName)
Inquiry method that asks whether the value for a field has changed after the reception of the last up...
Definition ItemUpdate.h:199
int getItemPos()
Inquiry method that retrieves the position in the "Item List" or "Item Group" of the item to which th...
Definition ItemUpdate.h:77
std::map< int, std::string > getChangedFieldsByPosition()
Returns a map containing the values for each field changed with the last server update.
Definition ItemUpdate.h:262
bool isNull(int fieldPos)
Returns whether the current value received from the Server for the specified field is null.
Definition ItemUpdate.h:148
std::map< std::string, std::string > getChangedFields()
Returns a map containing the values for each field changed with the last server update.
Definition ItemUpdate.h:245
std::map< std::string, std::string > getFields()
Returns a map containing the values for each field in the Subscription.
Definition ItemUpdate.h:276
std::map< int, std::string > getFieldsByPosition()
Returns a map containing the values for each field in the Subscription.
Definition ItemUpdate.h:288
bool isSnapshot()
Inquiry method that asks whether the current update belongs to the item snapshot (which carries the c...
Definition ItemUpdate.h:173