iceberg-cpp
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
iceberg::PartitionSet Class Reference

A set that uses a pair of spec ID and partition tuple as elements. More...

#include <partition_value_util.h>

Public Types

using set_type = std::unordered_set< PartitionKey, PartitionKeyHash, PartitionKeyEqual >
 
using iterator = typename set_type::iterator
 
using const_iterator = typename set_type::const_iterator
 

Public Member Functions

size_t size () const
 Get the number of elements in the set.
 
bool empty () const
 Check if the set is empty.
 
void clear ()
 Clear all elements from the set.
 
bool contains (int32_t spec_id, const PartitionValues &values) const
 Check if the set contains an element.
 
bool add (int32_t spec_id, PartitionValues values)
 Add an element to the set.
 
bool remove (int32_t spec_id, const PartitionValues &values)
 Remove an element from the set.
 
iterator begin ()
 Get iterator to the beginning.
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 Get iterator to the end.
 
const_iterator end () const
 
const_iterator cend () const
 

Detailed Description

A set that uses a pair of spec ID and partition tuple as elements.

Member Function Documentation

◆ add()

bool iceberg::PartitionSet::add ( int32_t  spec_id,
PartitionValues  values 
)
inline

Add an element to the set.

Parameters
spec_idThe partition spec ID.
valuesThe partition values.
Returns
true if the element was added, false if it already existed.

◆ contains()

bool iceberg::PartitionSet::contains ( int32_t  spec_id,
const PartitionValues values 
) const
inline

Check if the set contains an element.

Parameters
spec_idThe partition spec ID.
valuesThe partition values.
Returns
true if the element exists, false otherwise.

◆ remove()

bool iceberg::PartitionSet::remove ( int32_t  spec_id,
const PartitionValues values 
)
inline

Remove an element from the set.

Parameters
spec_idThe partition spec ID.
valuesThe partition values.
Returns
true if the element was removed, false if it didn't exist.

The documentation for this class was generated from the following file: