cgv
Loading...
Searching...
No Matches
cgv::base::matched_method_action< X, R1, R2, T1 > Class Template Reference

complete implementation of method actions that call a begin and end method when entering and leaving a node More...

#include <action.h>

Inheritance diagram for cgv::base::matched_method_action< X, R1, R2, T1 >:
cgv::base::method_action< X, T1 > cgv::base::base_method_action< X > cgv::base::action

Public Member Functions

 matched_method_action (T1 _v1, R1(X::*_on_begin)(T1), R2(X::*_on_end)(T1), bool _default_result_begin, bool _default_result_end)
 construct from signature, method pointers and default result values
 
bool begin ()
 uses call_method of base class method_action to call the method refered to by the stored method pointer
 
bool end ()
 uses call_method of base class method_action to call the method refered to by the stored method pointer
 
- Public Member Functions inherited from cgv::base::method_action< X, T1 >
 method_action (T1 _v1, bool _default_result_begin, bool _default_result_end)
 construct action from signature and default return values
 
void set_signature (T1 _v1)
 set a new signature with which the methods of the traversed nodes are called
 
bool call_method (void(X::*mp)(T1), bool default_result)
 call a void method given a default return value
 
bool call_method (bool(X::*mp)(T1), bool default_result)
 call a bool method given a default return value
 
- Public Member Functions inherited from cgv::base::base_method_action< X >
 base_method_action (bool _default_result_begin, bool _default_result_end)
 construct from default return values that are passed on to the base class
 
void select (base_ptr p)
 implement the select method and store pointers of type X* and traverse_policy*
 
bool implements_action () const
 simply return whether the stored pointer of type X* is not 0
 
traverse_policyget_policy () const
 simply return the stored pointer of type traverse_policy*
 
- Public Member Functions inherited from cgv::base::action
 action (bool _default_result_begin, bool _default_result_end)
 construct with default return values for the begin and end method
 
void set_default_results (bool _default_result)
 sets the value that is returned, whenever no result is obtained from the traversed methods
 
void set_default_result_begin (bool _default_result_begin)
 sets the value that is returned for on_begin events
 
void set_default_result_end (bool _default_result_end)
 sets the value that is returned for on_end events
 
virtual bool has_begin_only () const
 check whether the action has registered a single begin method or both begin and end methods
 

Protected Attributes

R1(X::* on_begin )(T1)
 
R2(X::* on_end )(T1)
 
- Protected Attributes inherited from cgv::base::method_action< X, T1 >
T1 v1
 
- Protected Attributes inherited from cgv::base::base_method_action< X >
traverse_policytp
 
X * x
 
- Protected Attributes inherited from cgv::base::action
bool default_result_begin
 
bool default_result_end
 

Detailed Description

template<class X, typename R1, typename R2, typename T1>
class cgv::base::matched_method_action< X, R1, R2, T1 >

complete implementation of method actions that call a begin and end method when entering and leaving a node

Definition at line 129 of file action.h.

Constructor & Destructor Documentation

◆ matched_method_action()

template<class X , typename R1 , typename R2 , typename T1 >
cgv::base::matched_method_action< X, R1, R2, T1 >::matched_method_action ( T1  _v1,
R1(X::*)(T1 _on_begin,
R2(X::*)(T1 _on_end,
bool  _default_result_begin,
bool  _default_result_end 
)
inline

construct from signature, method pointers and default result values

Definition at line 136 of file action.h.

Member Function Documentation

◆ begin()

template<class X , typename R1 , typename R2 , typename T1 >
bool cgv::base::matched_method_action< X, R1, R2, T1 >::begin ( )
inlinevirtual

uses call_method of base class method_action to call the method refered to by the stored method pointer

Reimplemented from cgv::base::action.

Definition at line 139 of file action.h.

References cgv::base::method_action< X, T1 >::call_method().

◆ end()

template<class X , typename R1 , typename R2 , typename T1 >
bool cgv::base::matched_method_action< X, R1, R2, T1 >::end ( )
inlinevirtual

uses call_method of base class method_action to call the method refered to by the stored method pointer

Reimplemented from cgv::base::action.

Definition at line 141 of file action.h.

References cgv::base::method_action< X, T1 >::call_method().

Member Data Documentation

◆ on_begin

template<class X , typename R1 , typename R2 , typename T1 >
R1(X::* cgv::base::matched_method_action< X, R1, R2, T1 >::on_begin) (T1)
protected

Definition at line 132 of file action.h.

◆ on_end

template<class X , typename R1 , typename R2 , typename T1 >
R2(X::* cgv::base::matched_method_action< X, R1, R2, T1 >::on_end) (T1)
protected

Definition at line 133 of file action.h.


The documentation for this class was generated from the following file: