aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::ProgressListener Class Referenceabstract

The ProgressListener class. More...

#include <progressNotification.h>

+ Inheritance diagram for gum::ProgressListener:
+ Collaboration diagram for gum::ProgressListener:

Public Member Functions

 ProgressListener (ProgressNotifier &notif)
 Class constructor. More...
 
virtual ~ProgressListener ()
 Class destructor. More...
 
virtual void whenProgress (const void *src, const Size step, const double time)=0
 When progress was made. More...
 
virtual void whenStop (const void *src, const std::string &message)=0
 When it stops. More...
 
void _attachSignal_ (__sig__::ISignaler *sender)
 
void _detachSignal_ (__sig__::ISignaler *sender)
 

Protected Member Functions

 ProgressListener (const ProgressListener &other)
 Copy constructor. More...
 
ProgressListeneroperator= (const ProgressListener &other)
 Copy operator. More...
 

Detailed Description

The ProgressListener class.

Definition at line 58 of file progressNotification.h.

Constructor & Destructor Documentation

◆ ProgressListener() [1/2]

gum::ProgressListener::ProgressListener ( ProgressNotifier notif)
explicit

Class constructor.

Parameters
theprogress notifier.

Definition at line 33 of file progressNotification.cpp.

References gum::Set< Key, Alloc >::emplace().

33  : _notif_(notif) {
34  GUM_CONSTRUCTOR(ProgressListener);
35 
36  GUM_CONNECT((_notif_), onProgress, (*this), ProgressListener::whenProgress);
37  GUM_CONNECT((_notif_), onStop, (*this), ProgressListener::whenStop);
38  }
virtual void whenProgress(const void *src, const Size step, const double time)=0
When progress was made.
ProgressNotifier & _notif_
The scheme configuration.
virtual void whenStop(const void *src, const std::string &message)=0
When it stops.
ProgressListener(ProgressNotifier &notif)
Class constructor.
#define GUM_CONNECT(sender, signal, receiver, target)
Definition: listener.h:96
+ Here is the call graph for this function:

◆ ~ProgressListener()

gum::ProgressListener::~ProgressListener ( )
virtual

Class destructor.

Definition at line 45 of file progressNotification.cpp.

References gum::Set< Key, Alloc >::emplace().

45  {
46  GUM_DESTRUCTOR(ProgressListener);
47  ;
48  }
ProgressListener(ProgressNotifier &notif)
Class constructor.
+ Here is the call graph for this function:

◆ ProgressListener() [2/2]

gum::ProgressListener::ProgressListener ( const ProgressListener other)
protected

Copy constructor.

Definition at line 40 of file progressNotification.cpp.

References gum::Set< Key, Alloc >::emplace().

40  : _notif_(other._notif_) {
41  GUM_CONS_CPY(ProgressListener);
42  GUM_ERROR(OperationNotAllowed, "No copy constructor for ProgressListener")
43  }
ProgressNotifier & _notif_
The scheme configuration.
ProgressListener(ProgressNotifier &notif)
Class constructor.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:51
+ Here is the call graph for this function:

Member Function Documentation

◆ _attachSignal_()

INLINE void gum::Listener::_attachSignal_ ( __sig__::ISignaler *  sender)
inherited

Definition at line 35 of file listener_inl.h.

References gum::Set< Key, Alloc >::emplace().

35 { _senders_.push_back(sender); }
Senders_list _senders_
Definition: listener.h:92
+ Here is the call graph for this function:

◆ _detachSignal_()

INLINE void gum::Listener::_detachSignal_ ( __sig__::ISignaler *  sender)
inherited

Definition at line 37 of file listener_inl.h.

References gum::Set< Key, Alloc >::emplace().

37  {
38  auto del = std::remove(_senders_.begin(), _senders_.end(), sender);
39 
40  if (del != _senders_.end()) _senders_.erase(del, _senders_.end());
41  }
Senders_list _senders_
Definition: listener.h:92
+ Here is the call graph for this function:

◆ operator=()

ProgressListener & gum::ProgressListener::operator= ( const ProgressListener other)
protected

Copy operator.

Definition at line 50 of file progressNotification.cpp.

References gum::Set< Key, Alloc >::emplace().

50  {
51  GUM_CONS_CPY(ProgressListener);
52  GUM_ERROR(OperationNotAllowed, "No copy constructor for ProgressListener")
53  }
ProgressListener(ProgressNotifier &notif)
Class constructor.
#define GUM_ERROR(type, msg)
Definition: exceptions.h:51
+ Here is the call graph for this function:

◆ whenProgress()

virtual void gum::ProgressListener::whenProgress ( const void *  src,
const Size  step,
const double  time 
)
pure virtual

When progress was made.

Parameters
srcThe signal source.
stepThe advancement in percent.
timeThe time.

◆ whenStop()

virtual void gum::ProgressListener::whenStop ( const void *  src,
const std::string &  message 
)
pure virtual

When it stops.

Parameters
srcThe signal source.
messageA message.

Member Data Documentation

◆ _notif_

ProgressNotifier& gum::ProgressListener::_notif_
private

The scheme configuration.

Definition at line 99 of file progressNotification.h.


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