All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Restriction4ComplexContent.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2010-2012 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 Restriction4ComplexContent.cpp
22 
23  \brief The restriction class can be used to define restrictions on a complexContent.
24 */
25 
26 // TerraLib
27 #include "AbstractAttribute.h"
28 #include "AnyAttribute.h"
29 #include "Content.h"
31 #include "QName.h"
32 
33 // STL
34 #include <cassert>
35 
37  : Identifiable(id),
38  Annotated(0),
39  m_base(base),
40  m_content(0),
41  m_anyAttr(0)
42 {
43  assert(base);
44 }
45 
47 {
48  delete m_base;
49  delete m_content;
50  delete m_anyAttr;
51 }
52 
54 {
55  return m_base;
56 }
57 
59 {
60  return m_content;
61 }
62 
64 {
65  return m_anyAttr;
66 }
67 
69 {
70  delete m_base;
71  m_base = base;
72 }
73 
75 {
76  delete m_content;
77  m_content = c;
78 }
79 
81 {
82  m_attributeVec.push_back(a);
83 }
84 
86 {
87  delete m_anyAttr;
88  m_anyAttr = a;
89 }
QName * getBase() const
It returns the name of a built-in data type, simple type or complex type that will be restricted...
This is the base class for XML Schema Attribute classes.
void setAnyAttribute(AnyAttribute *a)
It sets the anyAttribute to this restriction.
AnyAttribute * getAnyAttribute() const
It returns the anyAttribute defined on this restriction.
A base class for elements that are not definitions nor declarations. This class is just for creating ...
This is the base class for XML Schema Attribute classes.
Content * getContent() const
It returns the content of this restriction.
void addAttribute(AbstractAttribute *a)
It adds an attribute to this restriction.
A base class for elements that are not definitions nor declarations. This class is just for creating ...
Definition: Content.h:43
void setBase(QName *base)
It sets the name of a built-in data type, simple type or complex type that will be restricted...
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
It models an XML anyAttribute element.
Definition: AnyAttribute.h:49
void setContent(Content *c)
It sets the group content. It can be one of: group |all | choice | sequence.
Restriction4ComplexContent(std::string *id, QName *base)
Constructor.
A class to be used to represent XML qualified names.
Definition: QName.h:49
A class to deal with XML qualified names.
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49