Dyninst::Graph Class Reference

#include <Graph.h>

Inheritance diagram for Dyninst::Graph:
Dyninst::AnnotatableSparse

Data Structures

class  NodePredicate

Public Types

typedef boost::shared_ptr< GraphPtr
typedef bool(* NodePredicateFunc )(const NodePtr &node, void *user_arg)
typedef dyn_hash_map< void
*, void *, void_ptr_hasher
annos_by_type_t
typedef std::vector
< annos_by_type_t * > 
annos_t

Public Member Functions

virtual void entryNodes (NodeIterator &begin, NodeIterator &end)
virtual void exitNodes (NodeIterator &begin, NodeIterator &end)
virtual void allNodes (NodeIterator &begin, NodeIterator &end)
virtual bool find (Address addr, NodeIterator &begin, NodeIterator &end)
virtual bool find (NodePredicate::Ptr, NodeIterator &begin, NodeIterator &end)
virtual bool find (NodePredicateFunc, void *user_arg, NodeIterator &begin, NodeIterator &end)
bool printDOT (const std::string &fileName)
virtual ~Graph ()
void insertPair (NodePtr source, NodePtr target, EdgePtr edge=EdgePtr())
virtual void insertEntryNode (NodePtr entry)
virtual void insertExitNode (NodePtr exit)
virtual void markAsEntryNode (NodePtr entry)
virtual void markAsExitNode (NodePtr exit)
void deleteNode (NodePtr node)
void addNode (NodePtr node)
virtual void removeAnnotation ()
bool isEntryNode (NodePtr node)
bool isExitNode (NodePtr node)
unsigned size () const
template<class T >
AN_INLINE bool addAnnotation (const T *a, AnnotationClass< T > &a_id)
bool operator== (AnnotatableSparse &cmp)
template<class T >
AN_INLINE bool getAnnotation (T *&a, AnnotationClass< T > &a_id) const
template<class T >
bool removeAnnotation (AnnotationClass< T > &a_id)
void serializeAnnotations (SerializerBase *sb, const char *)
void annotationsReport ()

Static Public Member Functions

static Ptr createGraph ()

Protected Types

typedef boost::shared_ptr< NodeNodePtr
typedef boost::shared_ptr< EdgeEdgePtr
typedef std::set< NodePtrNodeSet
typedef std::map< Address,
NodeSet
NodeMap

Protected Member Functions

 Graph ()

Protected Attributes

NodeSet nodes_
NodeMap nodesByAddr_
NodeSet entryNodes_
NodeSet exitNodes_

Static Protected Attributes

static const Address INITIAL_ADDR = (Address) -1

Friends

class Edge
class Node
class Creator
class Iterator

Detailed Description

Definition at line 58 of file Graph.h.


Member Typedef Documentation

typedef dyn_hash_map<void *, void *, void_ptr_hasher> Dyninst::AnnotatableSparse::annos_by_type_t [inherited]

Definition at line 505 of file Annotatable.h.

typedef std::vector<annos_by_type_t *> Dyninst::AnnotatableSparse::annos_t [inherited]

Definition at line 508 of file Annotatable.h.

typedef boost::shared_ptr<Edge> Dyninst::Graph::EdgePtr [protected]

Definition at line 67 of file Graph.h.

typedef std::map<Address, NodeSet> Dyninst::Graph::NodeMap [protected]

Definition at line 70 of file Graph.h.

typedef bool(* Dyninst::Graph::NodePredicateFunc)(const NodePtr &node, void *user_arg)

Definition at line 89 of file Graph.h.

typedef boost::shared_ptr<Node> Dyninst::Graph::NodePtr [protected]

Definition at line 66 of file Graph.h.

typedef std::set<NodePtr> Dyninst::Graph::NodeSet [protected]

Definition at line 69 of file Graph.h.

typedef boost::shared_ptr<Graph> Dyninst::Graph::Ptr

Definition at line 73 of file Graph.h.


Constructor & Destructor Documentation

virtual Dyninst::Graph::~Graph (  )  [inline, virtual]

Definition at line 109 of file Graph.h.

Graph::Graph (  )  [protected]

Definition at line 74 of file Graph.C.

Referenced by createGraph().


Member Function Documentation

template<class T >
AN_INLINE bool Dyninst::AnnotatableSparse::addAnnotation ( const T *  a,
AnnotationClass< T > &  a_id 
) [inline, inherited]
void Graph::addNode ( NodePtr  node  ) 

Definition at line 115 of file Graph.C.

References nodes_, and nodesByAddr_.

Referenced by insertEntryNode(), insertExitNode(), and insertPair().

void Graph::allNodes ( NodeIterator begin,
NodeIterator end 
) [virtual]

Definition at line 58 of file Graph.C.

References nodes_.

Referenced by find().

void Dyninst::AnnotatableSparse::annotationsReport (  )  [inline, inherited]
Graph::Ptr Graph::createGraph (  )  [static]

Definition at line 76 of file Graph.C.

References Graph().

Referenced by Dyninst::Node::backwardSubgraph(), and Dyninst::Node::forwardSubgraph().

void Graph::deleteNode ( NodePtr  node  ) 

Definition at line 150 of file Graph.C.

References entryNodes_, exitNodes_, nodes_, and nodesByAddr_.

void Graph::entryNodes ( NodeIterator begin,
NodeIterator end 
) [virtual]

Definition at line 45 of file Graph.C.

References entryNodes_.

Referenced by printDOT().

void Graph::exitNodes ( NodeIterator begin,
NodeIterator end 
) [virtual]

Definition at line 51 of file Graph.C.

References exitNodes_.

Referenced by printDOT().

bool Graph::find ( NodePredicateFunc  pred,
void *  user_arg,
NodeIterator begin,
NodeIterator end 
) [virtual]

Definition at line 139 of file Graph.C.

References allNodes().

bool Graph::find ( NodePredicate::Ptr  pred,
NodeIterator begin,
NodeIterator end 
) [virtual]

Definition at line 128 of file Graph.C.

References allNodes().

bool Graph::find ( Address  addr,
NodeIterator begin,
NodeIterator end 
) [virtual]

Definition at line 65 of file Graph.C.

References nodesByAddr_.

template<class T >
AN_INLINE bool Dyninst::AnnotatableSparse::getAnnotation ( T *&  a,
AnnotationClass< T > &  a_id 
) const [inline, inherited]
void Graph::insertEntryNode ( NodePtr  entry  )  [virtual]

Definition at line 97 of file Graph.C.

References addNode(), and entryNodes_.

void Graph::insertExitNode ( NodePtr  exit  )  [virtual]

Definition at line 102 of file Graph.C.

References addNode(), and exitNodes_.

void Graph::insertPair ( NodePtr  source,
NodePtr  target,
EdgePtr  edge = EdgePtr() 
)

Definition at line 80 of file Graph.C.

References addNode(), and Dyninst::Edge::createEdge().

bool Graph::isEntryNode ( NodePtr  node  ) 

Definition at line 177 of file Graph.C.

References entryNodes_.

bool Graph::isExitNode ( NodePtr  node  ) 

Definition at line 182 of file Graph.C.

References exitNodes_.

void Graph::markAsEntryNode ( NodePtr  entry  )  [virtual]

Definition at line 107 of file Graph.C.

References entryNodes_.

void Graph::markAsExitNode ( NodePtr  exit  )  [virtual]

Definition at line 111 of file Graph.C.

References exitNodes_.

bool Dyninst::AnnotatableSparse::operator== ( AnnotatableSparse cmp  )  [inline, inherited]
bool Graph::printDOT ( const std::string &  fileName  ) 

Definition at line 40 of file DOT.C.

References entryNodes(), exitNodes(), and fprintf.

template<class T >
bool Dyninst::AnnotatableSparse::removeAnnotation ( AnnotationClass< T > &  a_id  )  [inline, inherited]
virtual void Dyninst::Graph::removeAnnotation (  )  [inline, virtual]

Definition at line 126 of file Graph.h.

void Dyninst::AnnotatableSparse::serializeAnnotations ( SerializerBase sb,
const char *   
) [inline, inherited]
unsigned Graph::size (  )  const

Definition at line 186 of file Graph.C.

References nodes_.


Friends And Related Function Documentation

friend class Creator [friend]

Definition at line 61 of file Graph.h.

friend class Edge [friend]

Definition at line 59 of file Graph.h.

friend class Iterator [friend]

Definition at line 62 of file Graph.h.

friend class Node [friend]

Definition at line 60 of file Graph.h.


Field Documentation

Definition at line 149 of file Graph.h.

Referenced by deleteNode(), entryNodes(), insertEntryNode(), isEntryNode(), and markAsEntryNode().

Definition at line 152 of file Graph.h.

Referenced by deleteNode(), exitNodes(), insertExitNode(), isExitNode(), and markAsExitNode().

const Dyninst::Address Graph::INITIAL_ADDR = (Address) -1 [static, protected]

Definition at line 135 of file Graph.h.

Definition at line 143 of file Graph.h.

Referenced by addNode(), allNodes(), deleteNode(), and size().

Definition at line 145 of file Graph.h.

Referenced by addNode(), deleteNode(), and find().


The documentation for this class was generated from the following files:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 12 Jul 2013 for SymtabAPI by  doxygen 1.6.1