#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 |
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 43 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 36 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 47 of file OutputDirectoryFifoQueue.cpp.
References PetscTools::AmMaster(), PetscTools::Barrier(), EXPECT0, OutputFileHandler::GetChasteTestOutputDirectory(), mBaseDirectory, mQueue, and mQueueMaxSize.
Referenced by CardiacSimulation::CreateAndRun().
std::string OutputDirectoryFifoQueue::mBaseDirectory [private] |
Base directory for all the subdirectories to be created.
Definition at line 46 of file OutputDirectoryFifoQueue.hpp.
Referenced by CreateNextDir(), and OutputDirectoryFifoQueue().
unsigned OutputDirectoryFifoQueue::mQueueMaxSize [private] |
Maximum number of subdirectories
Definition at line 47 of file OutputDirectoryFifoQueue.hpp.
Referenced by CreateNextDir().
std::queue<std::string> OutputDirectoryFifoQueue::mQueue [private] |
The queue of names of subdirectories currently on the disk
Definition at line 48 of file OutputDirectoryFifoQueue.hpp.
Referenced by CreateNextDir(), and OutputDirectoryFifoQueue().