]> granicus.if.org Git - icinga2/commitdiff
Refactor the demo library.
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 25 Sep 2013 07:39:31 +0000 (09:39 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 25 Sep 2013 07:39:31 +0000 (09:39 +0200)
components/demo/Makefile.am
components/demo/demo-type.conf
components/demo/demo.cpp [moved from components/demo/democomponent.cpp with 88% similarity]
components/demo/demo.h [moved from components/demo/democomponent.h with 89% similarity]

index c2389f1c53372d39701a1956eb6110894e96ada6..df5e5963e1726e0f02f0278b28aff5db9fb92dd3 100644 (file)
@@ -10,8 +10,8 @@ CLEANFILES = \
        $(top_builddir)/tools/mkembedconfig/mkembedconfig $< $@
 
 libdemo_la_SOURCES = \
-       democomponent.cpp \
-       democomponent.h \
+       demo.cpp \
+       demo.h \
        demo-type.conf
 
 libdemo_la_CPPFLAGS = \
index 4d4fa17f23c8b1aabcc966b938b078540dd78ceb..1ec369dea565acc5f56ca388014cb7ed7ddcdaf7 100644 (file)
@@ -17,5 +17,5 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-type DemoComponent {
+type Demo {
 }
similarity index 88%
rename from components/demo/democomponent.cpp
rename to components/demo/demo.cpp
index 7c94a6dc0760e888c0bc9509b74d3cc68c2cfad8..4ec78f9f7d46cff23b879a35277b24bc59260aa1 100644 (file)
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#include "demo/democomponent.h"
+#include "demo/demo.h"
 #include "base/dynamictype.h"
 #include "base/logger_fwd.h"
 #include <boost/smart_ptr/make_shared.hpp>
 
 using namespace icinga;
 
-REGISTER_TYPE(DemoComponent);
+REGISTER_TYPE(Demo);
 
 /**
  * Starts the component.
  */
-void DemoComponent::Start(void)
+void Demo::Start(void)
 {
        DynamicObject::Start();
 
        m_DemoTimer = boost::make_shared<Timer>();
        m_DemoTimer->SetInterval(5);
-       m_DemoTimer->OnTimerExpired.connect(boost::bind(&DemoComponent::DemoTimerHandler, this));
+       m_DemoTimer->OnTimerExpired.connect(boost::bind(&Demo::DemoTimerHandler, this));
        m_DemoTimer->Start();
 }
 
 /**
  * Stops the component.
  */
-void DemoComponent::Stop(void)
+void Demo::Stop(void)
 {
        /* Nothing to do here. */
 }
@@ -52,7 +52,7 @@ void DemoComponent::Stop(void)
  *
  * @param - Event arguments for the timer.
  */
-void DemoComponent::DemoTimerHandler(void)
+void Demo::DemoTimerHandler(void)
 {
        Log(LogInformation, "demo", "Hello World!");
 }
similarity index 89%
rename from components/demo/democomponent.h
rename to components/demo/demo.h
index a03671e9ec146e0964bde4c151896ffe5bff2a46..860ae227239c27f34c2b768aa86d991628788f43 100644 (file)
@@ -17,8 +17,8 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
  ******************************************************************************/
 
-#ifndef DEMOCOMPONENT_H
-#define DEMOCOMPONENT_H
+#ifndef DEMO_H
+#define DEMO_H
 
 #include "base/dynamicobject.h"
 #include "base/timer.h"
@@ -29,11 +29,11 @@ namespace icinga
 /**
  * @ingroup demo
  */
-class DemoComponent : public DynamicObject
+class Demo : public DynamicObject
 {
 public:
-       DECLARE_PTR_TYPEDEFS(DemoComponent);
-       DECLARE_TYPENAME(DemoComponent);
+       DECLARE_PTR_TYPEDEFS(Demo);
+       DECLARE_TYPENAME(Demo);
 
        virtual void Start(void);
        virtual void Stop(void);
@@ -46,4 +46,4 @@ private:
 
 }
 
-#endif /* DEMOCOMPONENT_H */
+#endif /* DEMO_H */