runMACS
 All Data Structures Files Functions Variables Enumerations Enumerator Macros
StorageManager.h
Go to the documentation of this file.
1 #ifndef STORAGE_MANAGER_H
2 #define STORAGE_MANAGER_H
3 
4 #include <string>
5 #include <list>
6 #include <exception>
7 
8 #include <SystemHelper.h>
9 
12 class StorageManagerException: public std::exception {
13 public:
14  StorageManagerException(const std::string & _message);
15  ~StorageManagerException() throw();
16  virtual const char* what() const throw();
17 private:
18  std::string message;
19 };
20 
24 public:
26  ~NoStorageLocationGiven() throw();
27 };
28 
32 public:
34  ~NoSpaceLeftOnStorage() throw();
35 };
36 
44 public:
49  StorageManager(double minFreeThreshold_ = .05);
54  void addStorageLocation(const std::string & path);
59  std::string getPreferredStorageLocation();
60 private:
61  std::list<std::string> storageLocations;
62  SystemHelper systemHelper;
63 
64  std::list<std::string>::iterator currentLocation;
65  double minFreeThreshold;
66 };
67 
68 #endif /* STORAGE_MANAGER_H */
Helper class for system informations.
Definition: SystemHelper.h:14
std::string getPreferredStorageLocation()
Ask for a good location to store data.
Handles storage locations.
Base class for all StorageManager exceptions.
All defined storage locations have insufficient free space.
void addStorageLocation(const std::string &path)
Add a new storage location.
StorageManagerException(const std::string &_message)
Storage location was requested but none have been defined.
StorageManager(double minFreeThreshold_=.05)
Construct a StorageManager.
virtual const char * what() const