CIRCT  20.0.0git
Public Member Functions | Private Attributes | List of all members
circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy > Class Template Reference

Note: Callable class must implement a callable with signature: void (Data) More...

#include <PrettyPrinterHelpers.h>

Inheritance diagram for circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >:
Inheritance graph
[legend]
Collaboration diagram for circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >:
Collaboration graph
[legend]

Public Member Functions

 PrintEventAndStorageListener (CallableTy &c)
 
void print () override
 PrettyPrinter::Listener::print – indicates all the preceding tokens on the stream have been printed. More...
 
CallbackToken getToken (DataTy obj)
 Get a token with the obj data. More...
 
- Public Member Functions inherited from circt::pretty::TokenStringSaver
 TokenStringSaver ()
 
StringRef save (StringRef str)
 Add string, save in storage. More...
 
void clear () override
 PrettyPrinter::Listener::clear – indicates no external refs. More...
 
- Public Member Functions inherited from circt::pretty::PrettyPrinter::Listener
virtual ~Listener ()
 Destructor, anchor. More...
 

Private Attributes

std::queue< DataTy > dataQ
 List of all the unique data associated with each callback token. More...
 
CallableTy & callable
 The storage for the callback, as a function object. More...
 

Detailed Description

template<typename CallableTy, typename DataTy>
class circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >

Note: Callable class must implement a callable with signature: void (Data)

Definition at line 173 of file PrettyPrinterHelpers.h.

Constructor & Destructor Documentation

◆ PrintEventAndStorageListener()

template<typename CallableTy , typename DataTy >
circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::PrintEventAndStorageListener ( CallableTy &  c)
inline

Definition at line 184 of file PrettyPrinterHelpers.h.

Member Function Documentation

◆ getToken()

template<typename CallableTy , typename DataTy >
CallbackToken circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::getToken ( DataTy  obj)
inline

◆ print()

template<typename CallableTy , typename DataTy >
void circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::print ( )
inlineoverridevirtual

PrettyPrinter::Listener::print – indicates all the preceding tokens on the stream have been printed.

This is invoked when the CallbackToken is printed.

Reimplemented from circt::pretty::PrettyPrinter::Listener.

Definition at line 189 of file PrettyPrinterHelpers.h.

References circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::callable, and circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::dataQ.

Member Data Documentation

◆ callable

template<typename CallableTy , typename DataTy >
CallableTy& circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::callable
private

The storage for the callback, as a function object.

Definition at line 181 of file PrettyPrinterHelpers.h.

Referenced by circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::print().

◆ dataQ

template<typename CallableTy , typename DataTy >
std::queue<DataTy> circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::dataQ
private

List of all the unique data associated with each callback token.

The fact that tokens on a stream can never be printed out of order, ensures that CallbackTokens are always added and invoked in FIFO order, hence no need to record an index into the Data list.

Definition at line 179 of file PrettyPrinterHelpers.h.

Referenced by circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::getToken(), and circt::pretty::PrintEventAndStorageListener< CallableTy, DataTy >::print().


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