]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/authorization/ao/ao.cpp
Code deduplication (plugin creation via template PLUGIN_CREATOR)
[stg.git] / projects / stargazer / plugins / authorization / ao / ao.cpp
index 193b20bc2e5ffe3160b6182b4c170541a9ab6caa..004210d2b5b030f18c13496e2906704f804af45c 100644 (file)
@@ -34,32 +34,20 @@ $Author: faust $
 #include "stg/users.h"
 #include "stg/user_property.h"
 #include "stg/common.h"
+#include "stg/plugin_creator.h"
 #include "ao.h"
 
-class AO_CREATOR
-{
-private:
-    AUTH_AO * ao;
-
-public:
-    AO_CREATOR()
-        : ao(new AUTH_AO())
-        {
-        };
-    ~AO_CREATOR()
-        {
-        delete ao;
-        };
-
-    AUTH_AO * GetPlugin()
-        {
-        return ao;
-        };
-};
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-AO_CREATOR aoc;
+PLUGIN_CREATOR<AUTH_AO> aoc;
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+PLUGIN * GetPlugin()
+{
+return aoc.GetPlugin();
+}
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
@@ -75,13 +63,6 @@ public:
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
-PLUGIN * GetPlugin()
-{
-return aoc.GetPlugin();
-}
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
 const string AUTH_AO::GetVersion() const
 {
 return "Always Online authorizator v.1.0";