rvm  1.11
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Go to the documentation of this file.
1 #ifndef __vaulter_h__
2 #define __vaulter_h__
4 #include "asserts.h"
5 #include "rconfig.h"
6 #include "logger.h"
8 /** Select, monitor, and prepare vaults */
10 {
11 public:
16  };
20  };
22  vault_manager();
24  void clear(void);
25  void init(void);
26  const bool initialized(void) const;
28  void select(void);
29  const std::string vault(void) const;
30  const bool selected(void) const;
31  void usage(uint16 &a_blocks, uint16 &a_inodes) const;
32  const bool overflow(bool a_report = false);
33  void delete_oldest_archive(void);
34  void prepare(bool a_assume_overflow = false);
35  const std::vector<std::string>& deleted_archives(void) const;
36  const bool err_deleted_archives(void) const;
38  const subdirectory get_archive_list(void);
40 private:
41  std::string m_selected_vault;
42  std::vector<std::string> m_deleted_archives;
43  bool m_da_err;
46 };
48 extern vault_manager vaulter;
50 #endif
void clear(void)
Clear the vault manager.
Definition: vaulter.cc:30
void init(void)
Initialize the vault manager.
Definition: vaulter.cc:40
simple_lock m_lock
Definition: vaulter.h:45
void usage(uint16 &a_blocks, uint16 &a_inodes) const
Return the percent of used blocks and used inodes in the selected vault.
Definition: vaulter.cc:317
const bool initialized(void) const
Return the initialized status of the vault manager.
Definition: vaulter.cc:47
const bool err_deleted_archives(void) const
Return whether or not there was an error deleting archives.
Definition: vaulter.cc:763
const std::vector< std::string > & deleted_archives(void) const
Return a list of deleted archives.
Definition: vaulter.cc:754
bool m_da_err
Definition: vaulter.h:43
Definition: vaulter.h:17
Definition: vaulter.cc:22
Select, monitor, and prepare vaults.
Definition: vaulter.h:9
std::vector< std::string > m_deleted_archives
Definition: vaulter.h:42
std::string m_selected_vault
Definition: vaulter.h:41
bool m_initialized
Definition: vaulter.h:44
void select(void)
Select a vault.
Definition: vaulter.cc:59
const subdirectory get_archive_list(void)
Return a list of archive directories in the selected vault.
Definition: vaulter.cc:262
A simple locking mechanism.
Definition: fs.h:343
Definition: vaulter.h:12
const std::string vault(void) const
Return the path to the selected vault.
Definition: vaulter.cc:291
void prepare(bool a_assume_overflow=false)
Prepare the selected vault.
Definition: vaulter.cc:686
void delete_oldest_archive(void)
Find the oldest archive in the vault and delete it.
Definition: vaulter.cc:433
const bool overflow(bool a_report=false)
Test to see if a vault has exceeded it's overflow threshold.
Definition: vaulter.cc:378
vault_manager vaulter
The global vault manager.
Definition: vaulter.cc:772
Retrieve a list of files in a subdirectory that match a given wildcard filename.
Definition: fs.h:273
const bool selected(void) const
Return whether or not a vault has been selected yet.
Definition: vaulter.cc:303