All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
KeyRef.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 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 General Public License for more details.
14 
15  You should have received a copy of the GNU 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 KeyRef.cpp
22 
23  \brief This class models a keyref element from a XML Schema element.
24 */
25 
26 // TerraLib
27 #include "KeyRef.h"
28 #include "QName.h"
29 
30 // STL
31 #include <cassert>
32 
33 te::xsd::KeyRef::KeyRef(QName* refer, std::string* name, Annotation* ann, std::string* id)
34  : IdentityConstraint(name, ann, id),
35  m_ref(refer)
36 {
37  assert(m_ref);
38 }
39 
41  : IdentityConstraint(rhs)
42 {
43 }
44 
46 {
47  delete m_ref;
48 }
49 
51 {
52  return *this;
53 }
54 
56 {
57  return m_ref;
58 }
59 
61 {
62  assert(ref);
63  delete m_ref;
64  m_ref = ref;
65 }
66 
68 {
69  return new KeyRef(*this);
70 }
void setRef(QName *ref)
It sets a reference to a named attribute.
Definition: KeyRef.cpp:60
This class models a keyref element from a XML Schema element.
A class to deal with XML qualified names.
QName * getRef() const
It returns the reference to a named element.
Definition: KeyRef.cpp:55
~KeyRef()
Destructor.
Definition: KeyRef.cpp:45
This is the base class for XML Schema elements that are related to identity constraint.
QName * m_ref
It specifies the name of a key or unique element defined in this or another schema. (Required)
Definition: KeyRef.h:104
A class to be used to represent XML qualified names.
Definition: QName.h:49
This class models a keyref element from a XML Schema element.
Definition: KeyRef.h:46
IdentityConstraint * clone() const
It clones the object.
Definition: KeyRef.cpp:67
KeyRef(QName *refer, std::string *name, Annotation *ann=0, std::string *id=0)
Constructor.
Definition: KeyRef.cpp:33
KeyRef & operator=(const KeyRef &rhs)
Assignment operator.
Definition: KeyRef.cpp:50
A class that models a XSD annotation element.
Definition: Annotation.h:55