Chaste Commit::ca8ccdedf819b6e02855bc0e8e6f50bdecbc5208
|
#include <OutputDirectoryFifoQueue.hpp>
Public Member Functions | |
OutputDirectoryFifoQueue (const std::string &rBaseDirectory, unsigned queueMaxSize) | |
std::string | CreateNextDir (const std::string &rSubdirectoryName) |
Private Attributes | |
std::string | mBaseDirectory |
unsigned | mQueueMaxSize |
std::queue< std::string > | mQueue |
This is a helper class to handle a FIFO collection of subdirectories.
All the subdirectories will be created inside a base directory provided in the constructor. The maximum number of concurrent subdirectories is specified in the the constructor. Once this number is reached, the next call to CreateNextDir() will delete the oldest directory as a side effect.
Definition at line 50 of file OutputDirectoryFifoQueue.hpp.
OutputDirectoryFifoQueue::OutputDirectoryFifoQueue | ( | const std::string & | rBaseDirectory, |
unsigned | queueMaxSize | ||
) |
Constructor.
rBaseDirectory | base directory for all the subdirectories to be created |
queueMaxSize | maximum number of subdirectories |
Definition at line 43 of file OutputDirectoryFifoQueue.cpp.
References mBaseDirectory, and mQueue.
std::string OutputDirectoryFifoQueue::CreateNextDir | ( | const std::string & | rSubdirectoryName | ) |
Creates a subdirectory called rSubdirectoryName deleting the oldest subdirectory if the maximum number has been reached.
rSubdirectoryName | subdirectory name |
Definition at line 54 of file OutputDirectoryFifoQueue.cpp.
References ABORT_IF_THROWS, PetscTools::AmMaster(), PetscTools::Barrier(), RelativeTo::ChasteTestOutput, mBaseDirectory, mQueue, mQueueMaxSize, and FileFinder::Remove().
Referenced by CardiacSimulation::CreateAndRun().
|
private |
Base directory for all the subdirectories to be created.
Definition at line 54 of file OutputDirectoryFifoQueue.hpp.
Referenced by OutputDirectoryFifoQueue(), and CreateNextDir().
|
private |
The queue of names of subdirectories currently on the disk
Definition at line 56 of file OutputDirectoryFifoQueue.hpp.
Referenced by OutputDirectoryFifoQueue(), and CreateNextDir().
|
private |
Maximum number of subdirectories
Definition at line 55 of file OutputDirectoryFifoQueue.hpp.
Referenced by CreateNextDir().