All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CheckConstraint.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/dataaccess/dataset/CheckConstraint.cpp
22 
23  \brief A class that describes a check constraint.
24 */
25 
26 // TerraLib
27 #include "../../datatype/Property.h"
28 #include "CheckConstraint.h"
29 #include "DataSetType.h"
30 
32  : Constraint(id)
33 {
34  if(dt)
35  dt->add(this);
36 }
37 
39  DataSetType* dt,
40  unsigned int id)
41  : Constraint(name, id)
42 {
43  if(dt)
44  dt->add(this);
45 }
46 
48  : Constraint(rhs),
49  m_expression(rhs.m_expression)
50 {
51 }
52 
54 {
55  if(this != &rhs)
56  {
58 
59  m_expression = rhs.m_expression;
60  }
61 
62  return *this;
63 }
64 
66 {
67  return new CheckConstraint(*this);
68 }
CheckConstraint(DataSetType *dt=0, unsigned int id=0)
Constructor.
A class that models the description of a dataset.
Definition: DataSetType.h:72
Constraint & operator=(const Constraint &rhs)
Assignment operator not allowed.
Definition: Constraint.cpp:52
A class that describes a check constraint.
std::string m_expression
The check constraint expression.
Constraint * clone()
It returns a clone of the object.
A class that describes a check constraint.
void add(Constraint *c)
It adds a new constraint.
A class that models the description of a dataset.
CheckConstraint & operator=(const CheckConstraint &rhs)
Assignment operator.