ROSE 0.11.145.147
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback Class Reference

Description

Base class for printing table cells.

Three kinds of callback are defined:

  1. A callback to print the table heading and separator
  2. A callback to print the data content
  3. A callback invoked before and after the entire table

Subclasses almost always override the data content callback, but seldom override the others. The default heading and separator callback knows how to print a properly formatted column heading, and the default before and after callback does nothing, but could be used to print keys, footnotes, etc.

If a callback has no column name and zero width, then its header and content callback is not invoked; its content callback is still invoked but should not produce any output.

Definition at line 329 of file AsmFunctionIndex.h.

#include <Rose/BinaryAnalysis/AsmFunctionIndex.h>

Inheritance diagram for Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback:
Inheritance graph
[legend]
Collaboration diagram for Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback:
Collaboration graph
[legend]

Classes

struct  BeforeAfterArgs
 Arguments for before-and after. More...
 
struct  DataArgs
 Arguments for column cells. More...
 
struct  GeneralArgs
 Base class for callback arguments. More...
 
struct  HeadingArgs
 Arguments for column heading callbacks. More...
 

Public Member Functions

 OutputCallback (const std::string &name, size_t width, const std::string description="")
 Constructor.
 
void set_prefix (const std::string &header, const std::string &separator=" ", const std::string &data=" ")
 Set prefix characters.
 
virtual bool operator() (bool enabled, const BeforeAfterArgs &)
 Callback for before and after the table.
 
virtual bool operator() (bool enabled, const HeadingArgs &)
 Callback to print a column heading.
 
virtual bool operator() (bool enabled, const DataArgs &)
 Callback to print data for a table cell.
 

Protected Member Functions

std::string center (const std::string &, size_t width)
 Center s in a string of length width.
 

Protected Attributes

std::string name
 Column name used when printing table headers.
 
std::string desc
 Optional description to appear in footnote.
 
size_t width
 Minimum width of column header or data.
 
std::string header_prefix
 Character(s) to print before headings.
 
std::string separator_prefix
 Character(s) to print before line separators.
 
std::string data_prefix
 Character(s) to print before data cells.
 

Constructor & Destructor Documentation

◆ OutputCallback()

Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::OutputCallback ( const std::string &  name,
size_t  width,
const std::string  description = "" 
)
inline

Constructor.

Every column must have a name and non-zero width. If a column is given a description then the column name will reference a footnote containing the description. The footnote is added by the default HeadingArgs callback, so subclasses should take care to add their own footnote if necessary.

Definition at line 366 of file AsmFunctionIndex.h.

References name, and width.

◆ ~OutputCallback()

virtual Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::~OutputCallback ( )
inlinevirtual

Definition at line 371 of file AsmFunctionIndex.h.

Member Function Documentation

◆ operator()() [1/3]

virtual bool Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::operator() ( bool  enabled,
const BeforeAfterArgs  
)
virtual

Callback for before and after the table.

The default does nothing, but subclasses can override this to do things like print descriptions, footnotes, etc.

Reimplemented in Rose::BinaryAnalysis::AsmFunctionIndex::FootnotesCallback.

◆ operator()() [2/3]

virtual bool Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::operator() ( bool  enabled,
const HeadingArgs  
)
virtual

Callback to print a column heading.

The base class implementation prints the column name using the specified column width. Subclasses probably don't need to override this method.

Reimplemented in Rose::BinaryAnalysis::AsmFunctionIndex::ReasonCallback, and Rose::BinaryAnalysis::AsmFunctionIndex::StackDeltaCallback.

◆ operator()() [3/3]

virtual bool Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::operator() ( bool  enabled,
const DataArgs  
)
virtual

Member Data Documentation

◆ name

std::string Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::name
protected

Column name used when printing table headers.

Definition at line 391 of file AsmFunctionIndex.h.

Referenced by OutputCallback().

◆ desc

std::string Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::desc
protected

Optional description to appear in footnote.

Definition at line 392 of file AsmFunctionIndex.h.

◆ width

size_t Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::width
protected

Minimum width of column header or data.

Definition at line 393 of file AsmFunctionIndex.h.

Referenced by OutputCallback().

◆ header_prefix

std::string Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::header_prefix
protected

Character(s) to print before headings.

Definition at line 394 of file AsmFunctionIndex.h.

◆ separator_prefix

std::string Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::separator_prefix
protected

Character(s) to print before line separators.

Definition at line 395 of file AsmFunctionIndex.h.

◆ data_prefix

std::string Rose::BinaryAnalysis::AsmFunctionIndex::OutputCallback::data_prefix
protected

Character(s) to print before data cells.

Definition at line 396 of file AsmFunctionIndex.h.


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