Classes | Namespaces

whiteboard/visitor.hpp File Reference

Two classes are presented in this file: enable_visit_all and visitor. More...

#include "action.hpp"
#include "side_actions.hpp"
#include "foreach.hpp"
#include "play_controller.hpp"
#include "resources.hpp"
#include <boost/noncopyable.hpp>
Include dependency graph for visitor.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  wb::enable_visit_all< Derived >
 enable_visit_all: A base class template, using the so-called CRTP. More...
class  wb::visitor
 visitor: This is the "dynamic polymorphism" part. More...
struct  wb::visitor::visitor_helper

Namespaces

namespace  wb

Detailed Description

Two classes are presented in this file: enable_visit_all and visitor.

enable_visit_all is a class template that provides the all-too-common iteration code that iterates over every planned action from every team, starting with the current-turn team. Using "static polymorphism," derived classes can customize the iteration by overriding some functions. visitor is an abstract interface that simply provides derived classes with the mechanism for the double dispatch used in the Visitor Pattern: action.accept(visitor) calls visitor.visit_***(action) Derived classes will usually derive from both of these. Example usage is seen is highlight_visitor and mapbuilder.

Definition in file visitor.hpp.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:11:12 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs