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. More...
 
 Constraint (unsigned int id=0)
 Constructor. More...
 
 Constraint (const std::string &name, unsigned int id=0)
 Constructor. More...
 
 Constraint (const Constraint &rhs)
 Copy constructor not allowed. More...
 
virtual DataSetTypegetDataSetType () const
 It returns the DataSetType associated to the constraint. More...
 
virtual unsigned int getId () const
 It returns the constraint identifier. More...
 
virtual const std::string & getName () const
 It returns the constraint name. More...
 
virtual ConstraintType getType () const =0
 It returns the constraint type. More...
 
Constraintoperator= (const Constraint &rhs)
 Assignment operator not allowed. More...
 
virtual void setDataSetType (DataSetType *dt)
 It sets the DataSetType associated to the constraint. 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...
 
virtual ~Constraint ()
 Virtual destructor. More...
 

Private Attributes

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

Detailed Description

Definition at line 50 of file Constraint.h.

Constructor & Destructor Documentation

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!
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!
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.
virtual te::da::Constraint::~Constraint ( )
inlinevirtual

Virtual destructor.

Definition at line 85 of file Constraint.h.

Member Function Documentation

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::ForeignKey, te::da::UniqueKey, te::da::PrimaryKey, and te::da::CheckConstraint.

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.

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.

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.

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::ForeignKey, te::da::UniqueKey, te::da::PrimaryKey, and te::da::CheckConstraint.

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

Assignment operator not allowed.

Parameters
rhsRight-hand-side instance.
Returns
A reference to this object.
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.

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.

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.

Member Data Documentation

DataSetType* te::da::Constraint::m_dt
private

The associated DataSetType.

Definition at line 166 of file Constraint.h.

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

An identification number for the constraint.

Definition at line 165 of file Constraint.h.

std::string te::da::Constraint::m_name
private

The constraint name.

Definition at line 167 of file Constraint.h.


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