00001 /*!\file installedpackage.h 00002 \brief Declerations for InstalledPackage and PackageUpgrade. 00003 Should be included wherever InstalledPackages are used.*/ 00004 00005 #ifndef __INSTALLEDPACKAGE_H__ 00006 #define __INSTALLEDPACKAGE_H__ 00007 00008 #include <vector> 00009 #include "pmstring.h" 00010 #include "packageversion.h" 00011 #include "package.h" 00012 #include <db4.1/db_cxx.h> 00013 00014 //!Used to detail a package upgrade. 00015 /*!Used to detail a package upgrade. When executing an upgrade, 00016 be sure to be responsible and install the new version before removing 00017 the old one. Also check for errors so the user doesnt get a removed 00018 package instead of an upgraded one.*/ 00019 struct PackageUpgrade 00020 { 00021 PackageVersion oldVersion; //!<The old version to upgrade from. 00022 PackageVersion newVersion; //!<The new version to upgrade to. 00023 }; 00024 00025 //!Details a PackageVersion that is installed. 00026 /*!Details a PackageVersion that is installed. Inherits from PackageVersion. 00027 Doesn't have many functions, other than DB related ones, essentially just 00028 adds extra info to PackageVersion*/ 00029 class InstalledPackage : public PackageVersion 00030 { 00031 public: 00032 InstalledPackage(); //!<Default Constructor. 00033 InstalledPackage(const InstalledPackage ©); //!<Copy Constructor. 00034 InstalledPackage(const PackageVersion ©); //!<Copy Constructor. 00035 InstalledPackage(const Package ©); //!<Copy Constructor. 00036 virtual ~InstalledPackage(); //!<Destructor. 00037 00038 bool operator== (const InstalledPackage& param); //!<Equality operator. 00039 bool operator!= (const InstalledPackage& param); //!<Non equality operator. 00040 bool operator== (const PackageVersion& param); //!<Equality operator - with PackageVersion. 00041 bool operator!= (const PackageVersion& param); //!<Non equality operator - with PackageVersion. 00042 bool operator== (const Package& param); //!<Equality operator - with Package. 00043 bool operator!= (const Package& param); //!<Non equality operator - with Package. 00044 00045 virtual Dbt GetKey(); //!<Get DB Key. 00046 virtual Dbt GetData(); //!<Get DB Data. 00047 virtual void ReadData(Dbt data);//!<Read DB Data. 00048 virtual void ReadKey(Dbt key); //!<Read DB Key. 00049 00050 bool inWorld; //!<Is the package in World?. 00051 std::vector<PMString> virtuals; //!<The virtuals provided by the installed package. 00052 PMString useFlags; //!<The useFlags the package was installed with. 00053 00054 protected: 00055 int _VectorSize(std::vector<PMString> stringVector); //!<Utility function to get the size of a vector. 00056 }; 00057 00058 #endif