# Changeset 805:59b8cb2cb2f8 in lemon-0.x

Ignore:
Timestamp:
09/06/04 10:22:48 (16 years ago)
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1099
Message:

Changes in doc.

File:
1 edited

Unmodified
Added
Removed
• ## src/hugo/maps.h

 r720 /// Base class of maps. /// Base class of maps. /// It provides the necessary typedefs required by the map concept. template 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 /dev/null... template class NullMap : public MapBase 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 class ConstMap : public MapBase 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) {} /// \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; }
Note: See TracChangeset for help on using the changeset viewer.