Main Page | Class Hierarchy | Class List | Directories | File List | Class Members

RplPattern Class Reference

Reads in the pattern file and applies the traceString when replace is called. More...

#include <rplPattern.h>

Collaboration diagram for RplPattern:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ~RplPattern ()
void replace (Tbl &dict, std::string &ts, std::string &leadwspc)
 Place trace strings at the beginning of routines.
void replace (Tbl &dict, std::string &ts, std::string &leadwspc, std::string &rtnStr)
 Place trace strings at the end of routines.

Static Public Member Functions

static RplPatterninstance ()
static void build ()

Private Types

enum  ListType_t { NONE, ACTIVE, INACTIVE }
 What type of routine list.

Private Member Functions

 RplPattern ()
 Read in pattern file and routine list if requested.
 RplPattern (const RplPattern &)
 Users can not copy one.
RplPatternoperator= (const RplPattern &)
 Users can not assign one.
void findPattern (Tbl &tbl, std::string &ts, std::string &pat)
void buildPatternTbl (std::string &line, Tbl &tbl)
void add2dict (std::string &args, Tbl &tbl)
void buildList (ListType_t listType, const char *fn)

Private Attributes

Tbl m_startPatternTbl
Tbl m_endPatternTbl
STD(set)< std ListType_t m_listType
 This holds the type of routine list.
int m_remove

Static Private Attributes

static RplPatternmsp_rplPattern = 0
static SingletonDestroyer<
RplPattern
ms_destroyer

Detailed Description

Reads in the pattern file and applies the traceString when replace is called.

Description
The class is reponsible for several things:
  • It must read in the pattern file saving away start and possible end patterns.
  • It saves away a list of either active or inactive routines.
  • It applies the start and possible end patterns.


Constructor & Destructor Documentation

RplPattern::~RplPattern  ) 
 

Simple dtor: all member data, no pointers.

RplPattern::RplPattern  )  [private]
 

Read in pattern file and routine list if requested.

Description
Find the pattern file, open it then read each line and remove any comment lines. Then place patterns in either the start or end. All pattern go into the start list unless told otherwise.


Member Function Documentation

void RplPattern::add2dict std::string &  args,
Tbl &  tbl
[private]
 

If the traceString has a brace list then add it to the dictionary.

static void RplPattern::build  )  [inline, static]
 

Build a the pointer and register in with the destroyer.

void RplPattern::buildList ListType_t  listType,
const char *  fn
[private]
 

Read in the list of active/inactive routine names.

void RplPattern::buildPatternTbl std::string &  line,
Tbl &  tbl
[private]
 

Add a key value pair to the pattern tbl, stripping any leading or trailing blanks.

void RplPattern::findPattern Tbl &  tbl,
std::string &  ts,
std::string &  pat
[private]
 

Use the input traceString in ts to find the name of the pattern to use. If there is none then use the default pattern by asking what defaultPatName() is.

If there is no pattern by that name then report a warning and continue.

static RplPattern& RplPattern::instance  )  [inline, static]
 

Returns the instance reference, Note that RplPattern::build() must be called first.

See also:
RplPattern::build()

void RplPattern::replace Tbl &  dict,
std::string &  ts,
std::string &  leadwspc,
std::string &  rtnStr
 

Place trace strings at the end of routines.

Description
This routine does several things:
  • If the endPattern file is empty then it returns.
  • It returns if the routine is not active.
  • It modifies dict if there is something placed in the codes traceString
  • Then it generates the traceString and places in the output.

void RplPattern::replace Tbl &  dict,
std::string &  ts,
std::string &  leadwspc
 

Place trace strings at the beginning of routines.

Description
This routine does several things:
  • If --name is requested by the user then the fully qualified name is written to stderr and the routine returns.
  • It checks to see if the instrumentation should be added by checking to see if the routine is active by checking if or how the routine is on the list. It returns if not active.
  • It modifies dict if there is something placed in the codes traceString
  • Then it generates the traceString and places in the output.


Member Data Documentation

Tbl RplPattern::m_endPatternTbl [private]
 

The (possibly empty) table of end patterns

STD (set)<std ListType_t RplPattern::m_listType [private]
 

This holds the type of routine list.

See also:
m_routineList}

int RplPattern::m_remove [private]
 

The flag that says that all traceString code must be removed.

Tbl RplPattern::m_startPatternTbl [private]
 

The table of start patterns

SingletonDestroyer< RplPattern > RplPattern::ms_destroyer [static, private]
 

Just here to clean up the RplPattern Singleton.

RplPattern * RplPattern::msp_rplPattern = 0 [static, private]
 

The singleton instance for RplPattern.


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



Project Hosted By:
SourceForge.net Logo