Classes | Public Member Functions | Protected Member Functions

wb::visitor Class Reference

visitor: This is the "dynamic polymorphism" part. More...

#include <visitor.hpp>

Inheritance diagram for wb::visitor:
Inheritance graph
[legend]

List of all members.

Classes

struct  visitor_helper

Public Member Functions

virtual void visit (move_ptr move)=0
virtual void visit (attack_ptr attack)=0
virtual void visit (recruit_ptr recruit)=0
virtual void visit (recall_ptr recall)=0
virtual void visit (suppose_dead_ptr sup_d)=0

Protected Member Functions

 visitor ()
virtual ~visitor ()
bool process (size_t, team &, side_actions &, side_actions::iterator itor)
 This function is available for derived classes so they can inherit from enable_visit_all without having to override visit(); i.e., the below implementation can be used as a default.
void visit_all_actions ()

Detailed Description

visitor: This is the "dynamic polymorphism" part.

Abstract base class for all the visitors (cf GoF Visitor Design Pattern) the whiteboard uses. visitor does not inherit from enable_visit_all because it tends to make it more "difficult" for derived classes to inherit from both visitor and enable_visit_all.

Definition at line 138 of file visitor.hpp.


Constructor & Destructor Documentation

wb::visitor::visitor (  )  [inline, protected]

Definition at line 151 of file visitor.hpp.

virtual wb::visitor::~visitor (  )  [inline, protected, virtual]

Definition at line 152 of file visitor.hpp.


Member Function Documentation

bool wb::visitor::process ( size_t  ,
team ,
side_actions ,
side_actions::iterator  itor 
) [inline, protected]

This function is available for derived classes so they can inherit from enable_visit_all without having to override visit(); i.e., the below implementation can be used as a default.

Definition at line 159 of file visitor.hpp.

virtual void wb::visitor::visit ( attack_ptr  attack  )  [pure virtual]

Implemented in wb::validate_visitor.

virtual void wb::visitor::visit ( recruit_ptr  recruit  )  [pure virtual]

Implemented in wb::validate_visitor.

virtual void wb::visitor::visit ( suppose_dead_ptr  sup_d  )  [pure virtual]

Implemented in wb::validate_visitor.

virtual void wb::visitor::visit ( recall_ptr  recall  )  [pure virtual]

Implemented in wb::validate_visitor.

virtual void wb::visitor::visit ( move_ptr  move  )  [pure virtual]

Implemented in wb::validate_visitor.

Referenced by wb::suppose_dead::accept(), wb::recruit::accept(), wb::recall::accept(), and wb::move::accept().

Here is the caller graph for this function:

void wb::visitor::visit_all_actions (  )  [inline, protected]

Definition at line 163 of file visitor.hpp.

References wb::visitor::visitor_helper::visit_all_actions_helper().

Here is the call graph for this function:


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:26:42 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs