Loading...
Searching...
No Matches
te::da::CheckConstraint Class Reference

A class that describes a check constraint. More...

#include <CheckConstraint.h>

Inheritance diagram for te::da::CheckConstraint:
te::da::Constraint

Public Member Functions

 CheckConstraint (const CheckConstraint &rhs)
 Copy constructor not allowed.
 
 CheckConstraint (const std::string &name, DataSetType *dt=0, unsigned int id=0)
 Constructor.
 
 CheckConstraint (DataSetType *dt=0, unsigned int id=0)
 Constructor.
 
Constraintclone ()
 It returns a clone of the object.
 
virtual DataSetTypegetDataSetType () const
 It returns the DataSetType associated to the constraint.
 
const std::string & getExpression () const
 It returns the check constraint expression.
 
virtual unsigned int getId () const
 It returns the constraint identifier.
 
virtual const std::string & getName () const
 It returns the constraint name.
 
ConstraintType getType () const
 It returns the constraint type: CHECK.
 
CheckConstraintoperator= (const CheckConstraint &rhs)
 Assignment operator.
 
virtual void setDataSetType (DataSetType *dt)
 It sets the DataSetType associated to the constraint.
 
void setExpression (const std::string &e)
 It sets the check constraint expression.
 
virtual void setId (unsigned int id)
 It sets the constraint identifier.
 
virtual void setName (const std::string &name)
 It sets the constraint name.
 
 ~CheckConstraint ()
 Destructor.
 

Private Attributes

DataSetTypem_dt
 The associated DataSetType.
 
std::string m_expression
 The check constraint expression.
 
unsigned int m_id
 An identification number for the constraint.
 
std::string m_name
 The constraint name.
 

Detailed Description

A class that describes a check constraint.

See also
DataSetType, Constraint, PrimaryKey, UniqueKey, ForeignKey

Definition at line 46 of file CheckConstraint.h.

Constructor & Destructor Documentation

◆ CheckConstraint() [1/3]

te::da::CheckConstraint::CheckConstraint ( DataSetType * dt = 0,
unsigned int id = 0 )

Constructor.

Parameters
dtThe DataSetType associated to the check constraint.
idThe constraint identifier.
Note
The new constraint will belong to the given DataSetType.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Referenced by CheckConstraint(), and operator=().

◆ CheckConstraint() [2/3]

te::da::CheckConstraint::CheckConstraint ( const std::string & name,
DataSetType * dt = 0,
unsigned int id = 0 )

Constructor.

Parameters
nameThe check constraint name.
parentThe parent DataSetType of this check constraint.
idThe constraint identifier.
Note
The new constraint will belong to the given DataSetType.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

◆ CheckConstraint() [3/3]

te::da::CheckConstraint::CheckConstraint ( const CheckConstraint & rhs)

Copy constructor not allowed.

The new object will not have an associated DataSetType.

Parameters
rhsRight-hand-side instance.

References CheckConstraint().

◆ ~CheckConstraint()

te::da::CheckConstraint::~CheckConstraint ( )
inline

Destructor.

Definition at line 87 of file CheckConstraint.h.

Member Function Documentation

◆ clone()

Constraint * te::da::CheckConstraint::clone ( )
virtual

It returns a clone of the object.

The new object will not have an associated DataSetType.

Returns
A clone of the object.

Implements te::da::Constraint.

References te::da::Constraint::Constraint().

◆ getDataSetType()

virtual DataSetType * te::da::Constraint::getDataSetType ( ) const
inlinevirtualinherited

It returns the DataSetType associated to the constraint.

Returns
The DataSetType associated to the constraint.

Definition at line 133 of file Constraint.h.

References m_dt.

◆ getExpression()

const std::string & te::da::CheckConstraint::getExpression ( ) const
inline

It returns the check constraint expression.

Returns
The check constraint expression.

Definition at line 105 of file CheckConstraint.h.

References m_expression.

◆ getId()

virtual unsigned int te::da::Constraint::getId ( ) const
inlinevirtualinherited

It returns the constraint identifier.

Returns
A number that identifies the constraint.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 103 of file Constraint.h.

References m_id.

◆ getName()

virtual const std::string & te::da::Constraint::getName ( ) const
inlinevirtualinherited

It returns the constraint name.

Returns
The constraint name.

Definition at line 119 of file Constraint.h.

References m_name.

◆ getType()

ConstraintType te::da::CheckConstraint::getType ( ) const
inlinevirtual

It returns the constraint type: CHECK.

Returns
The constraint type CHECK.

Implements te::da::Constraint.

Definition at line 119 of file CheckConstraint.h.

References te::da::CHECK.

◆ operator=()

CheckConstraint & te::da::CheckConstraint::operator= ( const CheckConstraint & rhs)

Assignment operator.

The new object will not have an assigned DataSetType.

Parameters
rhsRight-hand-side instance.
Returns
A reference to this.

References CheckConstraint().

◆ setDataSetType()

virtual void te::da::Constraint::setDataSetType ( DataSetType * dt)
inlinevirtualinherited

It sets the DataSetType associated to the constraint.

Parameters
dtThe DataSetType associated to this constraint.
Warning
Take care when calling this method. If the constraint belongs to a DataSetType, remember to detach it from the DataSetType before calling this method.

Definition at line 143 of file Constraint.h.

References m_dt.

◆ setExpression()

void te::da::CheckConstraint::setExpression ( const std::string & e)
inline

It sets the check constraint expression.

Parameters
nameThe check constraint expression.

Definition at line 112 of file CheckConstraint.h.

References m_expression.

◆ setId()

virtual void te::da::Constraint::setId ( unsigned int id)
inlinevirtualinherited

It sets the constraint identifier.

Parameters
idA number that identifies the constraint.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

Definition at line 112 of file Constraint.h.

References m_id.

◆ setName()

virtual void te::da::Constraint::setName ( const std::string & name)
inlinevirtualinherited

It sets the constraint name.

Parameters
nameThe constraint name.

Definition at line 126 of file Constraint.h.

References m_name.

Member Data Documentation

◆ m_dt

DataSetType* te::da::Constraint::m_dt
privateinherited

The associated DataSetType.

Definition at line 166 of file Constraint.h.

Referenced by getDataSetType(), and setDataSetType().

◆ m_expression

std::string te::da::CheckConstraint::m_expression
private

The check constraint expression.

Definition at line 132 of file CheckConstraint.h.

Referenced by getExpression(), and setExpression().

◆ m_id

unsigned int te::da::Constraint::m_id
privateinherited

An identification number for the constraint.

Definition at line 165 of file Constraint.h.

Referenced by getId(), and setId().

◆ m_name

std::string te::da::Constraint::m_name
privateinherited

The constraint name.

Definition at line 167 of file Constraint.h.

Referenced by getName(), and setName().


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