PEARL
Parallel Event Access and Replay Library
Public Types | Static Public Attributes | List of all members
pearl::Callsite Class Reference

Representation of a callsite definition. More...

#include <pearl/Callsite.h>

Public Types

typedef uint32_t IdType
 Callsite definition identifier type. More...
 

Public Member Functions

Constructors & destructor
 Callsite (IdType id, const String &filename, uint32_t line, const Region &callee)
 Constructor. More...
 
Access definition data
IdType getId () const
 Get global identifier. More...
 
const StringgetFilename () const
 Get filename. More...
 
uint32_t getLine () const
 Get line number. More...
 
const RegiongetCallee () const
 Get called region. More...
 

Static Public Attributes

static const IdType NO_ID = (~static_cast<IdType>(0))
 Numerical identifier used for undefined callsite definitions. More...
 
static const Callsite UNDEFINED
 Static instance of class Callsite representing undefined callsite entries in other definitions. More...
 

Related Functions

(Note that these are not member functions.)

Stream I/O functions
std::ostream & operator<< (std::ostream &stream, const Callsite &item)
 Stream output operator. More...
 
Comparison operators
bool operator== (const Callsite &lhs, const Callsite &rhs)
 Equality operator. More...
 
bool operator!= (const Callsite &lhs, const Callsite &rhs)
 Inequality operator. More...
 

Detailed Description

Instances of the Callsite class provide information about source-code locations where the control flow moves from one region to another. This allows to distinguish between multiple entries of a region within the same enclosing source-code region. Callsites are therefore characterized by a file and a line number where the entry happens, as well as a reference to the region being entered. The numerical identifiers of the individual callsites are globally defined and continuously enumerated, i.e., the ID is element of [0,#callsites-1].

Todo:
Add "caller" attribute

Member Typedef Documentation

◆ IdType

typedef uint32_t pearl::Callsite::IdType

Constructor & Destructor Documentation

◆ Callsite()

pearl::Callsite::Callsite ( IdType  id,
const String filename,
uint32_t  line,
const Region callee 
)

Creates a new callsite definition instance and initializes it with the given values.

Parameters
idGlobal callsite identifier
filenameName of the file in which the callsite is located
lineLine number where the call happens
calleeRegion being entered

Member Function Documentation

◆ getCallee()

const Region& pearl::Callsite::getCallee ( ) const

Returns the region definition object related to the source-code region being entered from the callsite.

Returns
Called region

◆ getFilename()

const String& pearl::Callsite::getFilename ( ) const

Returns the string definition storing the name of the file in which the callsite is located. If this information is not available, String::UNDEFINED is returned.

Returns
Filename

◆ getId()

IdType pearl::Callsite::getId ( ) const

Returns the global identifier of the callsite definition.

Returns
Global identifier

◆ getLine()

uint32_t pearl::Callsite::getLine ( ) const

Returns the line number of the callsite in the associated source file. If this information is not available, zero is returned.

Returns
Line number

Friends And Related Function Documentation

◆ operator!=()

bool operator!= ( const Callsite lhs,
const Callsite rhs 
)
related

Compares two callsite definition objects lhs and rhs for inequality. Two callsite definitions are considered unequal if any of their attributes differ.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the callsite definitions differ, false otherwise.

◆ operator<<()

std::ostream & operator<< ( std::ostream &  stream,
const Callsite item 
)
related

Prints the contents of the given callsite definition object item to an output stream in a human-readable form.

Parameters
streamOutput stream
itemCallsite definition object
Returns
Output stream

◆ operator==()

bool operator== ( const Callsite lhs,
const Callsite rhs 
)
related

Compares two callsite definition objects lhs and rhs for equality. Two callsite definitions are considered equal if all of their attributes are identical.

Parameters
lhsLeft-hand operand
rhsRight-hand operand
Returns
True if the callsite definitions are equal, false otherwise.

Member Data Documentation

◆ NO_ID

const IdType pearl::Callsite::NO_ID = (~static_cast<IdType>(0))
static

◆ UNDEFINED

const Callsite pearl::Callsite::UNDEFINED
static

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

Scalasca    Copyright © 1998–2019 Forschungszentrum Jülich GmbH, Jülich Supercomputing Centre
Copyright © 2009–2015 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming