OpenCog Framework  Branch: master, revision 6f0b7fc776b08468cf1b74aa9db028f387b4f0c0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
opencog::FollowLink Class Reference

#include <FollowLink.h>

+ Collaboration diagram for opencog::FollowLink:

Public Member Functions

Handle follow_binary_link (const Handle &h, Type ltype)
 
Handle backtrack_binary_link (const Handle &h, Type ltype)
 
Handle follow_link (const Handle &h, Type ltype, int from, int to)
 

Private Member Functions

bool find_link_type (const Handle &h)
 
bool pursue_link (const Handle &h)
 

Private Attributes

Type link_type
 
Handle from_atom
 
Handle to_atom
 
int position_from
 
int position_to
 
int cnt
 

Detailed Description

Definition at line 27 of file FollowLink.h.

Member Function Documentation

Handle opencog::FollowLink::backtrack_binary_link ( const Handle h,
Type  ltype 
)
inline

Definition at line 46 of file FollowLink.h.

References follow_link().

bool opencog::FollowLink::find_link_type ( const Handle h)
inlineprivate

Find the (first!, assumed only!?) link of desired type.

Definition at line 75 of file FollowLink.h.

References cnt, opencog::Atom::getType(), link_type, opencog::LinkCast(), pursue_link(), to_atom, and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

Handle opencog::FollowLink::follow_binary_link ( const Handle h,
Type  ltype 
)
inline

follow_binary_link – follow an ordered, binary link.

Look at the incoming set of this atom. Find the first link of type link_type, then follow this link to see where its going. Its asssumed that there is only one such link, and that its binary. Return a pointer to where the link is going.

Definition at line 41 of file FollowLink.h.

References follow_link().

Handle opencog::FollowLink::follow_link ( const Handle h,
Type  ltype,
int  from,
int  to 
)
inline

Definition at line 51 of file FollowLink.h.

References find_link_type(), opencog::Atom::foreach_incoming(), from_atom, link_type, position_from, position_to, to_atom, and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

bool opencog::FollowLink::pursue_link ( const Handle h)
inlineprivate

Definition at line 88 of file FollowLink.h.

References cnt, from_atom, position_from, position_to, to_atom, and opencog::Handle::UNDEFINED.

+ Here is the caller graph for this function:

Member Data Documentation

int opencog::FollowLink::cnt
private

Definition at line 70 of file FollowLink.h.

Handle opencog::FollowLink::from_atom
private

Definition at line 66 of file FollowLink.h.

Type opencog::FollowLink::link_type
private

Definition at line 65 of file FollowLink.h.

int opencog::FollowLink::position_from
private

Definition at line 68 of file FollowLink.h.

int opencog::FollowLink::position_to
private

Definition at line 69 of file FollowLink.h.

Handle opencog::FollowLink::to_atom
private

Definition at line 67 of file FollowLink.h.


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