diff --git a/broker/gen/model/Image_buffer_status.cpp b/broker/gen/model/Image_buffer_status.cpp index 63f3f7fa..a0c2e2e3 100644 --- a/broker/gen/model/Image_buffer_status.cpp +++ b/broker/gen/model/Image_buffer_status.cpp @@ -26,6 +26,7 @@ Image_buffer_status::Image_buffer_status() m_Total_slots = 0L; m_Available_slots = 0L; m_Current_counter = 0L; + m_Current_counterIsSet = false; } @@ -121,8 +122,8 @@ bool Image_buffer_status::operator==(const Image_buffer_status& rhs) const (getAvailableSlots() == rhs.getAvailableSlots()) && - (getCurrentCounter() == rhs.getCurrentCounter()) + ((!currentCounterIsSet() && !rhs.currentCounterIsSet()) || (currentCounterIsSet() && rhs.currentCounterIsSet() && getCurrentCounter() == rhs.getCurrentCounter())) ; } @@ -140,7 +141,8 @@ void to_json(nlohmann::json& j, const Image_buffer_status& o) j["image_numbers"] = o.m_Image_numbers; j["total_slots"] = o.m_Total_slots; j["available_slots"] = o.m_Available_slots; - j["current_counter"] = o.m_Current_counter; + if(o.currentCounterIsSet()) + j["current_counter"] = o.m_Current_counter; } @@ -151,7 +153,11 @@ void from_json(const nlohmann::json& j, Image_buffer_status& o) j.at("image_numbers").get_to(o.m_Image_numbers); j.at("total_slots").get_to(o.m_Total_slots); j.at("available_slots").get_to(o.m_Available_slots); - j.at("current_counter").get_to(o.m_Current_counter); + if(j.find("current_counter") != j.end()) + { + j.at("current_counter").get_to(o.m_Current_counter); + o.m_Current_counterIsSet = true; + } } @@ -202,6 +208,15 @@ int64_t Image_buffer_status::getCurrentCounter() const void Image_buffer_status::setCurrentCounter(int64_t const value) { m_Current_counter = value; + m_Current_counterIsSet = true; +} +bool Image_buffer_status::currentCounterIsSet() const +{ + return m_Current_counterIsSet; +} +void Image_buffer_status::unsetCurrent_counter() +{ + m_Current_counterIsSet = false; } diff --git a/broker/gen/model/Image_buffer_status.h b/broker/gen/model/Image_buffer_status.h index f37abf53..21592254 100644 --- a/broker/gen/model/Image_buffer_status.h +++ b/broker/gen/model/Image_buffer_status.h @@ -84,10 +84,12 @@ public: int64_t getAvailableSlots() const; void setAvailableSlots(int64_t const value); /// - /// Counter of changes in the image buffer - either new start message or new image added. For optimization one can only load new images/datasets from the HTTP if this value changes. + /// Counter of changes in the image buffer - either new start message or new image added. For optimization one can only load new images/datasets from the HTTP if this value changes. Counter is optional as it was not implemented in older versions to avoid breaking change /// int64_t getCurrentCounter() const; void setCurrentCounter(int64_t const value); + bool currentCounterIsSet() const; + void unsetCurrent_counter(); friend void to_json(nlohmann::json& j, const Image_buffer_status& o); friend void from_json(const nlohmann::json& j, Image_buffer_status& o); @@ -103,7 +105,7 @@ protected: int64_t m_Available_slots; int64_t m_Current_counter; - + bool m_Current_counterIsSet; }; diff --git a/broker/jfjoch_api.yaml b/broker/jfjoch_api.yaml index 7878c35f..7b99946e 100644 --- a/broker/jfjoch_api.yaml +++ b/broker/jfjoch_api.yaml @@ -693,7 +693,6 @@ components: - available_slots - max_image_number - min_image_number - - current_counter properties: min_image_number: type: integer @@ -727,6 +726,7 @@ components: description: | Counter of changes in the image buffer - either new start message or new image added. For optimization one can only load new images/datasets from the HTTP if this value changes. + Counter is optional as it was not implemented in older versions to avoid breaking change image_format_settings: type: object required: diff --git a/broker/redoc-static.html b/broker/redoc-static.html index ad2f0414..af54e303 100644 --- a/broker/redoc-static.html +++ b/broker/redoc-static.html @@ -1424,7 +1424,7 @@ then image might be replaced in the buffer between calling /images and /image.cb " class="sc-eVqvcJ sc-fszimp kIppRw drqpJr">

Test Jungfraujoch system

http://localhost:5232/version