All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ComplexContent.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 // TerraLib
21 #include "Annotation.h"
22 #include "ComplexContent.h"
23 #include "TypeDerivation.h"
24 
25 // STL
26 #include <cassert>
27 
29  : Identifiable(id),
30  Annotated(ann),
31  m_mixed(false),
32  m_derivation(dev)
33 {
34 }
35 
37  : Identifiable(rhs),
38  Annotated(rhs),
39  m_mixed(rhs.m_mixed),
40  m_derivation(0)
41 {
43 }
44 
46 {
47  delete m_derivation;
48 }
49 
51 {
52  if(this != &rhs)
53  {
55 
57 
58  m_mixed = rhs.m_mixed;
59 
60  delete m_derivation;
61 
62  m_derivation = rhs.m_derivation ? m_derivation->clone() : 0;
63  }
64 
65  return *this;
66 }
67 
69 {
70  return m_mixed;
71 }
72 
74 {
75  return m_derivation;
76 }
77 
79 {
80  m_mixed = v;
81 }
82 
84 {
85  delete m_derivation;
86  m_derivation = t;
87 }
SimpleType, SimpleContent and ComplexContent can be extend other types. This is just a base class for...
ComplexContent & operator=(const ComplexContent &rhs)
Assignment operator.
bool isMixed()
If the ComplexContent is mixed or not.
TypeDerivation * getTypeDerivation() const
It returns the derivation type of this ComplexContent.
void setAsMixed(bool v)
It specifies whether character data is allowed to appear between the child elements of this complexTy...
It models an XML Schema complexContent element.
virtual TypeDerivation * clone() const =0
ComplexContent(TypeDerivation *dev=0, Annotation *ann=0, std::string *id=0)
Constructor.
void setTypeDerivation(TypeDerivation *t)
It sets the derivation type of this ComplexContent: (restriction | extension).
SimpleType, SimpleContent and ComplexContent can be used to extend other types. This is just a base c...
Annotated & operator=(const Annotated &rhs)
Assignment operator.
Definition: Annotated.cpp:57
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
TypeDerivation * m_derivation
It can be: restriction (Restriction4ComplexContent) | extension. (Required)
A class that models a XSD annotation element.
Definition: Annotation.h:55
bool m_mixed
It specifies whether character data is allowed to appear between the child elements of this complexTy...
Identifiable & operator=(const Identifiable &rhs)
Assignment operator.
~ComplexContent()
Destructor.
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49