summaryrefslogtreecommitdiffstats
path: root/src/Daemon/ABRTPlugin.h
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-08-07 18:38:44 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-08-07 18:38:44 +0200
commitc210f6793f3f1d62ff241bb31c42938e05e9a783 (patch)
treea4330b922ee1ef549ff60070c34e13ecc9971926 /src/Daemon/ABRTPlugin.h
parentc64f91baf599133f88658e7a45a4d7e4a6c43d2b (diff)
downloadabrt-c210f6793f3f1d62ff241bb31c42938e05e9a783.tar.gz
abrt-c210f6793f3f1d62ff241bb31c42938e05e9a783.tar.xz
abrt-c210f6793f3f1d62ff241bb31c42938e05e9a783.zip
replace string memebers of plugin_info_t with const char*
Since they are constant, and we never ever want to change them, there is no benefit in having them as strings. This change removes one global data object's constructor and destructor from every applet .so module. 6k less code. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'src/Daemon/ABRTPlugin.h')
-rw-r--r--src/Daemon/ABRTPlugin.h78
1 files changed, 64 insertions, 14 deletions
diff --git a/src/Daemon/ABRTPlugin.h b/src/Daemon/ABRTPlugin.h
index cdf72bb3..2f3e83d1 100644
--- a/src/Daemon/ABRTPlugin.h
+++ b/src/Daemon/ABRTPlugin.h
@@ -33,10 +33,6 @@
class CABRTPlugin
{
private:
-
- typedef const plugin_info_t* p_plugin_info_t;
- typedef CPlugin* (*p_fn_plugin_new_t)();
-
/**
* A class containing library which contains plugin functionality.
* @see DynamicLibrary.h
@@ -45,11 +41,11 @@ class CABRTPlugin
/**
* A pointer to struc containing information about plugin.
*/
- p_plugin_info_t m_pPluginInfo;
+ const plugin_info_t* m_pPluginInfo;
/**
* A pointer to function, which creates new instances of plugin.
*/
- p_fn_plugin_new_t m_pFnPluginNew;
+ CPlugin* (*m_pFnPluginNew)();
public:
/**
@@ -66,42 +62,42 @@ class CABRTPlugin
* It is used for getting loaded plugin's version.
* @return plugin version
*/
- const std::string& GetVersion();
+ const char* GetVersion();
/**
* It is used for getting loaded plugin's magic number.
* @return magic number
*/
- const int GetMagicNumber();
+ int GetMagicNumber();
/**
* It is used for getting loaded plugin's name.
* @return magic number
*/
- const std::string& GetName();
+ const char* GetName();
/**
* It is used for getting loaded plugin's description.
* @return magic number
*/
- const std::string& GetDescription();
+ const char* GetDescription();
/**
* It is used for getting an author email of loaded plugin.
* @return description
*/
- const std::string& GetEmail();
+ const char* GetEmail();
/**
* It is used for getting a home page of loaded plugin.
* @return home page
*/
- const std::string& GetWWW();
+ const char* GetWWW();
/**
* It is used for getting a path to gui description.
* @return home page
*/
- const std::string& GetGTKBuilder();
+ const char* GetGTKBuilder();
/**
* It is used for getting loaded plugin's type.
* @return type
*/
- const plugin_type_t GetType();
+ plugin_type_t GetType();
/**
* It is used fot getting of a new instance of loaded plugin
* @return pointer to new allocated instance of plugin. A caller
@@ -110,4 +106,58 @@ class CABRTPlugin
CPlugin* PluginNew();
};
+inline
+const char* CABRTPlugin::GetVersion()
+{
+ return m_pPluginInfo->m_sVersion;
+}
+
+inline
+int CABRTPlugin::GetMagicNumber()
+{
+ return m_pPluginInfo->m_nMagicNumber;
+}
+
+inline
+const char* CABRTPlugin::GetName()
+{
+ return m_pPluginInfo->m_sName;
+}
+
+inline
+const char* CABRTPlugin::GetDescription()
+{
+ return m_pPluginInfo->m_sDescription;
+}
+
+inline
+const char* CABRTPlugin::GetEmail()
+{
+ return m_pPluginInfo->m_sEmail;
+}
+
+inline
+const char* CABRTPlugin::GetWWW()
+{
+ return m_pPluginInfo->m_sWWW;
+}
+
+inline
+const char* CABRTPlugin::GetGTKBuilder()
+{
+ return m_pPluginInfo->m_sGTKBuilder;
+}
+
+inline
+plugin_type_t CABRTPlugin::GetType()
+{
+ return m_pPluginInfo->m_Type;
+}
+
+inline
+CPlugin* CABRTPlugin::PluginNew()
+{
+ return m_pFnPluginNew();
+}
+
#endif /*ABRTPLUGIN_H_*/