33 groups.push_back(std::move(group));
38 if (groupIdx >= groups.size()) {
41 return groups[groupIdx].get();
44 if (groupIdx >= groups.size()) {
47 return groups[groupIdx].get();
50 std::unique_ptr<T> group) {
54 if (groupIdx >= groups.size()) {
55 groups.resize(groupIdx + 1);
57 groups[groupIdx] = std::move(group);
63 if (newSize <= groups.size()) {
66 groups.resize(newSize);
72 return groups.empty();
89 return std::move(groups[groupIdx]);
97 return groups.front().get();
100 if (groups.empty()) {
103 return groups.front().get();
108 if (groups.empty()) {
111 return groups.back().get();
122 std::vector<std::unique_ptr<T>> groups;
#define KU_ASSERT(condition)
Definition assert.h:19
#define KU_UNUSED(expr)
Definition assert.h:30
Definition deserializer.h:15
void deserializeVectorOfPtrs(std::vector< std::unique_ptr< T > > &values)
Definition deserializer.h:80
Definition serializer.h:15
void serializeVectorOfPtrs(const std::vector< std::unique_ptr< T > > &values)
Definition serializer.h:80
Definition group_collection.h:14
const std::vector< std::unique_ptr< T > > & getAllGroups(const common::UniqLock &lock)
Definition group_collection.h:80
T * getGroupNoLock(common::idx_t groupIdx)
Definition group_collection.h:43
common::idx_t getNumGroups(const common::UniqLock &lock) const
Definition group_collection.h:74
T * getGroup(const common::UniqLock &lock, common::idx_t groupIdx)
Definition group_collection.h:35
T * getFirstGroup(const common::UniqLock &lock)
Definition group_collection.h:91
void loadGroups(common::Deserializer &deSer)
Definition group_collection.h:20
T * getFirstGroupNoLock()
Definition group_collection.h:99
void resize(const common::UniqLock &lock, common::idx_t newSize)
Definition group_collection.h:60
common::UniqLock lock()
Definition group_collection.h:18
T * getLastGroup(const common::UniqLock &lock)
Definition group_collection.h:105
void replaceGroup(const common::UniqLock &lock, common::idx_t groupIdx, std::unique_ptr< T > group)
Definition group_collection.h:49
void serializeGroups(common::Serializer &ser)
Definition group_collection.h:24
void appendGroup(const common::UniqLock &lock, std::unique_ptr< T > group)
Definition group_collection.h:29
bool isEmpty(const common::UniqLock &lock)
Definition group_collection.h:69
std::unique_ptr< T > moveGroup(const common::UniqLock &lock, common::idx_t groupIdx)
Definition group_collection.h:85
void clear(const common::UniqLock &lock)
Definition group_collection.h:114
GroupCollection()
Definition group_collection.h:16
uint32_t idx_t
Definition types.h:39
Definition alter_type.h:5
bool isLocked() const
Definition uniq_lock.h:20