aboutsummaryrefslogtreecommitdiff
path: root/data/inst/instancetype.h
diff options
context:
space:
mode:
authorAndrew <forkk@forkk.net>2013-02-18 15:39:01 -0600
committerAndrew <forkk@forkk.net>2013-02-18 15:39:01 -0600
commitd3c4db8f3444c8531cb5a02ce3c95d5673ffb1a5 (patch)
treee401e23b0ab69ee4b4c24f6e466b44add6026a09 /data/inst/instancetype.h
parent15c7efffa1af8c7b4fba710c30c53b6126bfa9db (diff)
downloadPrismLauncher-d3c4db8f3444c8531cb5a02ce3c95d5673ffb1a5.tar.gz
PrismLauncher-d3c4db8f3444c8531cb5a02ce3c95d5673ffb1a5.tar.bz2
PrismLauncher-d3c4db8f3444c8531cb5a02ce3c95d5673ffb1a5.zip
Implemented instance loader.
Diffstat (limited to 'data/inst/instancetype.h')
-rw-r--r--data/inst/instancetype.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/data/inst/instancetype.h b/data/inst/instancetype.h
index 1f187310..ec3f5b87 100644
--- a/data/inst/instancetype.h
+++ b/data/inst/instancetype.h
@@ -34,6 +34,8 @@ class InstanceType : public QObject
public:
explicit InstanceType(QObject *parent = 0);
+ friend class InstanceLoader;
+
/*!
* \brief Gets the ID for this instance type.
* By default this is the name of the Instance class that this type
@@ -57,6 +59,7 @@ public:
*/
virtual QString description() const = 0;
+protected:
/*!
* \brief Creates an instance and stores it in inst.
* \param inst Pointer to store the created instance in.
@@ -65,7 +68,7 @@ public:
* TypeNotRegistered if the given type is not registered with the InstanceLoader.
* InstExists if the given instance directory is already an instance.
*/
- virtual InstanceLoader::InstTypeError createInstance(Instance *inst, const QString &instDir) = 0;
+ virtual InstanceLoader::InstTypeError createInstance(Instance *inst, const QString &instDir) const = 0;
/*!
* \brief Loads an instance from the given directory.
@@ -74,8 +77,9 @@ public:
* \return An InstTypeError error code.
* TypeNotRegistered if the given type is not registered with the InstanceLoader.
* NotAnInstance if the given instance directory isn't a valid instance.
+ * WrongInstType if the given instance directory's type isn't an instance of this type.
*/
- virtual InstanceLoader::InstTypeError loadInstance(Instance *inst, const QString &instDir) = 0;
+ virtual InstanceLoader::InstTypeError loadInstance(Instance *inst, const QString &instDir) const = 0;
};
#endif // INSTANCETYPE_H