From 6996b441d9d104bc6d7041b64362f4426425f600 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 25 Nov 2013 14:26:46 +0000 Subject: (svn r26107) -Codechange/cleanup: remove some coding bloat and simplify the driver factory instatiations --- src/driver.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/driver.h') diff --git a/src/driver.h b/src/driver.h index 10a6863bc..246180270 100644 --- a/src/driver.h +++ b/src/driver.h @@ -60,8 +60,9 @@ DECLARE_POSTFIX_INCREMENT(Driver::Type) class DriverFactoryBase { private: Driver::Type type; ///< The type of driver. + int priority; ///< The priority of this factory. const char *name; ///< The name of the drivers of this factory. - int priority; ///< The priority of this factory. + const char *description; ///< The description of this driver. typedef std::map Drivers; ///< Type for a map of drivers. @@ -97,15 +98,11 @@ private: } protected: - void RegisterDriver(const char *name, Driver::Type type, int priority); - -public: - DriverFactoryBase() : - name(NULL) - {} + DriverFactoryBase(Driver::Type type, int priority, const char *name, const char *description); virtual ~DriverFactoryBase(); +public: /** * Shuts down all active drivers */ @@ -124,13 +121,16 @@ public: * Get a nice description of the driver-class. * @return The description. */ - virtual const char *GetDescription() = 0; + const char *GetDescription() const + { + return this->description; + } /** * Create an instance of this driver-class. * @return The instance. */ - virtual Driver *CreateInstance() = 0; + virtual Driver *CreateInstance() const = 0; }; #endif /* DRIVER_H */ -- cgit v1.2.3-54-g00ecf