Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::BoundLimitNode Struct Reference
Collaboration diagram for duckdb::BoundLimitNode:

Public Member Functions

 BoundLimitNode (LimitNodeType type, idx_t constant_integer, double constant_percentage, unique_ptr< Expression > expression)
LimitNodeType Type () const
idx_t GetConstantValue () const
 Returns the constant value, only valid if Type() == CONSTANT_VALUE.
double GetConstantPercentage () const
 Returns the constant percentage, only valid if Type() == CONSTANT_PERCENTAGE.
const Expression & GetValueExpression () const
 Returns the constant percentage, only valid if Type() == EXPRESSION_VALUE.
const Expression & GetPercentageExpression () const
 Returns the constant percentage, only valid if Type() == EXPRESSION_PERCENTAGE.
unique_ptr< Expression > & GetExpression ()
void Serialize (Serializer &serializer) const

Static Public Member Functions

static BoundLimitNode ConstantValue (int64_t value)
static BoundLimitNode ConstantPercentage (double percentage)
static BoundLimitNode ExpressionValue (unique_ptr< Expression > expression)
static BoundLimitNode ExpressionPercentage (unique_ptr< Expression > expression)
static BoundLimitNode Deserialize (Deserializer &deserializer)

Private Member Functions

 BoundLimitNode (int64_t constant_value)
 BoundLimitNode (double percentage_value)
 BoundLimitNode (unique_ptr< Expression > expression, bool is_percentage)

Private Attributes

LimitNodeType type = LimitNodeType::UNSET
idx_t constant_integer = 0
 Integer value, if value is a constant non-percentage.
double constant_percentage = -1
 Percentage value, if value is a constant percentage.
unique_ptr< Expression > expression
 Expression in case node is not constant.

Constructor & Destructor Documentation

◆ BoundLimitNode() [1/5]

duckdb::BoundLimitNode::BoundLimitNode ( )
375132 : type(LimitNodeType::UNSET) {
375133}

◆ BoundLimitNode() [2/5]

duckdb::BoundLimitNode::BoundLimitNode ( LimitNodeType type,
idx_t constant_integer,
double constant_percentage,
unique_ptr< Expression > expression )
375129 expression(std::move(expression_p)) {
375130}
double constant_percentage
Percentage value, if value is a constant percentage.
Definition duckdb.hpp:17894
unique_ptr< Expression > expression
Expression in case node is not constant.
Definition duckdb.hpp:17896
idx_t constant_integer
Integer value, if value is a constant non-percentage.
Definition duckdb.hpp:17892

◆ BoundLimitNode() [3/5]

duckdb::BoundLimitNode::BoundLimitNode ( int64_t constant_value)
explicitprivate
375136 : type(LimitNodeType::CONSTANT_VALUE), constant_integer(NumericCast<idx_t>(constant_value)) {
375137}

◆ BoundLimitNode() [4/5]

duckdb::BoundLimitNode::BoundLimitNode ( double percentage_value)
explicitprivate
375140 : type(LimitNodeType::CONSTANT_PERCENTAGE), constant_percentage(percentage_value) {
375141}

◆ BoundLimitNode() [5/5]

duckdb::BoundLimitNode::BoundLimitNode ( unique_ptr< Expression > expression,
bool is_percentage )
explicitprivate
375144 : type(is_percentage ? LimitNodeType::EXPRESSION_PERCENTAGE : LimitNodeType::EXPRESSION_VALUE),
375145 expression(std::move(expression_p)) {
375146}

Member Function Documentation

◆ ConstantValue()

BoundLimitNode duckdb::BoundLimitNode::ConstantValue ( int64_t value)
static
375148 {
375149 return BoundLimitNode(value);
375150}

◆ ConstantPercentage()

BoundLimitNode duckdb::BoundLimitNode::ConstantPercentage ( double percentage)
static
375152 {
375153 return BoundLimitNode(percentage);
375154}

◆ ExpressionValue()

BoundLimitNode duckdb::BoundLimitNode::ExpressionValue ( unique_ptr< Expression > expression)
static
375156 {
375157 return BoundLimitNode(std::move(expression), false);
375158}

◆ ExpressionPercentage()

BoundLimitNode duckdb::BoundLimitNode::ExpressionPercentage ( unique_ptr< Expression > expression)
static
375160 {
375161 return BoundLimitNode(std::move(expression), true);
375162}

◆ Type()

LimitNodeType duckdb::BoundLimitNode::Type ( ) const
inline
17867 {
17868 return type;
17869 }

◆ GetConstantValue()

idx_t duckdb::BoundLimitNode::GetConstantValue ( ) const

Returns the constant value, only valid if Type() == CONSTANT_VALUE.

375164 {
375165 if (Type() != LimitNodeType::CONSTANT_VALUE) {
375166 throw InternalException("BoundLimitNode::GetConstantValue called but limit is not a constant value");
375167 }
375168 return constant_integer;
375169}
Here is the caller graph for this function:

◆ GetConstantPercentage()

double duckdb::BoundLimitNode::GetConstantPercentage ( ) const

Returns the constant percentage, only valid if Type() == CONSTANT_PERCENTAGE.

375171 {
375172 if (Type() != LimitNodeType::CONSTANT_PERCENTAGE) {
375173 throw InternalException("BoundLimitNode::GetConstantPercentage called but limit is not a constant percentage");
375174 }
375175 return constant_percentage;
375176}

◆ GetValueExpression()

const Expression & duckdb::BoundLimitNode::GetValueExpression ( ) const

Returns the constant percentage, only valid if Type() == EXPRESSION_VALUE.

375178 {
375179 if (Type() != LimitNodeType::EXPRESSION_VALUE) {
375180 throw InternalException("BoundLimitNode::GetValueExpression called but limit is not an expression value");
375181 }
375182 return *expression;
375183}

◆ GetPercentageExpression()

const Expression & duckdb::BoundLimitNode::GetPercentageExpression ( ) const

Returns the constant percentage, only valid if Type() == EXPRESSION_PERCENTAGE.

375185 {
375186 if (Type() != LimitNodeType::EXPRESSION_PERCENTAGE) {
375187 throw InternalException(
375188 "BoundLimitNode::GetPercentageExpression called but limit is not an expression percentage");
375189 }
375190 return *expression;
375191}

◆ GetExpression()

unique_ptr< Expression > & duckdb::BoundLimitNode::GetExpression ( )
inline

Returns a pointer to the expression - should only be used for limit-agnostic optimizations. Prefer using the methods above in other scenarios.

17882 {
17883 return expression;
17884 }

◆ Serialize()

void duckdb::BoundLimitNode::Serialize ( Serializer & serializer) const
417276 {
417277 serializer.WriteProperty<LimitNodeType>(100, "type", type);
417278 serializer.WritePropertyWithDefault<idx_t>(101, "constant_integer", constant_integer);
417279 serializer.WriteProperty<double>(102, "constant_percentage", constant_percentage);
417280 serializer.WritePropertyWithDefault<unique_ptr<Expression>>(103, "expression", expression);
417281}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Deserialize()

BoundLimitNode duckdb::BoundLimitNode::Deserialize ( Deserializer & deserializer)
static
417283 {
417284 auto type = deserializer.ReadProperty<LimitNodeType>(100, "type");
417285 auto constant_integer = deserializer.ReadPropertyWithDefault<idx_t>(101, "constant_integer");
417286 auto constant_percentage = deserializer.ReadProperty<double>(102, "constant_percentage");
417287 auto expression = deserializer.ReadPropertyWithDefault<unique_ptr<Expression>>(103, "expression");
417288 BoundLimitNode result(type, constant_integer, constant_percentage, std::move(expression));
417289 return result;
417290}

The documentation for this struct was generated from the following files: