aGrUM  0.13.2
gum::learning::BNLearnerListener Class Reference

A class that redirects gum_signal from algorithms to the listeners of BNLearn. More...

#include <BNLearnerListener.h>

+ Inheritance diagram for gum::learning::BNLearnerListener:
+ Collaboration diagram for gum::learning::BNLearnerListener:

Public Member Functions

 BNLearnerListener (genericBNLearner *bnl, ApproximationScheme &sch)
 
virtual ~BNLearnerListener ()
 
virtual void whenProgress (const void *src, const Size pourcent, const double error, const double time) final
 When progress was made. More...
 
virtual void whenStop (const void *src, const std::string message) final
 When it stops. More...
 
void attachSignal__ (__sig__::ISignaler *sender)
 
void detachSignal__ (__sig__::ISignaler *sender)
 

Detailed Description

A class that redirects gum_signal from algorithms to the listeners of BNLearn.

Definition at line 44 of file BNLearnerListener.h.

Constructor & Destructor Documentation

gum::learning::BNLearnerListener::BNLearnerListener ( genericBNLearner bnl,
ApproximationScheme sch 
)

Definition at line 24 of file BNLearnerListener.cpp.

References gum::learning::genericBNLearner::setCurrentApproximationScheme().

25  :
27  __bnlearner(bnl) {
29  GUM_CONSTRUCTOR(BNLearnerListener);
30  }
INLINE void setCurrentApproximationScheme(const ApproximationScheme *approximationScheme)
{@ /// distribute signals
ApproximationSchemeListener(IApproximationSchemeConfiguration &sch)
Class constructor.
BNLearnerListener(genericBNLearner *bnl, ApproximationScheme &sch)

+ Here is the call graph for this function:

gum::learning::BNLearnerListener::~BNLearnerListener ( )
virtual

Definition at line 38 of file BNLearnerListener.cpp.

References operator=().

38 { GUM_DESTRUCTOR(BNLearnerListener); }
BNLearnerListener(genericBNLearner *bnl, ApproximationScheme &sch)

+ Here is the call graph for this function:

gum::learning::BNLearnerListener::BNLearnerListener ( const BNLearnerListener other)
private

Definition at line 32 of file BNLearnerListener.cpp.

References GUM_ERROR.

32  :
34  GUM_CONS_CPY(BNLearnerListener);
35  GUM_ERROR(OperationNotAllowed, "No copy constructor for BNLearnerListener");
36  }
ApproximationSchemeListener(IApproximationSchemeConfiguration &sch)
Class constructor.
BNLearnerListener(genericBNLearner *bnl, ApproximationScheme &sch)
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

Member Function Documentation

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

Definition at line 33 of file listener_inl.h.

References gum::Listener::__senders.

33  {
34  __senders.push_back(sender);
35  }
Senders_list __senders
Definition: listener.h:92
INLINE void gum::Listener::detachSignal__ ( __sig__::ISignaler *  sender)
inherited

Definition at line 37 of file listener_inl.h.

References gum::Listener::__senders.

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
BNLearnerListener & gum::learning::BNLearnerListener::operator= ( const BNLearnerListener other)
private

Definition at line 41 of file BNLearnerListener.cpp.

References GUM_ERROR.

Referenced by ~BNLearnerListener().

41  {
42  GUM_CONS_CPY(BNLearnerListener);
43  GUM_ERROR(OperationNotAllowed, "No copy constructor for BNLearnerListener");
44  }
BNLearnerListener(genericBNLearner *bnl, ApproximationScheme &sch)
#define GUM_ERROR(type, msg)
Definition: exceptions.h:66

+ Here is the caller graph for this function:

void gum::learning::BNLearnerListener::whenProgress ( const void *  src,
const Size  step,
const double  error,
const double  time 
)
finalvirtual

When progress was made.

Parameters
srcThe signal source.
pourcentThe advancement in percent.
errorThe number of errors.
timeThe time.

Implements gum::ApproximationSchemeListener.

Definition at line 46 of file BNLearnerListener.cpp.

References __bnlearner, and gum::learning::genericBNLearner::distributeProgress().

49  {
51  static_cast< const ApproximationScheme* >(src), pourcent, error, time);
52  }
INLINE void distributeProgress(const ApproximationScheme *approximationScheme, Size pourcent, double error, double time)
{@ /// distribute signals

+ Here is the call graph for this function:

void gum::learning::BNLearnerListener::whenStop ( const void *  src,
const std::string  message 
)
finalvirtual

When it stops.

Parameters
srcThe signal source.
messageA message.

Implements gum::ApproximationSchemeListener.

Definition at line 53 of file BNLearnerListener.cpp.

References __bnlearner, and gum::learning::genericBNLearner::distributeStop().

53  {
54  __bnlearner->distributeStop(static_cast< const ApproximationScheme* >(src),
55  message);
56  }
INLINE void distributeStop(const ApproximationScheme *approximationScheme, std::string message)
distribute signals

+ Here is the call graph for this function:

Member Data Documentation

genericBNLearner* gum::learning::BNLearnerListener::__bnlearner
private

Definition at line 59 of file BNLearnerListener.h.

Referenced by whenProgress(), and whenStop().


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