Author: mordante
Date: Wed May 21 21:26:59 2008
New Revision: 26760
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26760&view=rev
Log:
Update doxygen comment style.
Modified:
trunk/src/unit_map.cpp
trunk/src/unit_map.hpp
Modified: trunk/src/unit_map.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_map.cpp?rev=26760&r1=26759&r2=26760&view=diff
==============================================================================
--- trunk/src/unit_map.cpp (original)
+++ trunk/src/unit_map.cpp Wed May 21 21:26:59 2008
@@ -12,8 +12,7 @@
See the COPYING file for more details.
*/
-//! @file unit_map.cpp
-//!
+/** @file unit_map.cpp */
#include "unit.hpp"
#include "unit_map.hpp"
@@ -29,7 +28,6 @@
typedef std::pair<std::string, std::pair<bool, std::pair<gamemap::location,
unit>*> > umap_pair;
-//! A unit map with a copy of a single unit in it.
unit_map::unit_map(const gamemap::location &loc, const unit &u) :
num_iters_(0), num_invalid_(0)
{
add(new std::pair<gamemap::location,unit>(loc, u));
@@ -442,7 +440,6 @@
map_.clear();
}
-//! Extract (like erase, but don't delete).
std::pair<gamemap::location,unit> *unit_map::extract(const gamemap::location
&loc)
{
lmap::iterator i = lmap_.find(loc);
Modified: trunk/src/unit_map.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_map.hpp?rev=26760&r1=26759&r2=26760&view=diff
==============================================================================
--- trunk/src/unit_map.hpp (original)
+++ trunk/src/unit_map.hpp Wed May 21 21:26:59 2008
@@ -12,8 +12,7 @@
See the COPYING file for more details.
*/
-//! @file unit_map.hpp
-//!
+/** @file unit_map.hpp */
#ifndef UNIT_MAP_H_INCLUDED
#define UNIT_MAP_H_INCLUDED
@@ -40,7 +39,11 @@
{
private:
- //! Used so unit_map can keep a count of iterators and clean invalid
pointers when no iterators exist. Every iterator and accessor has a counter
instance.
+ /**
+ * Used so unit_map can keep a count of iterators and clean invalid
pointers
+ * when no iterators exist. Every iterator and accessor has a counter
+ * instance.
+ */
struct iterator_counter {
iterator_counter() : map_(NULL) {}
iterator_counter(const unit_map* map) : map_(map)
@@ -72,14 +75,17 @@
unit_map() : num_iters_(0), num_invalid_(0) { };
unit_map(const unit_map &that);
unit_map &operator =(const unit_map &that);
- //! A unit map with a single unit in it.
+ /** A unit map with a copy of a single unit in it. */
explicit unit_map(const gamemap::location &loc, const unit &u);
~unit_map();
- //! Keyed with unit's underlying_id. bool flag is whether the following
pair pointer is valid. pointer to pair used to imitate a map<location, unit>
+ /**
+ * Keyed with unit's underlying_id. bool flag is whether the following
pair
+ * pointer is valid. pointer to pair used to imitate a map<location,
unit>
+ */
typedef std::map<std::string,std::pair<bool,
std::pair<gamemap::location,unit>*> > umap;
- //! Maps locations to the underlying_id() of the unit at that location.
+ /** Maps locations to the underlying_id() of the unit at that location.
*/
typedef std::map<gamemap::location, std::string> lmap;
struct const_unit_iterator;
@@ -88,7 +94,10 @@
struct xy_accessor;
struct const_xy_accessor;
- //! For iterating over every unit. Iterator is valid as long as there
is there is a unit w/ matching underlying_id in the map.
+ /**
+ * For iterating over every unit. Iterator is valid as long as there is
+ * there is a unit w/ matching underlying_id in the map.
+ */
struct unit_iterator
{
unit_iterator() { }
@@ -165,7 +174,10 @@
typedef unit_iterator iterator;
typedef const_unit_iterator const_iterator;
- //! Similar to unit_iterator, except that becomes invalid if unit is
moved while the iterator points at it.
+ /**
+ * Similar to unit_iterator, except that becomes invalid if unit is
moved
+ * while the iterator points at it.
+ */
struct unit_xy_iterator
{
unit_xy_iterator(const unit_iterator &i);
@@ -245,7 +257,10 @@
gamemap::location loc_;
};
- //! Used to access the unit at a given position. Is valid as long as
any unit is in that position. Can switch from invalid to valid.
+ /**
+ * Used to access the unit at a given position. Is valid as long as any
unit
+ * is in that position. Can switch from invalid to valid.
+ */
struct xy_accessor
{
xy_accessor(const unit_iterator &i);
@@ -289,11 +304,17 @@
gamemap::location loc_;
};
- //! Return object can be implicitly converted to any of the other
iterators or accessors
+ /**
+ * Return object can be implicitly converted to any of the other
iterators
+ * or accessors
+ */
unit_iterator find(const gamemap::location &loc) ;
unit_iterator find(const std::string &id);
- //! Return object can be implicity converted to any of the other const
iterators or accessors
+ /**
+ * Return object can be implicity converted to any of the other const
+ * iterators or accessors
+ */
const_unit_iterator find(const gamemap::location &loc) const;
const_unit_iterator find(const std::string &id) const;
@@ -301,10 +322,16 @@
return lmap_.count(loc);
}
- //! Return object can be implicitly converted to any of the other
iterators or accessors
+ /**
+ * Return object can be implicitly converted to any of the other
iterators
+ * or accessors
+ */
unit_iterator begin();
- //! Return object can be implicity converted to any of the other const
iterators or accessors
+ /**
+ * Return object can be implicity converted to any of the other const
+ * iterators or accessors
+ */
const_unit_iterator begin() const {
umap::const_iterator i = map_.begin();
while (i != map_.end() && !i->second.first) {
@@ -313,12 +340,18 @@
return const_unit_iterator(i, this);
}
- //! Return object can be implicitly converted to any of the other
iterators or accessors
+ /**
+ * Return object can be implicitly converted to any of the other
iterators
+ * or accessors
+ */
unit_iterator end() {
return iterator(map_.end(), this);
}
- //! Return object can be implicity converted to any of the other const
iterators or accessors
+ /**
+ * Return object can be implicity converted to any of the other const
+ * iterators or accessors
+ */
const_unit_iterator end() const {
return const_iterator(map_.end(), this);
}
@@ -329,13 +362,16 @@
void clear();
- //! Extract (like erase, only don't delete).
+ /** Extract (like erase, but don't delete). */
std::pair<gamemap::location,unit> *extract(const gamemap::location
&loc);
- //! Map owns pointer after this. Loc must be currently empty. unit's
underlying_id should not be present in the map already
+ /**
+ * Map owns pointer after this. Loc must be currently empty. unit's
+ * underlying_id should not be present in the map already
+ */
void add(std::pair<gamemap::location,unit> *p);
- //! Like add, but loc must be occupied (implicitly erased).
+ /** Like add, but loc must be occupied (implicitly erased). */
void replace(std::pair<gamemap::location,unit> *p);
void erase(xy_accessor pos);
@@ -348,7 +384,7 @@
private:
- //! Removes invalid entries in map_. Called automatically when safe and
needed.
+ /** Removes invalid entries in map_. Called automatically when safe and
needed. */
void clean_invalid();
void invalidate(umap::iterator i)
@@ -362,10 +398,16 @@
void remove_iter() const { --num_iters_; }
- //! Key: unit's underlying_id. bool indicates validity of pointer.
pointer to pair used to imitate a map<location, unit>
+ /**
+ * Key: unit's underlying_id. bool indicates validity of pointer.
pointer to
+ * pair used to imitate a map<location, unit>
+ */
std::map<std::string,std::pair<bool,
std::pair<gamemap::location,unit>*> > map_;
- //! location -> unit.underlying_id(). Unit_map is usually used as
though it is a map<location, unit> and so we need this map for efficient
access/modification.
+ /** location -> unit.underlying_id(). Unit_map is usually used as
though it
+ * is a map<location, unit> and so we need this map for efficient
+ * access/modification.
+ */
std::map<gamemap::location, std::string> lmap_;
mutable size_t num_iters_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits