Type.h
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 Type.h
22 
23  \brief An abstract class for modeling the definition of a new XML Schema Type.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_TYPE_H
27 #define __TERRALIB_XSD_INTERNAL_TYPE_H
28 
29 // TerraLib
30 #include "Config.h"
31 
32 // STL
33 #include <string>
34 
35 namespace te
36 {
37  namespace xsd
38  {
39  /*!
40  \class Type
41 
42  \brief An abstract class for modeling the definition of a new XML Schema Type.
43 
44  A type can be a:
45  <ul>
46  <li>simple built-in type: like string, integer, list-of-simple-type or union-of-simple-types</li>
47  <li>simple type: user defined</li>
48  <li>complex type: user defined</li>
49  </ul>
50 
51  We also must remember from W3C's XML Schema Specification that a type can be unnamed,
52  i. e., it can be declared inside an element definition or another type declaration without
53  an explicit name.
54 
55  Another important concept in this framework is the use of "pointer of pointers" when referencing a type.
56  This is a way of allowing the user of the API do what he wants. For example, when reading a XML schema
57  you can create a NULL pointer and insert it into the schema, so the element declaration can reference
58  this pointer before the type gets read.
59 
60  Note that all types and elements belongs to the schema object. So no other object will delete a type definition
61  or a element declaration in its destructor. The schema object will free the memory.
62 
63  \sa ComplexType, SimpleType, SimpleBuiltInType
64  */
66  {
67  public:
68 
69  Type() {}
70 
71  virtual ~Type() {}
72 
73  virtual Type* clone() const = 0;
74  };
75 
76  } // end namespace xsd
77 } // end namespace te
78 
79 #endif // __TERRALIB_XSD_INTERNAL_TYPE_H
Configuration flags for the XSD Module of TerraLib.
virtual ~Type()
Definition: Type.h:71
URI C++ Library.
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:57
An abstract class for modeling the definition of a new XML Schema Type.
Definition: Type.h:65