OutputDirectoryFifoQueue Class Reference

#include <OutputDirectoryFifoQueue.hpp>

Collaboration diagram for OutputDirectoryFifoQueue:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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 43 of file OutputDirectoryFifoQueue.hpp.


Constructor & Destructor Documentation

OutputDirectoryFifoQueue::OutputDirectoryFifoQueue ( const std::string &  rBaseDirectory,
unsigned  queueMaxSize 
)

Constructor.

Parameters:
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.


Member Function Documentation

std::string OutputDirectoryFifoQueue::CreateNextDir ( const std::string &  rSubdirectoryName  ) 

Creates a subdirectory called rSubdirectoryName deleting the oldest subdirectory if the maximum number has been reached.

Note:
Must be called collectively.
Parameters:
rSubdirectoryName subdirectory name
Returns:
new directory name relative to the base directory

Definition at line 47 of file OutputDirectoryFifoQueue.cpp.

References ABORT_IF_NON0, PetscTools::AmMaster(), PetscTools::Barrier(), OutputFileHandler::GetChasteTestOutputDirectory(), mBaseDirectory, mQueue, and mQueueMaxSize.

Referenced by CardiacSimulation::CreateAndRun().


Member Data Documentation

Base directory for all the subdirectories to be created.

Definition at line 47 of file OutputDirectoryFifoQueue.hpp.

Referenced by CreateNextDir(), and OutputDirectoryFifoQueue().

std::queue<std::string> OutputDirectoryFifoQueue::mQueue [private]

The queue of names of subdirectories currently on the disk

Definition at line 49 of file OutputDirectoryFifoQueue.hpp.

Referenced by CreateNextDir(), and OutputDirectoryFifoQueue().

Maximum number of subdirectories

Definition at line 48 of file OutputDirectoryFifoQueue.hpp.

Referenced by CreateNextDir().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:07:07 2011 for Chaste by  doxygen 1.6.3