Otawa  0.10
otawa::ContextPath< T > Class Template Reference

This class is a stack to store call chain in the program call graph. More...

#include <otawa/flowfact/ContextualLoopBound.h>

Public Member Functions

void push (const T &addr)
 Add a call to the call stack (becoming the new top call). More...
 
pop (void)
 Remove the top call from the call stack. More...
 
const T & top (void) const
 Return the top function call. More...
 
int count (void) const
 Get the count of calls in the path. More...
 
const T & get (int i) const
 Get the function call at position i (0 for the top function call). More...
 
const T & operator[] (int i) const
 Shortcut to get(). More...
 
bool isEmpty (void) const
 
 operator bool (void) const
 
void clear (void)
 

Private Attributes

genstruct::Vector< T > stack
 

Detailed Description

template<class T>
class otawa::ContextPath< T >

This class is a stack to store call chain in the program call graph.

The top level element (index 0) is the current call and previous elements represents the call that has driven to the current call.

Parameters
TRepresentation of a function call.

Member Function Documentation

template<class T>
void otawa::ContextPath< T >::clear ( void  )
inline
template<class T>
int otawa::ContextPath< T >::count ( void  ) const
inline

Get the count of calls in the path.

Returns
Number of function calls.

Referenced by otawa::ContextualLoopBound::findMax(), otawa::ContextualLoopBound::findTotal(), and otawa::ContextualLoopBound::look().

template<class T>
const T & otawa::ContextPath< T >::get ( int  i) const
inline

Get the function call at position i (0 for the top function call).

Parameters
iPosition of the function call to get.
Returns
Function call at position i.
Warning
i must be in [0, count() - 1].
template<class T>
bool otawa::ContextPath< T >::isEmpty ( void  ) const
inline
template<class T>
otawa::ContextPath< T >::operator bool ( void  ) const
inline
template<class T>
const T & otawa::ContextPath< T >::operator[] ( int  i) const
inline

Shortcut to get().

template<class T>
T otawa::ContextPath< T >::pop ( void  )
inline

Remove the top call from the call stack.

Returns
Popped function call.
template<class T>
void otawa::ContextPath< T >::push ( const T &  addr)
inline

Add a call to the call stack (becoming the new top call).

Parameters
addrFunction call to push.
template<class T>
const T & otawa::ContextPath< T >::top ( void  ) const
inline

Return the top function call.

Returns
Top function call.

Member Data Documentation

template<class T>
genstruct::Vector<T> otawa::ContextPath< T >::stack
private

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