ECC-1820: grib_accessors_list.rank made private

This commit is contained in:
shahramn 2024-05-10 15:59:41 +01:00
parent 5661700367
commit 98cf979823
3 changed files with 12 additions and 9 deletions

View File

@ -46,14 +46,14 @@ void grib_accessors_list::push(grib_accessor* a, int rank)
if (last && last->accessor) {
last->next_ = (grib_accessors_list*)grib_context_malloc_clear(c, sizeof(grib_accessors_list));
last->next_->accessor = a;
last->next_->prev_ = last;
last->next_->rank = rank;
this->last_ = last->next_;
last->next_->prev_ = last;
last->next_->rank_ = rank;
this->last_ = last->next_;
}
else {
this->accessor = a;
this->rank = rank;
this->last_ = this;
this->rank_ = rank;
this->last_ = this;
}
}

View File

@ -26,11 +26,14 @@ public:
int unpack_float(float* val, size_t* buffer_len);
int unpack_string(char** val, size_t* buffer_len);
int rank() const { return rank_; }
grib_accessor* accessor = nullptr;
int rank = 0;
grib_accessors_list* next_ = nullptr;
grib_accessors_list* prev_ = nullptr;
grib_accessors_list* last_ = nullptr;
private:
int rank_ = 0;
};
grib_accessors_list* grib_accessors_list_create(grib_context* c);

View File

@ -384,7 +384,7 @@ static void search_from_accessors_list(grib_accessors_list* al, const grib_acces
accessor_result = al->accessor;
}
if (accessor_result) {
result->push(accessor_result, al->rank);
result->push(accessor_result, al->rank());
}
}
al = al->next_;
@ -398,7 +398,7 @@ static void search_from_accessors_list(grib_accessors_list* al, const grib_acces
accessor_result = al->accessor;
}
if (accessor_result) {
result->push(accessor_result, al->rank);
result->push(accessor_result, al->rank());
}
}
}
@ -453,7 +453,7 @@ static void grib_find_same_and_push(grib_accessors_list* al, grib_accessor* a)
{
if (a) {
grib_find_same_and_push(al, a->same);
al->push(a, al->rank);
al->push(a, al->rank());
}
}