| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeQuerierDBStr1.h
Go to the documentation of this file.

    00001 /************************************************************************************
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright © 2001-2007 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular purpose.
    00017 The library provided hereunder is on an "as is" basis, and the authors have no
    00018 obligation to provide maintenance, support, updates, enhancements, or modifications.
    00019 In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
    00020 indirect, special, incidental, or consequential damages arising out of the use
    00021 of this library and its documentation.
    00022 *************************************************************************************/
    00023
    00029 #ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR1_H
    00030 #define  __TERRALIB_INTERNAL_QUERIER_DBSTR1_H
    00031
    00032 #include "TeQuerierDB.h"
    00033
    00046 class TL_DLL TeQuerierDBStr1 : public TeQuerierDB
    00047 {
    00048 private:
    00049            vector<string>                                         uniqueNames_;
    00050            string                                                            lastObjId_;
    00051            int                                                                          geomId_;
    00052            bool                                                              isGroup_;
    00053            bool                                                              groupInMemory_;
    00054            string                                                            linkName_;
    00055
    00056            string                                                            fromClause_;   //store the sql clause(from and where) to return the number of instances
    00057            string                                                            whereClause_;
    00058
    00059            /* @name Internal functions to initialize portals */
    00061            bool initPortal(TeRepresentation& rep, TeTSEntry* ent=0);
    00062            bool initGeomPortal(TeRepresentation& rep, TeTSEntry* ent=0);
    00064
    00065            /* @name Internal functions to fill the STOs from portals */
    00067            bool fillSTOGrouped(TeSTInstance& sto, bool fetchInstance = true);
    00068            bool fillSTONoGrouped(TeSTInstance& sto);
    00069            bool fillGeomSTO(TeSTInstance& sto, unsigned int index);
    00071
    00072 public:
    00074            TeQuerierDBStr1(TeQuerierParams* params) :
    00075                       TeQuerierDB(params),
    00076                       lastObjId_(""),
    00077                       isGroup_(false),
    00078                       groupInMemory_(false),
    00079                       linkName_(""),
    00080                       fromClause_(""),
    00081                       whereClause_("")
    00082            {}
    00083
    00085            bool loadInstances(TeTSEntry* ent=0);
    00086
    00088            bool fetchInstance(TeSTInstance&  sto);
    00089
    00091            int numElemInstances();
    00092 };
    00093
    00100 class TL_DLL TeQuerierDBStr1Factory : public TeQuerierImplFactory
    00101 {
    00102 public:
    00104            TeQuerierDBStr1Factory(const string& name) : TeQuerierImplFactory(name) {}
    00105
    00107            virtual TeQuerierImpl* build (const TeQuerierParams& arg)
    00108            {
    00109                       TeQuerierParams* tempArg = new TeQuerierParams();
    00110                       *tempArg = arg;
    00111                       return new TeQuerierDBStr1(tempArg);
    00112            }
    00113 };
    00114
    00116 namespace
    00117 {
    00118   static TeQuerierDBStr1Factory querierDBStr1("querierDBStr1");
    00119 };
    00120
    00121
    00122 #endif
    00123

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines