-
Notifications
You must be signed in to change notification settings - Fork 60
/
systemstate.h
54 lines (41 loc) · 976 Bytes
/
systemstate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef PLIB_SYTEMSTATE_H
#define PLIB_SYTEMSTATE_H
#include <map>
#include <vector>
#if !defined( _WIN32 )
#include <sys/stat.h>
#include <sys/types.h>
#endif
#include "../clib/maputil.h"
#include "../pol/polcfg.h"
namespace Pol
{
namespace Plib
{
class Tile;
class Package;
typedef std::vector<Package*> Packages;
typedef std::map<std::string, Package*, Clib::ci_cmp_pred> PackagesByName;
class SystemState
{
public:
SystemState();
~SystemState() = default;
SystemState( const SystemState& ) = delete;
SystemState& operator=( const SystemState& ) = delete;
void deinitialize();
// TODO: why two containers? keep the map when often name is searched?
Packages packages;
PackagesByName packages_byname;
bool accounts_txt_dirty;
struct stat accounts_txt_stat;
Core::PolConfig config;
Tile* tile;
bool tiles_loaded;
size_t estimatedSize() const;
private:
};
extern SystemState systemstate;
} // namespace Plib
} // namespace Pol
#endif