Added 'length' to area.
[UnsignedByte.git] / src / DAL / Table.h
blobcfb8388118eab7ebdc17d2abef0a764cbc37de1b
1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
4 * *
5 * This program 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, or *
8 * (at your option) any later version. *
9 * *
10 * This program 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 this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #pragma once
22 /**
23 * @file Table.h
24 * @brief This file contains the Table class.
26 * @see Table
27 */
29 #include "Types.h"
31 /**
32 * This class represents a table in the database.
34 * @deprecated This super class might be removed since it is not used much.
35 */
36 class Table
38 public:
39 /**
40 * Returns the name of this table.
42 * @deprecated use getName() instead.
43 * @see getName
45 const std::string& tableName() const;
47 /** Returns the name of this table. */
48 cstring getName() const;
51 /** Returns an iterator to the first element of the FieldDef's of this table. */
52 virtual FieldDefVector::const_iterator defbegin() const = 0;
54 /** Return an iterator to the 'end' iterator of the FieldDef's of this table. */
55 virtual FieldDefVector::const_iterator defend() const = 0;
57 /** Returns the size of the FieldDef's of this table. */
58 virtual size_t defsize() const = 0;
61 /** Returns the first key (it's name as an std::string). */
62 virtual std::string firstKey() const = 0;
64 /** Returns an iterator to the first Key definition pair. */
65 virtual TableMap::const_iterator keybegin() const = 0;
67 /** Returns the 'end' iterator of the Key definitions. */
68 virtual TableMap::const_iterator keyend() const = 0;
70 /** Returns the size of the Key definitions. */
71 virtual size_t keysize() const = 0;
73 /** Returns wether this table has a singular primary key. */
74 virtual bool hasSingularPrimaryKey() const = 0;
76 protected:
77 /** Creates a new table with the specified name. */
78 Table(std::string name);
80 /** Destructor, a noop. */
81 virtual ~Table();
83 friend SmartPtrDelete(Table);
85 std::string m_name; /**< The name of this table. */