~ubuntu-branches/ubuntu/hardy/libterralib/hardy

« back to all changes in this revision

Viewing changes to src/terralib/kernel/TeQuerierDBStr2.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel T Chen
  • Date: 2005-11-25 22:32:59 UTC
  • Revision ID: james.westby@ubuntu.com-20051125223259-3zubal8ux4ki4fjg
Tags: upstream-3.0.3b2
Import upstream version 3.0.3b2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/************************************************************************************
 
2
TerraLib - a library for developing GIS applications.
 
3
Copyright � 2001-2004 INPE and Tecgraf/PUC-Rio.
 
4
 
 
5
This code is part of the TerraLib library.
 
6
This library is free software; you can redistribute it and/or
 
7
modify it under the terms of the GNU Lesser General Public
 
8
License as published by the Free Software Foundation; either
 
9
version 2.1 of the License, or (at your option) any later version.
 
10
 
 
11
You should have received a copy of the GNU Lesser General Public
 
12
License along with this library.
 
13
 
 
14
The authors reassure the license terms regarding the warranties.
 
15
They specifically disclaim any warranties, including, but not limited to,
 
16
the implied warranties of merchantability and fitness for a particular purpose.
 
17
The library provided hereunder is on an "as is" basis, and the authors have no
 
18
obligation to provide maintenance, support, updates, enhancements, or modifications.
 
19
In no event shall INPE and Tecgraf / PUC-Rio be held liable to any party for direct,
 
20
indirect, special, incidental, or consequential damages arising out of the use
 
21
of this library and its documentation.
 
22
*************************************************************************************/
 
23
 
 
24
#ifndef  __TERRALIB_INTERNAL_QUERIER_DBSTR2_H
 
25
#define  __TERRALIB_INTERNAL_QUERIER_DBSTR2_H
 
26
 
 
27
#include "TeQuerierDB.h"
 
28
#include "TeTemporalSeries.h"
 
29
 
 
30
//! A class that implement a strategy to build STOs (Spatial Temporal Objects) from a TerraLib database (Strategy 2)
 
31
//! Strategy 2: simple chronon, without geometry, theme with collection table, operator exist in the database  
 
32
class TeQuerierDBStr2: public TeQuerierDB
 
33
{
 
34
        
 
35
private:
 
36
        int                             timeFramePortal_;  // the time frame appointed by the portal 
 
37
        TeTSEntry               TSEntry_;
 
38
        
 
39
        /* @name Internal functions to initialize portals */
 
40
        //@{
 
41
        bool initPortal(TeTSEntry* ent=0); 
 
42
        //@}
 
43
 
 
44
        //! Internal function to fill STO
 
45
        bool fillSTO(TeSTInstance& sto); 
 
46
        
 
47
public:
 
48
        
 
49
        //! Constructor
 
50
        TeQuerierDBStr2(TeQuerierParams& params): 
 
51
                TeQuerierDB(params), 
 
52
                timeFramePortal_(-1)
 
53
        {} 
 
54
 
 
55
        //! Loads the instances
 
56
        bool loadInstances(TeTSEntry* ent=0); 
 
57
 
 
58
        //! Returns each loaded STO
 
59
        bool fetchInstance(TeSTInstance&  sto); 
 
60
};
 
61
 
 
62
//! A class that define a factory to build a querier strategy from database(strategy 2)
 
63
class TeQuerierDBStr2Factory : public TeQuerierImplFactory
 
64
{
 
65
public:
 
66
 
 
67
        //! Constructor
 
68
        TeQuerierDBStr2Factory(const string& name) : TeQuerierImplFactory(name) {}
 
69
 
 
70
        //! Builds a database querier
 
71
        virtual TeQuerierImpl* build (const TeQuerierParams& arg)
 
72
        {  
 
73
                TeQuerierParams tempArg = arg;
 
74
                return new TeQuerierDBStr2(tempArg); 
 
75
        }
 
76
};
 
77
 
 
78
#endif