[niepce] Reindent
- From: Hubert Figuière <hub src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [niepce] Reindent
- Date: Wed, 10 Apr 2013 02:53:13 +0000 (UTC)
commit 5d09a4d145e22bdb28c84e7021d49a83399b135c
Author: Hubert Figuière <hub figuiere net>
Date: Wed Feb 27 19:32:02 2013 -0500
Reindent
src/fwk/toolkit/notificationcenter.cpp | 28 ++++++++++----------
src/fwk/toolkit/notificationcenter.hpp | 45 +++++++++++++++++--------------
src/niepce/notificationcenter.cpp | 9 ++++++
src/niepce/notificationcenter.hpp | 9 ++++++
4 files changed, 57 insertions(+), 34 deletions(-)
---
diff --git a/src/fwk/toolkit/notificationcenter.cpp b/src/fwk/toolkit/notificationcenter.cpp
index d396c46..010c4b0 100644
--- a/src/fwk/toolkit/notificationcenter.cpp
+++ b/src/fwk/toolkit/notificationcenter.cpp
@@ -1,5 +1,5 @@
/*
- * niepce - fwk/toolkit/notification.h
+ * niepce - fwk/toolkit/notification.cpp
*
* Copyright (C) 2007-2009 Hubert Figuiere
*
@@ -31,29 +31,29 @@ namespace fwk {
class NotificationCenter::Priv
{
public:
- Glib::Dispatcher m_dispatcher;
- fwk::MtQueue< Notification::Ptr > m_notificationQueue;
- std::map< int, subscription_t > m_subscribers;
+ Glib::Dispatcher m_dispatcher;
+ fwk::MtQueue< Notification::Ptr > m_notificationQueue;
+ std::map< int, subscription_t > m_subscribers;
};
NotificationCenter::NotificationCenter()
- : p( new Priv )
+ : p( new Priv )
{
- p->m_dispatcher.connect(
+ p->m_dispatcher.connect(
sigc::mem_fun(this, &NotificationCenter::_dispatch));
}
NotificationCenter::~NotificationCenter()
{
- delete p;
+ delete p;
}
void NotificationCenter::subscribe(int type, const subscriber_t & s)
{
- // TODO make sure it is not yet subscribed
- p->m_subscribers[type].connect(s);
+ // TODO make sure it is not yet subscribed
+ p->m_subscribers[type].connect(s);
}
void NotificationCenter::unsubscribe(int /*type*/, const subscriber_t & /*s*/)
@@ -65,16 +65,16 @@ void NotificationCenter::post(const Notification::Ptr & n)
{
/* called out of thread */
/* MUST be thread safe */
- p->m_notificationQueue.add(n);
- p->m_dispatcher.emit();
+ p->m_notificationQueue.add(n);
+ p->m_dispatcher.emit();
}
-
+
void NotificationCenter::_dispatch(void)
{
/* this is not pop() like in STL. */
- Notification::Ptr notif( p->m_notificationQueue.pop() );
+ Notification::Ptr notif( p->m_notificationQueue.pop() );
- Notification::mutex_t::Lock lock(notif->mutex());
+ Notification::mutex_t::Lock lock(notif->mutex());
p->m_subscribers[notif->type()](notif);
}
diff --git a/src/fwk/toolkit/notificationcenter.hpp b/src/fwk/toolkit/notificationcenter.hpp
index 3b2ba28..237d9c5 100644
--- a/src/fwk/toolkit/notificationcenter.hpp
+++ b/src/fwk/toolkit/notificationcenter.hpp
@@ -18,8 +18,6 @@
*/
-
-
#ifndef __FWK_NOTIFICATIONCENTER_H__
#define __FWK_NOTIFICATIONCENTER_H__
@@ -29,33 +27,40 @@
namespace fwk {
- class NotificationCenter
+class NotificationCenter
: public sigc::trackable
- {
- public:
- typedef std::tr1::shared_ptr< NotificationCenter > Ptr;
+{
+public:
+ typedef std::tr1::shared_ptr< NotificationCenter > Ptr;
typedef sigc::slot<void, Notification::Ptr> subscriber_t;
- NotificationCenter();
- ~NotificationCenter();
+ NotificationCenter();
+ ~NotificationCenter();
-
- // called from out of thread
- void post(const Notification::Ptr & n);
+ // called from out of thread
+ void post(const Notification::Ptr & n);
- void subscribe(int type, const subscriber_t & );
- void unsubscribe(int type, const subscriber_t & );
-
- private:
- typedef sigc::signal<void, Notification::Ptr> subscription_t;
+ void subscribe(int type, const subscriber_t & );
+ void unsubscribe(int type, const subscriber_t & );
- void _dispatch(void);
+private:
+ typedef sigc::signal<void, Notification::Ptr> subscription_t;
- class Priv;
- Priv *p;
- };
+ void _dispatch(void);
+ class Priv;
+ Priv *p;
+};
}
#endif
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
diff --git a/src/niepce/notificationcenter.cpp b/src/niepce/notificationcenter.cpp
index b0c1ec9..439cc54 100644
--- a/src/niepce/notificationcenter.cpp
+++ b/src/niepce/notificationcenter.cpp
@@ -60,3 +60,12 @@ void NotificationCenter::dispatch_notification(const fwk::Notification::Ptr &n)
}
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
diff --git a/src/niepce/notificationcenter.hpp b/src/niepce/notificationcenter.hpp
index 3fee7ec..2548c13 100644
--- a/src/niepce/notificationcenter.hpp
+++ b/src/niepce/notificationcenter.hpp
@@ -49,3 +49,12 @@ private:
}
#endif
+/*
+ Local Variables:
+ mode:c++
+ c-file-style:"stroustrup"
+ c-file-offsets:((innamespace . 0))
+ indent-tabs-mode:nil
+ fill-column:99
+ End:
+*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]