Inferno  0.2
SimpleCompare Class Reference

#include <simple_compare.hpp>

List of all members.

Public Member Functions

bool operator() (TreePtr< Node > x, TreePtr< Node > y)
 Pass in two pointers to nodes, which can point to subtrees. Result is true if they match. O(1) locally.
bool operator() (SequenceInterface &x, SequenceInterface &y)
 Pass in two sequences of pointers to nodes, which can point to subtrees. Result is true if they match. O(n) locally.
bool operator() (CollectionInterface &x, CollectionInterface &y)
 Pass in two collection of pointers to nodes, which can point to subtrees. Result is true if they match. O(n^2) locally.

Detailed Description

A subtree comparison algorithm that only operates on program nodes (not S&R patterns) and therefore can avoid O(n!) algorithms.

Definition at line 11 of file simple_compare.hpp.


Member Function Documentation

bool SimpleCompare::operator() ( TreePtr< Node x,
TreePtr< Node y 
)

Pass in two pointers to nodes, which can point to subtrees. Result is true if they match. O(1) locally.

Definition at line 3 of file simple_compare.cpp.

References ASSERT, ASSERTFAIL, and OOStd::SharedPtr< SUB_BASE, VALUE_INTERFACE, VALUE_TYPE >::get().

bool SimpleCompare::operator() ( SequenceInterface x,
SequenceInterface y 
)

Pass in two sequences of pointers to nodes, which can point to subtrees. Result is true if they match. O(n) locally.

Definition at line 57 of file simple_compare.cpp.

References OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::begin(), OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::end(), and OOStd::ContainerInterface< SUB_BASE, VALUE_INTERFACE >::size().

bool SimpleCompare::operator() ( CollectionInterface x,
CollectionInterface y 
)

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