Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
ConsoleLog Class Reference

Singleton to control console logging. More...

#include <ored/utilities/log.hpp>

+ Inheritance diagram for ConsoleLog:
+ Collaboration diagram for ConsoleLog:

Public Member Functions

bool enabled ()
 
QuantLib::Size width ()
 
QuantLib::Size progressBarWidth ()
 
void switchOn ()
 
void switchOff ()
 
void setWidth (QuantLib::Size w)
 
void setProgressBarWidth (QuantLib::Size w)
 
boost::shared_mutex & mutex ()
 mutex to acquire locks More...
 

Private Member Functions

 ConsoleLog ()
 

Private Attributes

bool enabled_
 
QuantLib::Size width_
 
QuantLib::Size progressBarWidth_
 
boost::shared_mutex mutex_
 

Friends

class QuantLib::Singleton< ConsoleLog, std::integral_constant< bool, true > >
 

Detailed Description

Singleton to control console logging.

Definition at line 746 of file log.hpp.

Constructor & Destructor Documentation

◆ ConsoleLog()

ConsoleLog ( )
private

Definition at line 750 of file log.hpp.

750: enabled_(false), width_(50), progressBarWidth_(40) {}
QuantLib::Size progressBarWidth_
Definition: log.hpp:754
QuantLib::Size width_
Definition: log.hpp:753

Member Function Documentation

◆ enabled()

bool enabled ( )

Definition at line 758 of file log.hpp.

758 {
759 boost::shared_lock<boost::shared_mutex> lock(mutex());
760 return enabled_;
761 }
boost::shared_mutex & mutex()
mutex to acquire locks
Definition: log.hpp:787
+ Here is the call graph for this function:

◆ width()

QuantLib::Size width ( )

Definition at line 762 of file log.hpp.

762 {
763 boost::shared_lock<boost::shared_mutex> lock(mutex_);
764 return width_;
765 }
boost::shared_mutex mutex_
Definition: log.hpp:755

◆ progressBarWidth()

QuantLib::Size progressBarWidth ( )

Definition at line 766 of file log.hpp.

766 {
767 boost::shared_lock<boost::shared_mutex> lock(mutex_);
768 return progressBarWidth_;
769 }

◆ switchOn()

void switchOn ( )

Definition at line 770 of file log.hpp.

770 {
771 boost::unique_lock<boost::shared_mutex> lock(mutex_);
772 enabled_ = true;
773 }

◆ switchOff()

void switchOff ( )

Definition at line 774 of file log.hpp.

774 {
775 boost::unique_lock<boost::shared_mutex> lock(mutex_);
776 enabled_ = false;
777 }

◆ setWidth()

void setWidth ( QuantLib::Size  w)

Definition at line 778 of file log.hpp.

778 {
779 boost::unique_lock<boost::shared_mutex> lock(mutex_);
780 width_ = w;
781 }

◆ setProgressBarWidth()

void setProgressBarWidth ( QuantLib::Size  w)

Definition at line 782 of file log.hpp.

782 {
783 boost::unique_lock<boost::shared_mutex> lock(mutex_);
785 }

◆ mutex()

boost::shared_mutex & mutex ( )

mutex to acquire locks

Definition at line 787 of file log.hpp.

787{ return mutex_; }
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ QuantLib::Singleton< ConsoleLog, std::integral_constant< bool, true > >

friend class QuantLib::Singleton< ConsoleLog, std::integral_constant< bool, true > >
friend

Definition at line 741 of file log.hpp.

Member Data Documentation

◆ enabled_

bool enabled_
private

Definition at line 752 of file log.hpp.

◆ width_

QuantLib::Size width_
private

Definition at line 753 of file log.hpp.

◆ progressBarWidth_

QuantLib::Size progressBarWidth_
private

Definition at line 754 of file log.hpp.

◆ mutex_

boost::shared_mutex mutex_
mutableprivate

Definition at line 755 of file log.hpp.