1 /***************************************************************************
2 * Copyright (C) 2008 by Sverre Rabbelier *
3 * sverre@rabbelier.nl *
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. *
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. *
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 ***************************************************************************/
24 * @brief This file contains the FieldValues bucket class.
33 * This class is a bucket for Value objects.
35 * It will hold any Value objects for the table it was constructed for.
36 * Value objects cann be added through the <code>addValue</code> function.
37 * Also, any tables added with <code>addJoinedTable</code> are allowed.
46 /** Constuct a new Values bucket for fields of this specific table. */
47 FieldValues(TableImplPtr table
);
49 /** Destructor, a noop */
52 /** Returns the table this Values bucket is for. */
53 TableImplPtr
getTable() const;
55 /** Add a Value, this value is run-time asserted to be of the proper table. */
56 void addValue(ValuePtr key
);
58 /** Add a table from which Value's may be added. */
59 void addJoinedTable(TableImplPtr joinedTable
);
62 /** Returns the number of added fields. */
65 /** Returns the first stored Value. */
66 ValuePtr
first() const;
68 /** Returns an iterator to the first stored value. */
69 ValueMap::const_iterator
begin() const;
71 /** Returns an iterator to the 'end' iterator. */
72 ValueMap::const_iterator
end() const;
74 /** Returns an iterator to the result of 'find' with this specific field as argument. */
75 ValueMap::const_iterator
find(FieldImplPtr field
) const;
77 /** Returns a Value for this field, asserted not to be the 'end' iterator. */
78 ValuePtr
getField(FieldImplPtr field
) const;
81 TableImplPtr m_table
; /**< A member containing the table this Values bucket is for. */
82 ValueMap m_fields
; /**< A member containing the Value's that have been added. */
83 TableImplVector m_joinedTables
; /**< A member containing the joined tables. */