PhoenixThread  1.0.0
Tools to ease parallel programming in C++
Loading...
Searching...
No Matches
PMultiThreadProgress.h File Reference
#include <string>
#include <vector>
#include <map>
#include <thread>
#include <mutex>
#include "PString.h"
+ Include dependency graph for PMultiThreadProgress.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PMultiThreadProgress
 Deal with Progress bar in mutlithread mode. More...
 
struct  ProgressElement
 Single progress information for multithreaded progress bar. More...
 

Typedefs

typedef std::vector< ProgressElementVecProgressElement
 Vector of ProgressElement.
 

Functions

void phoenix_print_parallel_progress (PMultiThreadProgress &progress, int refreshSecond)
 Print the parallel progression of the computing.
 

Typedef Documentation

◆ VecProgressElement

typedef std::vector<ProgressElement> VecProgressElement

Vector of ProgressElement.

Definition at line 33 of file PMultiThreadProgress.h.

Function Documentation

◆ phoenix_print_parallel_progress()

void phoenix_print_parallel_progress ( PMultiThreadProgress & progress,
int refreshSecond )

Print the parallel progression of the computing.

Parameters
progress: PMultiThreadProgress which print all progress bars
refreshSecond: number of second between two refresh of the progress bars

Definition at line 17 of file PMultiThreadProgress.cpp.

17 {
18 while(!progress.isFinished()){ //While computation is ongoing
19 progress.print();
20 std::this_thread::sleep_for(std::chrono::seconds(refreshSecond)); //We check status of computation each second
21 }
22 progress.printSummary();
23 std::cout << "PMultiThreadProgress : Done" << std::endl;
24}
void printSummary() const
Print a summary of all the progress bars.
bool isFinished() const
Say if the PMultiThreadProgress is finished.
void print()
Print the multithread progress bar.

References PMultiThreadProgress::isFinished(), PMultiThreadProgress::print(), and PMultiThreadProgress::printSummary().

Referenced by phoenix_program_callParallelProgressBar().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: