g4tools  5.4.0
Public Types | Public Member Functions | Protected Attributes | List of all members
tools::sg::search_action Class Reference
Inheritance diagram for tools::sg::search_action:
Inheritance graph
[legend]
Collaboration diagram for tools::sg::search_action:
Collaboration graph
[legend]

Public Types

enum  search_what { search_node_of_class = 0, search_path_to_node = 1, search_path_to_node_of_class = 2 }
 
typedef std::vector< sg::node * > path_t
 
typedef std::vector< path_tpaths_t
 

Public Member Functions

 search_action (std::ostream &a_out)
 
virtual ~search_action ()
 
 search_action (const search_action &a_from)
 
search_actionoperator= (const search_action &a_from)
 
void reset ()
 
search_what what () const
 
void set_what (search_what a_v)
 
void set_done (bool a_value)
 
bool done () const
 
bool stop_at_first () const
 
void set_stop_at_first (bool a_v)
 
void add_obj (void *a_obj)
 search_node_of_class : /////////////////////////////// More...
 
const std::vector< void * > & objs () const
 
void set_class (const std::string &a_class)
 
const std::string & sclass () const
 
void set_node (sg::node *a_v)
 search_path_to_node : //////////////////////////////// More...
 
sg::nodenode () const
 
void path_push (sg::node *a_v)
 
void path_pop ()
 
const path_tpath () const
 
void clear_path ()
 
bool do_path () const
 
void add_path (const path_t &a_p)
 search_path_to_node_of_class : /////////////////////// More...
 
const paths_tpaths () const
 
- Public Member Functions inherited from tools::sg::action
virtual void * cast (const std::string &a_class) const
 
virtual const std::string & s_cls () const =0
 
 action (std::ostream &a_out)
 
virtual ~action ()
 
std::ostream & out () const
 

Protected Attributes

search_what m_what
 
bool m_stop_at_first
 
std::string m_class
 
std::vector< void * > m_objs
 
sg::nodem_node
 
path_t m_path
 
std::vector< path_tm_paths
 
bool m_done
 
- Protected Attributes inherited from tools::sg::action
std::ostream & m_out
 

Additional Inherited Members

- Protected Member Functions inherited from tools::sg::action
 action (const action &a_from)
 
actionoperator= (const action &)
 

Detailed Description

Definition at line 19 of file search_action.

Member Typedef Documentation

◆ path_t

Definition at line 93 of file search_action.

◆ paths_t

Definition at line 109 of file search_action.

Member Enumeration Documentation

◆ search_what

Enumerator
search_node_of_class 
search_path_to_node 
search_path_to_node_of_class 

Definition at line 59 of file search_action.

59  {
63  };

Constructor & Destructor Documentation

◆ search_action() [1/2]

tools::sg::search_action::search_action ( std::ostream &  a_out)
inline

Definition at line 22 of file search_action.

23  :parent(a_out)
25  ,m_stop_at_first(false)
26  ,m_node(0) //not owner
27 
28  ,m_done(false)
29  {}

◆ ~search_action()

virtual tools::sg::search_action::~search_action ( )
inlinevirtual

Definition at line 30 of file search_action.

30 {}

◆ search_action() [2/2]

tools::sg::search_action::search_action ( const search_action a_from)
inline

Definition at line 32 of file search_action.

33  :parent(a_from)
34  ,m_what(a_from.m_what)
35  ,m_stop_at_first(a_from.m_stop_at_first)
36  ,m_class(a_from.m_class)
37  ,m_node(a_from.m_node)
38 
39  ,m_done(false)
40  {}

Member Function Documentation

◆ add_obj()

void tools::sg::search_action::add_obj ( void *  a_obj)
inline

search_node_of_class : ///////////////////////////////

Definition at line 78 of file search_action.

78 {m_objs.push_back(a_obj);}

◆ add_path()

void tools::sg::search_action::add_path ( const path_t a_p)
inline

search_path_to_node_of_class : ///////////////////////

Definition at line 107 of file search_action.

107 {m_paths.push_back(a_p);}

◆ clear_path()

void tools::sg::search_action::clear_path ( )
inline

Definition at line 96 of file search_action.

96 {m_path.clear();}

◆ do_path()

bool tools::sg::search_action::do_path ( ) const
inline

Definition at line 98 of file search_action.

98  {
101  return false;
102  }

◆ done()

bool tools::sg::search_action::done ( ) const
inline

Definition at line 68 of file search_action.

68 {return m_done;}

◆ node()

sg::node* tools::sg::search_action::node ( ) const
inline

Definition at line 88 of file search_action.

88 {return m_node;}

◆ objs()

const std::vector<void*>& tools::sg::search_action::objs ( ) const
inline

Definition at line 79 of file search_action.

79 {return m_objs;}

◆ operator=()

search_action& tools::sg::search_action::operator= ( const search_action a_from)
inline

Definition at line 41 of file search_action.

41  {
42  parent::operator=(a_from);
43  if(&a_from==this) return *this;
44  m_what = a_from.m_what;
45  m_stop_at_first = a_from.m_stop_at_first;
46  m_class = a_from.m_class;
47  m_node = a_from.m_node;
48  reset();
49  return *this;
50  }

◆ path()

const path_t& tools::sg::search_action::path ( ) const
inline

Definition at line 94 of file search_action.

94 {return m_path;}

◆ path_pop()

void tools::sg::search_action::path_pop ( )
inline

Definition at line 91 of file search_action.

91 {m_path.pop_back();}

◆ path_push()

void tools::sg::search_action::path_push ( sg::node a_v)
inline

Definition at line 90 of file search_action.

90 {m_path.push_back(a_v);}

◆ paths()

const paths_t& tools::sg::search_action::paths ( ) const
inline

Definition at line 110 of file search_action.

110 {return m_paths;}

◆ reset()

void tools::sg::search_action::reset ( )
inline

Definition at line 52 of file search_action.

52  {
53  m_done = false;
54  m_objs.clear();
55  m_path.clear();
56  m_paths.clear();
57  }

◆ sclass()

const std::string& tools::sg::search_action::sclass ( ) const
inline

Definition at line 82 of file search_action.

82 {return m_class;}

◆ set_class()

void tools::sg::search_action::set_class ( const std::string &  a_class)
inline

Definition at line 81 of file search_action.

81 {m_class = a_class;}

◆ set_done()

void tools::sg::search_action::set_done ( bool  a_value)
inline

Definition at line 67 of file search_action.

67 {m_done = a_value;}

◆ set_node()

void tools::sg::search_action::set_node ( sg::node a_v)
inline

search_path_to_node : ////////////////////////////////

Definition at line 87 of file search_action.

87 {m_node = a_v;}

◆ set_stop_at_first()

void tools::sg::search_action::set_stop_at_first ( bool  a_v)
inline

Definition at line 71 of file search_action.

71 {m_stop_at_first = a_v;}

◆ set_what()

void tools::sg::search_action::set_what ( search_what  a_v)
inline

Definition at line 65 of file search_action.

65 {m_what = a_v;}

◆ stop_at_first()

bool tools::sg::search_action::stop_at_first ( ) const
inline

Definition at line 70 of file search_action.

70 {return m_stop_at_first;}

◆ what()

search_what tools::sg::search_action::what ( ) const
inline

Definition at line 64 of file search_action.

64 {return m_what;}

Member Data Documentation

◆ m_class

std::string tools::sg::search_action::m_class
protected

Definition at line 117 of file search_action.

◆ m_done

bool tools::sg::search_action::m_done
protected

Definition at line 127 of file search_action.

◆ m_node

sg::node* tools::sg::search_action::m_node
protected

Definition at line 121 of file search_action.

◆ m_objs

std::vector<void*> tools::sg::search_action::m_objs
protected

Definition at line 118 of file search_action.

◆ m_path

path_t tools::sg::search_action::m_path
protected

Definition at line 122 of file search_action.

◆ m_paths

std::vector<path_t> tools::sg::search_action::m_paths
protected

Definition at line 125 of file search_action.

◆ m_stop_at_first

bool tools::sg::search_action::m_stop_at_first
protected

Definition at line 114 of file search_action.

◆ m_what

search_what tools::sg::search_action::m_what
protected

Definition at line 113 of file search_action.


The documentation for this class was generated from the following file:
tools::sg::search_action::m_stop_at_first
bool m_stop_at_first
Definition: search_action:114
tools::sg::search_action::m_objs
std::vector< void * > m_objs
Definition: search_action:118
tools::sg::search_action::search_path_to_node
@ search_path_to_node
Definition: search_action:61
tools::sg::search_action::m_class
std::string m_class
Definition: search_action:117
tools::sg::search_action::search_node_of_class
@ search_node_of_class
Definition: search_action:60
tools::sg::search_action::m_paths
std::vector< path_t > m_paths
Definition: search_action:125
tools::sg::search_action::m_done
bool m_done
Definition: search_action:127
tools::sg::search_action::m_path
path_t m_path
Definition: search_action:122
tools::sg::search_action::search_path_to_node_of_class
@ search_path_to_node_of_class
Definition: search_action:62
tools::sg::search_action::m_what
search_what m_what
Definition: search_action:113
tools::sg::search_action::reset
void reset()
Definition: search_action:52
tools::sg::search_action::m_node
sg::node * m_node
Definition: search_action:121