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::Constraint Class Referenceabstract

Constraint is the base class of any type of table constraint. More...

#include <duckdb.hpp>

Inheritance diagram for duckdb::Constraint:

Public Member Functions

DUCKDB_API Constraint (ConstraintType type)
virtual DUCKDB_API string ToString () const =0
DUCKDB_API void Print () const
virtual DUCKDB_API unique_ptr< Constraint > Copy () const =0
virtual DUCKDB_API void Serialize (Serializer &serializer) const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static DUCKDB_API unique_ptr< Constraint > Deserialize (Deserializer &deserializer)

Public Attributes

ConstraintType type

Detailed Description

Constraint is the base class of any type of table constraint.

Constructor & Destructor Documentation

◆ Constraint()

duckdb::Constraint::Constraint ( ConstraintType type)
explicit
335947 : type(type) {
335948}

◆ ~Constraint()

duckdb::Constraint::~Constraint ( )
virtual
335950 {
335951}

Member Function Documentation

◆ Print()

void duckdb::Constraint::Print ( ) const
335953 {
335954 Printer::Print(ToString());
335955}
static DUCKDB_API void Print(OutputStream stream, const string &str)
Print the object to the stream.
Definition duckdb.cpp:92556

◆ Serialize()

void duckdb::Constraint::Serialize ( Serializer & serializer) const
virtual
415546 {
415547 serializer.WriteProperty<ConstraintType>(100, "type", type);
415548}

◆ Deserialize()

unique_ptr< Constraint > duckdb::Constraint::Deserialize ( Deserializer & deserializer)
static
415550 {
415551 auto type = deserializer.ReadProperty<ConstraintType>(100, "type");
415552 unique_ptr<Constraint> result;
415553 switch (type) {
415554 case ConstraintType::CHECK:
415555 result = CheckConstraint::Deserialize(deserializer);
415556 break;
415557 case ConstraintType::FOREIGN_KEY:
415558 result = ForeignKeyConstraint::Deserialize(deserializer);
415559 break;
415560 case ConstraintType::NOT_NULL:
415561 result = NotNullConstraint::Deserialize(deserializer);
415562 break;
415563 case ConstraintType::UNIQUE:
415564 result = UniqueConstraint::Deserialize(deserializer);
415565 break;
415566 default:
415567 throw SerializationException("Unsupported type for deserialization of Constraint!");
415568 }
415569 return result;
415570}

◆ Cast() [1/2]

template<class TARGET>
TARGET & duckdb::Constraint::Cast ( )
inline
28420 {
28421 if (type != TARGET::TYPE) {
28422 throw InternalException("Failed to cast constraint to type - constraint type mismatch");
28423 }
28424 return reinterpret_cast<TARGET &>(*this);
28425 }

◆ Cast() [2/2]

template<class TARGET>
const TARGET & duckdb::Constraint::Cast ( ) const
inline
28428 {
28429 if (type != TARGET::TYPE) {
28430 throw InternalException("Failed to cast constraint to type - constraint type mismatch");
28431 }
28432 return reinterpret_cast<const TARGET &>(*this);
28433 }

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