Loading...
Searching...
No Matches
te::da::Constraint Class Referenceabstract

#include <Constraint.h>

Inheritance diagram for te::da::Constraint:
te::da::CheckConstraint te::da::ForeignKey te::da::PrimaryKey te::da::UniqueKey

Public Member Functions

virtual Constraintclone ()=0
 It returns a clone of the object.
 
 Constraint (const Constraint &rhs)
 Copy constructor not allowed.
 
 Constraint (const std::string &name, unsigned int id=0)
 Constructor.
 
 Constraint (unsigned int id=0)
 Constructor.
 
virtual DataSetTypegetDataSetType () const
 It returns the DataSetType associated to the constraint.
 
virtual unsigned int getId () const
 It returns the constraint identifier.
 
virtual const std::string & getName () const
 It returns the constraint name.
 
virtual ConstraintType getType () const =0
 It returns the constraint type.
 
Constraintoperator= (const Constraint &rhs)
 Assignment operator not allowed.
 
virtual void setDataSetType (DataSetType *dt)
 It sets the DataSetType associated to the constraint.
 
virtual void setId (unsigned int id)
 It sets the constraint identifier.
 
virtual void setName (const std::string &name)
 It sets the constraint name.
 
virtual ~Constraint ()
 Virtual destructor.
 

Private Attributes

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

Detailed Description

Definition at line 50 of file Constraint.h.

Constructor & Destructor Documentation

◆ Constraint() [1/3]

te::da::Constraint::Constraint ( unsigned int id = 0)

Constructor.

Parameters
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 te::da::CheckConstraint::clone(), clone(), te::da::ForeignKey::clone(), te::da::PrimaryKey::clone(), te::da::UniqueKey::clone(), Constraint(), and operator=().

◆ Constraint() [2/3]

te::da::Constraint::Constraint ( const std::string & name,
unsigned int id = 0 )

Constructor.

Parameters
nameThe constraint name.
idThe constraint identifier.
Warning
The identifier value (id) may be used by data source implementations. So, don't rely on its value!

◆ Constraint() [3/3]

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

Copy constructor not allowed.

The new object will not have an associated DataSetType.

Parameters
rhsRight-hand-side instance.

References Constraint().

◆ ~Constraint()

virtual te::da::Constraint::~Constraint ( )
inlinevirtual

Virtual destructor.

Definition at line 85 of file Constraint.h.

Member Function Documentation

◆ clone()

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

It returns a clone of the object.

The new object will not have an associated DataSetType.

Returns
A clone of the object.

Implemented in te::da::CheckConstraint, te::da::ForeignKey, te::da::PrimaryKey, and te::da::UniqueKey.

References Constraint().

◆ getDataSetType()

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

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.

◆ getId()

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

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
inlinevirtual

It returns the constraint name.

Returns
The constraint name.

Definition at line 119 of file Constraint.h.

References m_name.

◆ getType()

virtual ConstraintType te::da::Constraint::getType ( ) const
pure virtual

It returns the constraint type.

Returns
The constraint type.
Note
Each child has to implement this method and return its specialized type.

Implemented in te::da::CheckConstraint, te::da::ForeignKey, te::da::PrimaryKey, and te::da::UniqueKey.

◆ operator=()

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

Assignment operator not allowed.

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

References Constraint().

◆ setDataSetType()

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

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.

◆ setId()

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

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)
inlinevirtual

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
private

The associated DataSetType.

Definition at line 166 of file Constraint.h.

Referenced by getDataSetType(), and setDataSetType().

◆ m_id

unsigned int te::da::Constraint::m_id
private

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
private

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: