Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef CUPT_SYSTEM_WORKER_SEEN
00019 #define CUPT_SYSTEM_WORKER_SEEN
00020
00022
00023 #include <map>
00024
00025 #include <cupt/common.hpp>
00026 #include <cupt/fwd.hpp>
00027 #include <cupt/system/resolver.hpp>
00028
00029 namespace cupt {
00030
00031 namespace internal {
00032
00033 class WorkerImpl;
00034
00035 }
00036
00037 namespace system {
00038
00040 class CUPT_API Worker
00041 {
00042 internal::WorkerImpl* __impl;
00043
00044 Worker(const Worker&);
00045 Worker& operator=(const Worker&);
00046 public:
00048 struct Action
00049 {
00050 enum Type {
00051 Install,
00052 Remove,
00053 Purge,
00054 Upgrade,
00055 Downgrade,
00056 Configure,
00057 Deconfigure,
00058 ProcessTriggers,
00059 Count
00060 };
00061 static const char* rawStrings[Count];
00062 };
00063 struct ActionsPreview
00064 {
00065 Resolver::SuggestedPackages groups[Action::Count];
00066
00067
00074 std::map< string, bool > autoFlagChanges;
00075 };
00076
00078
00082 Worker(const shared_ptr< const Config >& config, const shared_ptr< const Cache >& cache);
00083 virtual ~Worker();
00091 void setDesiredState(const Resolver::Offer& offer);
00108 void setPackagePurgeFlag(const string& packageName, bool value);
00109
00115 shared_ptr< const ActionsPreview > getActionsPreview() const;
00121 map< string, ssize_t > getUnpackedSizesPreview() const;
00127 pair< size_t, size_t > getDownloadSizesPreview() const;
00128
00135 void setAutomaticallyInstalledFlag(const string& packageName, bool value);
00142 void changeSystem(const shared_ptr< download::Progress >& progress);
00143
00150 void updateReleaseAndIndexData(const shared_ptr< download::Progress >& progress);
00151
00153
00160 vector< pair< string, shared_ptr< const BinaryVersion > > > getArchivesInfo() const;
00167 void deleteArchive(const string& path);
00171 void deletePartialArchives();
00172
00178 void saveSnapshot(const Snapshots&, const string& name);
00185 void renameSnapshot(const Snapshots&,
00186 const string& previousName, const string& newName);
00192 void removeSnapshot(const Snapshots&, const string& name);
00193 };
00194
00195 }
00196 }
00197
00198 #endif
00199