retdec
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
retdec::llvmir2hll::CGWriter Class Referenceabstract

A base class of all call graph (CG) writers. More...

#include <cg_writer.h>

Inheritance diagram for retdec::llvmir2hll::CGWriter:
Inheritance graph
[legend]
Collaboration diagram for retdec::llvmir2hll::CGWriter:
Collaboration graph
[legend]

Public Member Functions

virtual ~CGWriter ()=default
 
virtual std::string getId () const =0
 Returns the ID of the writer. More...
 
virtual bool emitCG ()=0
 Emits the given CG into the given output stream. More...
 

Protected Member Functions

 CGWriter (ShPtr< CG > cg, std::ostream &out)
 Constructs a new writer. More...
 

Protected Attributes

ShPtr< CGcg
 CG to be emitted. More...
 
std::ostream & out
 Stream, where the resulting CG will be emitted. More...
 

Additional Inherited Members

- Private Member Functions inherited from retdec::utils::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
NonCopyableoperator= (const NonCopyable &)=delete
 
 NonCopyable ()=default
 
 ~NonCopyable ()=default
 

Detailed Description

A base class of all call graph (CG) writers.

Every CG writer should subclass this class and override emitCG().

Instances of this class have reference object semantics.

Constructor & Destructor Documentation

◆ ~CGWriter()

virtual retdec::llvmir2hll::CGWriter::~CGWriter ( )
virtualdefault

◆ CGWriter()

retdec::llvmir2hll::CGWriter::CGWriter ( ShPtr< CG cg,
std::ostream &  out 
)
protected

Constructs a new writer.

Parameters
[in]cgCG to be emitted.
[in]outOutput stream where the CG is emitted.

Member Function Documentation

◆ emitCG()

virtual bool retdec::llvmir2hll::CGWriter::emitCG ( )
pure virtual

Emits the given CG into the given output stream.

The format of the written data depends on the subclass of this class.

Returns
true if some code has been emitted, false otherwise.

Implemented in retdec::llvmir2hll::GraphvizCGWriter.

◆ getId()

virtual std::string retdec::llvmir2hll::CGWriter::getId ( ) const
pure virtual

Returns the ID of the writer.

Implemented in retdec::llvmir2hll::GraphvizCGWriter.

Member Data Documentation

◆ cg

ShPtr<CG> retdec::llvmir2hll::CGWriter::cg
protected

CG to be emitted.

◆ out

std::ostream& retdec::llvmir2hll::CGWriter::out
protected

Stream, where the resulting CG will be emitted.


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