OpenASIP  2.0
RelationalDBQueryResult.hh
Go to the documentation of this file.
1 /*
2  Copyright (c) 2002-2009 Tampere University.
3 
4  This file is part of TTA-Based Codesign Environment (TCE).
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23  */
24 /**
25  * @file RelationalDBQueryResult.hh
26  *
27  * Class definition of RelationalDBQueryResult interface.
28  *
29  * @author Pekka Jääskeläinen 2004 (pekka.jaaskelainen-no.spam-tut.fi)
30  *
31  * @note rating: red
32  */
33 
34 #ifndef TTA_RELATIONAL_DB_QUERY_RESULT_HH
35 #define TTA_RELATIONAL_DB_QUERY_RESULT_HH
36 
37 #include <string>
38 #include <cstddef>
39 
40 class DataObject;
41 
42 /**
43  * Classes that implement this interface can be used as relational database
44  * query result handles.
45  */
47 public:
48  virtual ~RelationalDBQueryResult();
49 
50  static const int UNKNOWN_INDEX = -1;
51  virtual int columns() const;
52  virtual int column(const std::string& name) const;
53  virtual std::string columnName(std::size_t columnIndex) const;
54  virtual const DataObject& data(std::size_t column) const = 0;
55  virtual const DataObject& data(const std::string& name) const;
56  virtual bool hasNext() = 0;
57  virtual bool next() = 0;
58  virtual void bindInt(unsigned int position, int value);
59  virtual void bindString(unsigned int position, const std::string& value);
60  virtual void reset();
61 };
62 
63 #endif
64 
DataObject
Definition: DataObject.hh:50
RelationalDBQueryResult::data
virtual const DataObject & data(std::size_t column) const =0
Definition: RelationalDBQueryResult.cc:96
RelationalDBQueryResult::reset
virtual void reset()
Definition: RelationalDBQueryResult.cc:163
RelationalDBQueryResult::UNKNOWN_INDEX
static const int UNKNOWN_INDEX
Definition: RelationalDBQueryResult.hh:50
RelationalDBQueryResult::hasNext
virtual bool hasNext()=0
Definition: RelationalDBQueryResult.cc:126
RelationalDBQueryResult::next
virtual bool next()=0
Definition: RelationalDBQueryResult.cc:138
RelationalDBQueryResult::bindString
virtual void bindString(unsigned int position, const std::string &value)
Definition: RelationalDBQueryResult.cc:154
RelationalDBQueryResult
Definition: RelationalDBQueryResult.hh:46
RelationalDBQueryResult::~RelationalDBQueryResult
virtual ~RelationalDBQueryResult()
Definition: RelationalDBQueryResult.cc:43
RelationalDBQueryResult::columnName
virtual std::string columnName(std::size_t columnIndex) const
Definition: RelationalDBQueryResult.cc:81
RelationalDBQueryResult::column
virtual int column(const std::string &name) const
Definition: RelationalDBQueryResult.cc:64
RelationalDBQueryResult::bindInt
virtual void bindInt(unsigned int position, int value)
Definition: RelationalDBQueryResult.cc:146
RelationalDBQueryResult::columns
virtual int columns() const
Definition: RelationalDBQueryResult.cc:53