[Lemon-commits] [lemon_svn] alpar: r1099 - hugo/trunk/src/hugo
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:43:14 CET 2006
Author: alpar
Date: Mon Sep 6 10:22:48 2004
New Revision: 1099
Modified:
hugo/trunk/src/hugo/maps.h
Log:
Changes in doc.
Modified: hugo/trunk/src/hugo/maps.h
==============================================================================
--- hugo/trunk/src/hugo/maps.h (original)
+++ hugo/trunk/src/hugo/maps.h Mon Sep 6 10:22:48 2004
@@ -14,45 +14,54 @@
/// Base class of maps.
+ /// Base class of maps.
+ /// It provides the necessary <tt>typedef</tt>s required by the map concept.
template<typename K, typename T>
class MapBase
{
public:
- ///
+ /// .
typedef K KeyType;
- ///
+ /// .
typedef T ValueType;
};
- /// Null map. (aka DoNothingMap)
+ /// Null map. (a.k.a. DoNothingMap)
/// If you have to provide a map only for its type definitions,
- /// or if you have to provide a writable map, but will not use the
- /// data written to it...
+ /// or if you have to provide a writable map, but
+ /// data written to it will sent to <tt>/dev/null</tt>...
template<typename K, typename T>
class NullMap : public MapBase<K,T>
{
public:
+ /// Gives back a default constructed element.
T operator[](const K&) const { return T(); }
+ /// Absorbs the value.
void set(const K&, const T&) {}
- ///\bug when update is removed from map concepts by being dynamic
- ///stuffs, this line have to be removed.
- void update() { }
};
/// Constant map.
- /// This is a readable map which assignes a specified value to each key.
- /// In other aspects it is equivalent to the \ref NullMap
+ /// This is a readable map which assigns a specified value to each key.
+ /// In other aspects it is equivalent to the \ref NullMap.
+ /// \todo set could be used to set the value.
template<typename K, typename T>
class ConstMap : public MapBase<K,T>
{
T v;
public:
+ /// Default constructor
+
+ /// The value of the map will be uninitialized.
+ /// (More exactly it will be default constructed.)
ConstMap() {}
+ /// .
+
+ /// \param _v The initial value of the map.
ConstMap(const T &_v) : v(_v) {}
T operator[](const K&) const { return v; }
@@ -123,7 +132,7 @@
/// Changes the default value of the map.
/// \return Returns the previous default value.
///
- /// \warning The value of some keys (which has alredy been queried, but
+ /// \warning The value of some keys (which has already been queried, but
/// the value has been unchanged from the default) may change!
T setDefault(const T &_v) { T old=v; v=_v; return old; }
More information about the Lemon-commits
mailing list