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

Private Attributes

std::string m_expression
 The check constraint expression. More...
 

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

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!
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!
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.
te::da::CheckConstraint::~CheckConstraint ( )
inline

Destructor.

Definition at line 87 of file CheckConstraint.h.

Member Function Documentation

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.

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.

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.

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.

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.

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.

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.
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.

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.

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.

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.

Member Data Documentation

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

The check constraint expression.

Definition at line 132 of file CheckConstraint.h.


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