Public Member Functions | Protected Member Functions | Private Member Functions

wb::enable_visit_all< Derived > Class Template Reference

enable_visit_all: A base class template, using the so-called CRTP. More...

#include <visitor.hpp>

List of all members.

Public Member Functions

void visit_all ()
void reverse_visit_all ()

Protected Member Functions

bool pre_visit_team (size_t, size_t, team &, side_actions &sa)
 visit():
bool post_visit_team (size_t, size_t, team &, side_actions &)

Private Member Functions

void visit_all_helper (const bool reverse)

Detailed Description

template<typename Derived>
class wb::enable_visit_all< Derived >

enable_visit_all: A base class template, using the so-called CRTP.

This is the "static polymorphism" part. If you want visit_all() and reverse_visit_all() in your class, you should derive from this class template. Derived classes can "override" the following: visit (required), pre_visit_team, post_visit_team Derived classes should declare enable_visit_all<Derived> as a friend, or else make the overridden functions public.

Definition at line 56 of file visitor.hpp.


Member Function Documentation

template<typename Derived>
bool wb::enable_visit_all< Derived >::post_visit_team ( size_t  ,
size_t  ,
team ,
side_actions  
) [inline, protected]
Returns:
Whether or not to visit any more teams after this one.

Reimplemented in wb::mapbuilder.

Definition at line 73 of file visitor.hpp.

template<typename Derived>
bool wb::enable_visit_all< Derived >::pre_visit_team ( size_t  ,
size_t  ,
team ,
side_actions sa 
) [inline, protected]

visit():

Returns:
Whether or not to continue any visitation after this action. The fcn is commented out because derived classes are required to implement it.
Whether or not to visit any of the contents of sa.

Reimplemented in wb::mapbuilder.

Definition at line 71 of file visitor.hpp.

template<typename Derived>
void wb::enable_visit_all< Derived >::reverse_visit_all (  )  [inline]

Definition at line 60 of file visitor.hpp.

template<typename Derived>
void wb::enable_visit_all< Derived >::visit_all (  )  [inline]

Definition at line 59 of file visitor.hpp.

Referenced by wb::visitor::visitor_helper::visit_all_actions_helper().

Here is the caller graph for this function:

template<typename Derived>
void wb::enable_visit_all< Derived >::visit_all_helper ( const bool  reverse  )  [inline, private]

Definition at line 76 of file visitor.hpp.

Referenced by wb::enable_visit_all< visitor_helper >::reverse_visit_all(), and wb::enable_visit_all< visitor_helper >::visit_all().

Here is the caller 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:41 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs