DCFG
Dynamic Control Flow Graph
 All Classes Functions
Public Member Functions | Static Public Member Functions | List of all members
dcfg_trace_api::DCFG_TRACE_READER Class Referenceabstract

Interface to all data in a DCFG edge trace. More...

#include <dcfg_trace_api.H>

Public Member Functions

virtual bool open (const std::string filename, UINT32 tid, std::string &errMsg)=0
 Open a file for reading from the given thread.
 
virtual bool get_edge_ids (dcfg_api::DCFG_ID_CONTAINER &edge_ids, bool &done, std::string &errMsg)=0
 Read a chunk of edge IDs.
 

Static Public Member Functions

static DCFG_TRACE_READERnew_reader (dcfg_api::DCFG_ID process_id)
 Create a new DCFG edge-trace reader.
 

Detailed Description

Interface to all data in a DCFG edge trace.

This is an interface; use DCFG_TRACE::new_trace() to create an object that implements the interface.

Member Function Documentation

virtual bool dcfg_trace_api::DCFG_TRACE_READER::get_edge_ids ( dcfg_api::DCFG_ID_CONTAINER edge_ids,
bool &  done,
std::string &  errMsg 
)
pure virtual

Read a chunk of edge IDs.

They will be added to edge_ids in the order in which they were recorded. This method will not typically read all the values at once. Call it repeatedly until done is set to true.

Returns
true on success, false otherwise (and sets errMsg).
Parameters
[out]edge_idsContainer to which edge IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER that maintains insertion order: DCFG_ID_VECTOR, etc.
[out]doneSet to true when end of sequence has been reached, false if there are more to read.
[out]errMsgContains error message upon failure.
static DCFG_TRACE_READER* dcfg_trace_api::DCFG_TRACE_READER::new_reader ( dcfg_api::DCFG_ID  process_id)
static

Create a new DCFG edge-trace reader.

This is a factory method to create a new object that implements the DCFG_TRACE_READER interface. A reader can access only one process. Create multiple readers to read multiple processes.

Returns
Pointer to new object. It can be freed with delete.
Parameters
[in]process_idID of process to read. This can be determined from the DCFG data object corresponding to the trace.
virtual bool dcfg_trace_api::DCFG_TRACE_READER::open ( const std::string  filename,
UINT32  tid,
std::string &  errMsg 
)
pure virtual

Open a file for reading from the given thread.

Returns
true on success, false otherwise (and sets errMsg).
Parameters
[in]filenameName of file to open, which must follow the DCFG-Trace JSON format.
[in]tidID number of thread to read.
[out]errMsgContains error message upon failure.

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