MADNESS  0.10.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
madness::profiling::TaskEventList Class Reference

A list of task events. More...

#include <thread.h>

Inheritance diagram for madness::profiling::TaskEventList:
Inheritance graph
[legend]
Collaboration diagram for madness::profiling::TaskEventList:
Collaboration graph
[legend]

Public Member Functions

 TaskEventList (const unsigned int nmax)
 Default constructor. More...
 
virtual ~TaskEventList ()=default
 Virtual destructor. More...
 
TaskEventevent ()
 Get a new event from this list. More...
 
- Public Member Functions inherited from madness::profiling::TaskEventListBase
 TaskEventListBase ()
 Default constructor. More...
 
virtual ~TaskEventListBase ()=default
 Virtual destructor. More...
 
void insert (TaskEventListBase *list)
 Insert list after this list. More...
 
TaskEventListBasenext () const
 Get the next event list in the linked list. More...
 

Private Member Functions

 TaskEventList (const TaskEventList &)=delete
 
TaskEventListoperator= (const TaskEventList &)=delete
 
virtual std::ostream & print_events (std::ostream &os) const
 Print events recorded in this list. More...
 

Private Attributes

std::unique_ptr< TaskEvent[]> events_
 The event array. More...
 
unsigned int n_
 The number of events recorded. More...
 

Detailed Description

A list of task events.

This object is used by the thread pool to record task data.

Constructor & Destructor Documentation

◆ TaskEventList() [1/2]

madness::profiling::TaskEventList::TaskEventList ( const TaskEventList )
privatedelete

◆ TaskEventList() [2/2]

madness::profiling::TaskEventList::TaskEventList ( const unsigned int  nmax)
inline

Default constructor.

Parameters
[in]nmaxThe maximum number of task events.
Todo:
Should nmax be stored? I think it used to be a template parameter (N), which is no longer present.

◆ ~TaskEventList()

virtual madness::profiling::TaskEventList::~TaskEventList ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ event()

TaskEvent* madness::profiling::TaskEventList::event ( )
inline

Get a new event from this list.

Warning
This function can only be called nmax times. It is the caller's resonsibility to ensure that it is not called too many times.
Returns
The new event from the list.

References events_, and n_.

Referenced by madness::ThreadPool::run_task(), and madness::ThreadPool::run_tasks().

◆ operator=()

TaskEventList& madness::profiling::TaskEventList::operator= ( const TaskEventList )
privatedelete

◆ print_events()

virtual std::ostream& madness::profiling::TaskEventList::print_events ( std::ostream &  os) const
inlineprivatevirtual

Print events recorded in this list.

Parameters
[in,out]osThe output stream.
Returns
The modified output stream.

Implements madness::profiling::TaskEventListBase.

References events_, madness::ThreadBase::get_pool_thread_index(), n_, and madness::ThreadBase::this_thread().

Member Data Documentation

◆ events_

std::unique_ptr<TaskEvent[]> madness::profiling::TaskEventList::events_
private

The event array.

Referenced by event(), and print_events().

◆ n_

unsigned int madness::profiling::TaskEventList::n_
private

The number of events recorded.

Referenced by event(), and print_events().


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