From: Pawel Sikorski
Date: Wed, 6 Feb 2013 12:53:31 +0000 (+0100)
Subject: Source code formating unification
X-Git-Tag: 2.1b_release~6^2~39
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=66378dd435c0d04db5467429987eb98d49ebf2a6;p=framework%2Fweb%2Fwrt-commons.git
Source code formating unification
[Issue#] N/A
[Problem] Source code was not formatted to any rules. In this situation
creating new patches or making review may become uncomfortable.
[Cause] No formatting rules/tool used.
[Solution] To make implementation and review process more comfortable,
whole commons repository source code has been formatted with uncrustify tool.
The configuration of the tool is located in the repository (./uncrustify.cfg).
Command used (stored in uncrustify.sh):
uncrustify -c ./uncrustify.cfg --no-backup `find . -regex
"\(.*\.cpp\|.*\.h\|.*\.c\|.*\.cc\)" | grep -v
"orm.h\|orm_generator.h\|3rdpartyi\|examples"`
[Verification] Build the repository
Change-Id: I3ee7d6af0408b760a3af003e488c1e48dfaf0395
---
diff --git a/modules/auto_save_dao/dao/AutoSaveDatabase.cpp b/modules/auto_save_dao/dao/AutoSaveDatabase.cpp
index 16813c9..5b21316 100644
--- a/modules/auto_save_dao/dao/AutoSaveDatabase.cpp
+++ b/modules/auto_save_dao/dao/AutoSaveDatabase.cpp
@@ -26,5 +26,5 @@ DPL::DB::SqlConnection::Flag::Type AUTOSAVE_DB_FLAGS =
DPL::Mutex g_autoSaveDbQueriesMutex;
DPL::DB::ThreadDatabaseSupport Interface::m_autoSavedbInterface(
- AUTOSAVE_DB_DATABASE, AUTOSAVE_DB_FLAGS);
+ AUTOSAVE_DB_DATABASE, AUTOSAVE_DB_FLAGS);
diff --git a/modules/auto_save_dao/dao/auto_save_dao.cpp b/modules/auto_save_dao/dao/auto_save_dao.cpp
index 9c811a9..8c9ecf5 100644
--- a/modules/auto_save_dao/dao/auto_save_dao.cpp
+++ b/modules/auto_save_dao/dao/auto_save_dao.cpp
@@ -30,7 +30,6 @@ using namespace DPL::DB::ORM::autosave;
using namespace AutoSaveDB::Interface;
namespace AutoSaveDB {
-
#define SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN Try
#define SQL_CONNECTION_EXCEPTION_HANDLER_END(message) \
@@ -42,12 +41,10 @@ namespace AutoSaveDB {
AutoSaveDAO::AutoSaveDAO() :
AutoSaveDAOReadOnly()
-{
-}
+{}
AutoSaveDAO::~AutoSaveDAO()
-{
-}
+{}
void AutoSaveDAO::attachDatabaseRW(void)
{
@@ -60,8 +57,10 @@ void AutoSaveDAO::detachDatabase(void)
m_autoSavedbInterface.DetachFromThread();
}
-void AutoSaveDAO::setAutoSaveSubmitFormData(const DPL::String &url,
- const SubmitFormData &submitFormData)
+void AutoSaveDAO::setAutoSaveSubmitFormData(
+ const DPL::String &url,
+ const SubmitFormData &
+ submitFormData)
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
@@ -95,5 +94,4 @@ void AutoSaveDAO::setAutoSaveSubmitFormData(const DPL::String &url,
}
#undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
#undef SQL_CONNECTION_EXCEPTION_HANDLER_END
-
} // namespace AutoSaveDB
diff --git a/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp b/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp
index 28e0bb6..0089e19 100644
--- a/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp
+++ b/modules/auto_save_dao/dao/auto_save_dao_read_only.cpp
@@ -31,9 +31,7 @@ using namespace DPL::DB::ORM;
using namespace DPL::DB::ORM::autosave;
using namespace AutoSaveDB::Interface;
-
namespace AutoSaveDB {
-
#define SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN Try
#define SQL_CONNECTION_EXCEPTION_HANDLER_END(message) \
@@ -44,12 +42,10 @@ namespace AutoSaveDB {
}
AutoSaveDAOReadOnly::AutoSaveDAOReadOnly()
-{
-}
+{}
AutoSaveDAOReadOnly::~AutoSaveDAOReadOnly()
-{
-}
+{}
void AutoSaveDAOReadOnly::attachDatabaseRO(void)
{
@@ -67,7 +63,9 @@ SubmitFormData AutoSaveDAOReadOnly::getAutoSaveSubmitFormData(
{
SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
{
- AUTOSAVE_DB_SELECT(select, AutoSaveSubmitFormElement, &m_autoSavedbInterface);
+ AUTOSAVE_DB_SELECT(select,
+ AutoSaveSubmitFormElement,
+ &m_autoSavedbInterface);
select->Where(Equals(url));
AutoSaveSubmitFormElement::Select::RowList rows = select->GetRowList();
@@ -85,5 +83,4 @@ SubmitFormData AutoSaveDAOReadOnly::getAutoSaveSubmitFormData(
#undef SQL_CONNECTION_EXCEPTION_HANDLER_BEGIN
#undef SQL_CONNECTION_EXCEPTION_HANDLER_END
-
} // namespace AutoSaveDB
diff --git a/modules/auto_save_dao/dao/common_dao_types.cpp b/modules/auto_save_dao/dao/common_dao_types.cpp
index 0eb25c5..5dec0e7 100644
--- a/modules/auto_save_dao/dao/common_dao_types.cpp
+++ b/modules/auto_save_dao/dao/common_dao_types.cpp
@@ -25,5 +25,4 @@
#include
#include
-namespace AutoSaveDB {
-} // namespace AutoSaveDB
+namespace AutoSaveDB {} // namespace AutoSaveDB
diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h
index 96a665b..7c1c449 100644
--- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h
+++ b/modules/auto_save_dao/include/wrt-commons/auto-save-dao-ro/auto_save_dao_read_only.h
@@ -31,7 +31,6 @@
#include
namespace AutoSaveDB {
-
class AutoSaveDAOReadOnly
{
public:
@@ -57,10 +56,8 @@ class AutoSaveDAOReadOnly
* This method gets Autofill for Webkit
*/
static SubmitFormData getAutoSaveSubmitFormData(
- const DPL::String &url);
-
+ const DPL::String &url);
};
-
} // namespace AutoSaveDB
#endif // _AUTO_SAVE_DAO_READ_ONLY_H_
diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h
index 123d5f1..d0bd940 100644
--- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h
+++ b/modules/auto_save_dao/include/wrt-commons/auto-save-dao-rw/auto_save_dao.h
@@ -27,7 +27,6 @@
#include
namespace AutoSaveDB {
-
class AutoSaveDAO : public AutoSaveDAOReadOnly
{
public:
@@ -42,9 +41,8 @@ class AutoSaveDAO : public AutoSaveDAOReadOnly
* This method sets Autofill for Webkit
*/
static void setAutoSaveSubmitFormData(
- const DPL::String& url, const SubmitFormData &submitFormData);
+ const DPL::String& url, const SubmitFormData &submitFormData);
};
-
} // namespace AutoSaveDB
#endif // _AUTO_SAVE_DAO_H_
diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h
index 93404c6..3d7bcd2 100644
--- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h
+++ b/modules/auto_save_dao/include/wrt-commons/auto-save-dao/AutoSaveDatabase.h
@@ -24,15 +24,15 @@
extern DPL::Mutex g_autoSaveDbQueriesMutex;
#define AUTOSAVE_DB_INTERNAL(tlsCommand, InternalType, interface) \
- static DPL::ThreadLocalVariable *tlsCommand ## Ptr = NULL; \
+ static DPL::ThreadLocalVariable *tlsCommand##Ptr = NULL; \
{ \
DPL::Mutex::ScopedLock lock(&g_autoSaveDbQueriesMutex); \
- if (!tlsCommand ## Ptr) { \
+ if (!tlsCommand##Ptr) { \
static DPL::ThreadLocalVariable tmp; \
- tlsCommand ## Ptr = &tmp; \
+ tlsCommand##Ptr = &tmp; \
} \
} \
- DPL::ThreadLocalVariable &tlsCommand = *tlsCommand ## Ptr; \
+ DPL::ThreadLocalVariable &tlsCommand = *tlsCommand##Ptr; \
if (tlsCommand.IsNull()) { tlsCommand = InternalType(interface); }
#define AUTOSAVE_DB_SELECT(name, type, interface) \
@@ -49,9 +49,7 @@ extern DPL::Mutex g_autoSaveDbQueriesMutex;
namespace AutoSaveDB {
namespace Interface {
-
extern DPL::DB::ThreadDatabaseSupport m_autoSavedbInterface;
-
} // namespace Interface
} // namespace AutoSaveDB
diff --git a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h b/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h
index 420725d..f0c22b6 100644
--- a/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h
+++ b/modules/auto_save_dao/include/wrt-commons/auto-save-dao/common_dao_types.h
@@ -28,28 +28,25 @@
#include
namespace AutoSaveDB {
-
struct SubmitFormElement
{
DPL::String key;
DPL::String value;
SubmitFormElement()
- {
- }
+ {}
SubmitFormElement(
const DPL::String& keyData,
const DPL::String& valueData) :
key(keyData),
value(valueData)
- {
- }
+ {}
bool operator== (const SubmitFormElement& other) const
{
return (!DPL::StringCompare(key, other.key) &&
- !DPL::StringCompare(value, other.value));
+ !DPL::StringCompare(value, other.value));
}
bool operator!= (const SubmitFormElement& other) const
@@ -58,7 +55,6 @@ struct SubmitFormElement
}
};
typedef std::list SubmitFormData;
-
} // namespace AutoSaveDB
#endif /* SHARE_COMMON_DAO_TYPES_H_ */
diff --git a/modules/core/include/dpl/abstract_input.h b/modules/core/include/dpl/abstract_input.h
index 89ed8fc..8c0e16a 100644
--- a/modules/core/include/dpl/abstract_input.h
+++ b/modules/core/include/dpl/abstract_input.h
@@ -25,22 +25,21 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
class BinaryQueue;
typedef std::auto_ptr BinaryQueueAutoPtr;
class AbstractInput
{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, ReadFailed)
};
-public:
+ public:
virtual ~AbstractInput() {}
/**
diff --git a/modules/core/include/dpl/abstract_input_output.h b/modules/core/include/dpl/abstract_input_output.h
index f775afc..153d5c4 100644
--- a/modules/core/include/dpl/abstract_input_output.h
+++ b/modules/core/include/dpl/abstract_input_output.h
@@ -25,16 +25,14 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractInputOutput :
+ public AbstractInput,
+ public AbstractOutput
{
-class AbstractInputOutput
- : public AbstractInput,
- public AbstractOutput
-{
-public:
+ public:
virtual ~AbstractInputOutput() {}
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_INPUT_OUTPUT_H
diff --git a/modules/core/include/dpl/abstract_output.h b/modules/core/include/dpl/abstract_output.h
index 160907c..56c86fb 100644
--- a/modules/core/include/dpl/abstract_output.h
+++ b/modules/core/include/dpl/abstract_output.h
@@ -25,22 +25,21 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
class BinaryQueue;
typedef std::auto_ptr BinaryQueueAutoPtr;
class AbstractOutput
{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, WriteFailed)
};
-public:
+ public:
virtual ~AbstractOutput() {}
/**
@@ -50,7 +49,8 @@ public:
*
* @param[in] buffer Input buffer with data to be written
* @param[in] bufferSize Maximum number of bytes to write from buffer
- * @return Number of bytes success successfuly written or zero if output is blocked
+ * @return Number of bytes success successfuly written or zero if output is
+ * blocked
* @throw WriteFailed
*/
virtual size_t Write(const BinaryQueue &buffer, size_t bufferSize) = 0;
diff --git a/modules/core/include/dpl/abstract_waitable_input.h b/modules/core/include/dpl/abstract_waitable_input.h
index 6b39ea7..9d957d6 100644
--- a/modules/core/include/dpl/abstract_waitable_input.h
+++ b/modules/core/include/dpl/abstract_waitable_input.h
@@ -25,18 +25,15 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractWaitableInput :
+ public AbstractInput
{
-
-class AbstractWaitableInput
- : public AbstractInput
-{
-public:
+ public:
virtual ~AbstractWaitableInput() {}
virtual WaitableHandle WaitableReadHandle() const = 0;
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_WAITABLE_INPUT_H
diff --git a/modules/core/include/dpl/abstract_waitable_input_adapter.h b/modules/core/include/dpl/abstract_waitable_input_adapter.h
index a9d396a..43efaee 100644
--- a/modules/core/include/dpl/abstract_waitable_input_adapter.h
+++ b/modules/core/include/dpl/abstract_waitable_input_adapter.h
@@ -26,24 +26,21 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractWaitableInputAdapter :
+ public AbstractWaitableInput
{
-
-class AbstractWaitableInputAdapter
- : public AbstractWaitableInput
-{
-private:
+ private:
AbstractInput *m_input;
WaitableEvent m_waitableEvent;
-public:
+ public:
explicit AbstractWaitableInputAdapter(AbstractInput *input);
virtual BinaryQueueAutoPtr Read(size_t size);
virtual WaitableHandle WaitableReadHandle() const;
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_WAITABLE_INPUT_ADAPTER_H
diff --git a/modules/core/include/dpl/abstract_waitable_input_output.h b/modules/core/include/dpl/abstract_waitable_input_output.h
index 3d3e6f2..e858f51 100644
--- a/modules/core/include/dpl/abstract_waitable_input_output.h
+++ b/modules/core/include/dpl/abstract_waitable_input_output.h
@@ -25,17 +25,14 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractWaitableInputOutput :
+ public AbstractWaitableInput,
+ public AbstractWaitableOutput
{
-
-class AbstractWaitableInputOutput
- : public AbstractWaitableInput,
- public AbstractWaitableOutput
-{
-public:
+ public:
virtual ~AbstractWaitableInputOutput() {}
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_WAITABLE_INPUT_OUTPUT_H
diff --git a/modules/core/include/dpl/abstract_waitable_input_output_adapter.h b/modules/core/include/dpl/abstract_waitable_input_output_adapter.h
index 6ac2228..a0322d0 100644
--- a/modules/core/include/dpl/abstract_waitable_input_output_adapter.h
+++ b/modules/core/include/dpl/abstract_waitable_input_output_adapter.h
@@ -26,17 +26,15 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractWaitableInputOutputAdapter :
+ public AbstractWaitableInputAdapter,
+ public AbstractWaitableOutputAdapter
{
-
-class AbstractWaitableInputOutputAdapter
- : public AbstractWaitableInputAdapter,
- public AbstractWaitableOutputAdapter
-{
-public:
- explicit AbstractWaitableInputOutputAdapter(AbstractInputOutput *inputOutput);
+ public:
+ explicit AbstractWaitableInputOutputAdapter(
+ AbstractInputOutput *inputOutput);
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_WAITABLE_INPUT_OUTPUT_ADAPTER_H
diff --git a/modules/core/include/dpl/abstract_waitable_output.h b/modules/core/include/dpl/abstract_waitable_output.h
index 6cc8d23..abcc3f8 100644
--- a/modules/core/include/dpl/abstract_waitable_output.h
+++ b/modules/core/include/dpl/abstract_waitable_output.h
@@ -25,18 +25,15 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractWaitableOutput :
+ public AbstractOutput
{
-
-class AbstractWaitableOutput
- : public AbstractOutput
-{
-public:
+ public:
virtual ~AbstractWaitableOutput() {}
virtual WaitableHandle WaitableWriteHandle() const = 0;
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_WAITABLE_OUTPUT_H
diff --git a/modules/core/include/dpl/abstract_waitable_output_adapter.h b/modules/core/include/dpl/abstract_waitable_output_adapter.h
index 64fc3b3..9e40bc4 100644
--- a/modules/core/include/dpl/abstract_waitable_output_adapter.h
+++ b/modules/core/include/dpl/abstract_waitable_output_adapter.h
@@ -26,24 +26,21 @@
#include
#include
-namespace DPL
+namespace DPL {
+class AbstractWaitableOutputAdapter :
+ public AbstractWaitableOutput
{
-
-class AbstractWaitableOutputAdapter
- : public AbstractWaitableOutput
-{
-private:
+ private:
AbstractOutput *m_output;
WaitableEvent m_waitableEvent;
-public:
+ public:
explicit AbstractWaitableOutputAdapter(AbstractOutput *output);
virtual size_t Write(const BinaryQueue &buffer, size_t bufferSize);
virtual WaitableHandle WaitableWriteHandle() const;
};
-
} // namespace DPL
#endif // DPL_ABSTRACT_WAITABLE_OUTPUT_ADAPTER_H
diff --git a/modules/core/include/dpl/address.h b/modules/core/include/dpl/address.h
index 7b1d8e8..05893f9 100644
--- a/modules/core/include/dpl/address.h
+++ b/modules/core/include/dpl/address.h
@@ -25,23 +25,22 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
class Address
{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, InvalidAddress)
};
-private:
+ private:
std::string m_address;
unsigned short m_port;
-public:
+ public:
Address();
Address(const std::string &address);
Address(const std::string &address, unsigned short port);
@@ -55,7 +54,6 @@ public:
bool operator<(const Address &addr) const;
};
-
} // namespace DPL
#endif // DPL_ADDRESS_H
diff --git a/modules/core/include/dpl/aligned.h b/modules/core/include/dpl/aligned.h
index 902deb6..4400545 100644
--- a/modules/core/include/dpl/aligned.h
+++ b/modules/core/include/dpl/aligned.h
@@ -17,7 +17,8 @@
* @file aligned.h
* @author Lukasz Wrzosek (l.wrzosek@samsung.com)
* @version 1.0
- * @brief This file is the implementation file of aligned attribute from gcc
+ * @brief This file is the implementation file of aligned attribute from
+ * gcc
*/
#ifndef DPL_ALIGNED_H
#define DPL_ALIGNED_H
diff --git a/modules/core/include/dpl/application.h b/modules/core/include/dpl/application.h
index f2c309e..d4d9754 100644
--- a/modules/core/include/dpl/application.h
+++ b/modules/core/include/dpl/application.h
@@ -28,27 +28,26 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
class Application
{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, TooManyInstances)
DECLARE_EXCEPTION_TYPE(Base, FrameworkError)
};
-private:
+ private:
static int app_create(void *data);
static int app_terminate(void *data);
static int app_pause(void *data);
static int app_resume(void *data);
static int app_reset(bundle *b, void *data);
-protected:
+ protected:
int m_argc;
char **m_argv;
std::string m_applicationName;
@@ -67,15 +66,18 @@ protected:
virtual void OnLowBattery();
virtual void OnLanguageChanged();
-public:
- Application(int argc, char **argv, const std::string &applicationName, bool showMainWindow = true);
+ public:
+ Application(int argc,
+ char **argv,
+ const std::string &applicationName,
+ bool showMainWindow = true);
virtual ~Application();
/**
* @brief Execute application and start message processing
*/
virtual int Exec();
-
+
/*
* @brief Sends quit message to application message loop
*/
@@ -84,8 +86,11 @@ public:
class ApplicationExt : public Application
{
-public:
- ApplicationExt(int argc, char **argv, const std::string &applicationName, bool showMainWindow = true);
+ public:
+ ApplicationExt(int argc,
+ char **argv,
+ const std::string &applicationName,
+ bool showMainWindow = true);
virtual ~ApplicationExt();
/**
@@ -97,10 +102,10 @@ public:
* @brief Sends quit message to application message loop
*/
virtual void Quit();
-private:
+
+ private:
static DPL::Atomic m_useCount;
};
-
} // namespace DPL
#endif // DPL_APPLICATION_H
diff --git a/modules/core/include/dpl/apply.h b/modules/core/include/dpl/apply.h
index f441072..fc1be53 100644
--- a/modules/core/include/dpl/apply.h
+++ b/modules/core/include/dpl/apply.h
@@ -29,8 +29,7 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
enum class ExtraArgsInsertPolicy
{
/**
@@ -59,7 +58,7 @@ Result Apply(Operation op,
ArgsE && ... extra)
{
return _ApplyDispatchByPolicy::
- template Apply(op, t, std::forward(extra) ...);
+ template Apply(op, t, std::forward(extra) ...);
}
template
@@ -76,11 +75,11 @@ struct _ApplyTuple
Args && ... args)
{
return _ApplyTuple::
- template Apply(op,
- t1,
- t2,
- std::get(t1),
- std::forward(args) ...);
+ template Apply(op,
+ t1,
+ t2,
+ std::get(t1),
+ std::forward(args) ...);
}
};
@@ -98,11 +97,11 @@ struct _ApplyTuple<0, M>
Args && ... args)
{
return _ApplyTuple<0, M - 1>::
- template Apply(op,
- t1,
- t2,
- std::get(t2),
- std::forward(args) ...);
+ template Apply(op,
+ t1,
+ t2,
+ std::get(t2),
+ std::forward(args) ...);
}
};
@@ -131,14 +130,14 @@ struct _ApplyArgs
typename ... ArgsT,
typename ... Args>
static Result Apply(Operation op,
- const std::tuple& t,
- Args && ... args)
+ const std::tuple& t,
+ Args && ... args)
{
return _ApplyArgs::
- template Apply(op,
- t,
- std::get(t),
- std::forward(args) ...);
+ template Apply(op,
+ t,
+ std::get(t),
+ std::forward(args) ...);
}
};
@@ -169,9 +168,9 @@ struct _ApplyDispatchByPolicy
ArgsE && ... extra)
{
return _ApplyArgs::
- template Apply(op,
- t,
- std::forward(extra) ...);
+ template Apply(op,
+ t,
+ std::forward(extra) ...);
}
};
@@ -187,9 +186,10 @@ struct _ApplyDispatchByPolicy
ArgsE && ... extra)
{
return _ApplyTuple::
- template Apply(op,
- t,
- std::make_tuple(std::forward(extra) ...));
+ template Apply(op,
+ t,
+ std::make_tuple(std::forward(
+ extra) ...));
}
};
} // namespace DPL
diff --git a/modules/core/include/dpl/assert.h b/modules/core/include/dpl/assert.h
index f0b62f7..59331a0 100644
--- a/modules/core/include/dpl/assert.h
+++ b/modules/core/include/dpl/assert.h
@@ -24,14 +24,20 @@
#include
-namespace DPL
-{
+namespace DPL {
// Assertion handler procedure
// Do not call directly
// Always use Assert macro
-DPL_NORETURN void AssertProc(const char *condition, const char *file, int line, const char *function);
+DPL_NORETURN void AssertProc(const char *condition,
+ const char *file,
+ int line,
+ const char *function);
} // namespace DPL
-#define Assert(Condition) do { if (!(Condition)) DPL::AssertProc(#Condition, __FILE__, __LINE__, __FUNCTION__); } while (0)
+#define Assert(Condition) do { if (!(Condition)) { DPL::AssertProc(#Condition, \
+ __FILE__, \
+ __LINE__, \
+ __FUNCTION__); \
+ } } while (0)
#endif // DPL_ASSERT_H
diff --git a/modules/core/include/dpl/atomic.h b/modules/core/include/dpl/atomic.h
index 33ea8a9..50c4a1a 100644
--- a/modules/core/include/dpl/atomic.h
+++ b/modules/core/include/dpl/atomic.h
@@ -25,17 +25,16 @@
#pragma GCC system_header
#include
-namespace DPL
-{
+namespace DPL {
class Atomic
{
-public:
+ public:
typedef gint ValueType;
-private:
+ private:
volatile ValueType m_value;
-public:
+ public:
Atomic(ValueType value = static_cast(0));
ValueType ExchangeAndAdd(ValueType value);
diff --git a/modules/core/include/dpl/auto_ptr.h b/modules/core/include/dpl/auto_ptr.h
index 5fa458e..f5838d8 100644
--- a/modules/core/include/dpl/auto_ptr.h
+++ b/modules/core/include/dpl/auto_ptr.h
@@ -38,7 +38,7 @@ struct UniversalFree {};
#define DECLARE_DELETER(type, function) \
template <> \
struct UniversalFree { \
- void universal_free(type *ptr){ \
+ void universal_free(type * ptr){ \
if (ptr) { \
function(ptr); } \
} \
@@ -50,8 +50,7 @@ class AutoPtr
public:
AutoPtr(T *ptr) :
m_data(ptr)
- {
- }
+ {}
AutoPtr(const AutoPtr &second)
{
diff --git a/modules/core/include/dpl/binary_queue.h b/modules/core/include/dpl/binary_queue.h
index ae85ceb..f4fa278 100644
--- a/modules/core/include/dpl/binary_queue.h
+++ b/modules/core/include/dpl/binary_queue.h
@@ -28,30 +28,32 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
/**
* Binary stream implemented as constant size bucket list
*
* @todo Add optimized implementation for FlattenConsume
*/
-class BinaryQueue
- : public AbstractInputOutput
+class BinaryQueue :
+ public AbstractInputOutput
{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, OutOfData)
};
- typedef void (*BufferDeleter)(const void *buffer, size_t bufferSize, void *userParam);
- static void BufferDeleterFree(const void *buffer, size_t bufferSize, void *userParam);
+ typedef void (*BufferDeleter)(const void *buffer, size_t bufferSize,
+ void *userParam);
+ static void BufferDeleterFree(const void *buffer,
+ size_t bufferSize,
+ void *userParam);
class BucketVisitor
{
- public:
+ public:
/**
* Destructor
*/
@@ -67,9 +69,9 @@ public:
virtual void OnVisitBucket(const void *buffer, size_t bufferSize) = 0;
};
-private:
- struct Bucket
- : private Noncopyable
+ private:
+ struct Bucket :
+ private Noncopyable
{
const void *buffer;
const void *ptr;
@@ -79,7 +81,10 @@ private:
BufferDeleter deleter;
void *param;
- Bucket(const void *buffer, size_t bufferSize, BufferDeleter deleter, void *userParam);
+ Bucket(const void *buffer,
+ size_t bufferSize,
+ BufferDeleter deleter,
+ void *userParam);
virtual ~Bucket();
};
@@ -91,17 +96,17 @@ private:
class BucketVisitorCall
{
- private:
+ private:
BucketVisitor *m_visitor;
- public:
+ public:
BucketVisitorCall(BucketVisitor *visitor);
virtual ~BucketVisitorCall();
void operator()(Bucket *bucket) const;
};
-public:
+ public:
/**
* Construct empty binary queue
*/
@@ -148,17 +153,24 @@ public:
* @return none
* @param[in] buffer Pointer to data buffer
* @param[in] bufferSize Number of bytes available in buffer
- * @param[in] deleter Pointer to deleter procedure used to free provided buffer
+ * @param[in] deleter Pointer to deleter procedure used to free provided
+ * buffer
* @param[in] userParam User parameter passed to deleter routine
* @exception std::bad_alloc Cannot allocate memory to hold additional data
*/
- void AppendUnmanaged(const void *buffer, size_t bufferSize, BufferDeleter deleter = &BinaryQueue::BufferDeleterFree, void *userParam = NULL);
+ void AppendUnmanaged(
+ const void *buffer,
+ size_t bufferSize,
+ BufferDeleter deleter =
+ &BinaryQueue::BufferDeleterFree,
+ void *userParam = NULL);
/**
* Append copy of other binary queue to the end of this binary queue
*
* @return none
- * @param[in] other Constant reference to other binary queue to copy data from
+ * @param[in] other Constant reference to other binary queue to copy data
+ * from
* @exception std::bad_alloc Cannot allocate memory to hold additional data
* @warning One cannot assume that bucket structure is preserved during copy
*/
diff --git a/modules/core/include/dpl/char_traits.h b/modules/core/include/dpl/char_traits.h
index 1b50c51..eb2988f 100644
--- a/modules/core/include/dpl/char_traits.h
+++ b/modules/core/include/dpl/char_traits.h
@@ -17,8 +17,10 @@
* @file char_traits.h
* @author Piotr Marcinkiewicz (p.marcinkiew@samsung.com)
* @version 1.0
- * @brief Char traits are used to create basic_string extended with additional features
- * Current char traits could be extended in feature to boost performance
+ * @brief Char traits are used to create basic_string extended with
+ * additional features
+ * Current char traits could be extended in feature to boost
+ * performance
*/
#ifndef DPL_CHAR_TRAITS
#define DPL_CHAR_TRAITS
@@ -29,11 +31,8 @@
#include
#include
-namespace DPL
-{
-
+namespace DPL {
typedef std::char_traits CharTraits;
-
} // namespace DPL
#endif // DPL_CHAR_TRAITS
diff --git a/modules/core/include/dpl/colors.h b/modules/core/include/dpl/colors.h
index efc104d..c7cfd53 100644
--- a/modules/core/include/dpl/colors.h
+++ b/modules/core/include/dpl/colors.h
@@ -24,15 +24,9 @@
#ifndef DPL_COLORS_H
#define DPL_COLORS_H
-namespace DPL
-{
-
-namespace Colors
-{
-
-namespace Text
-{
-
+namespace DPL {
+namespace Colors {
+namespace Text {
extern const char* BOLD_GREEN_BEGIN;
extern const char* BOLD_GREEN_END;
extern const char* PURPLE_BEGIN;
@@ -51,12 +45,9 @@ extern const char* BOLD_GOLD_BEGIN;
extern const char* BOLD_GOLD_END;
extern const char* BOLD_WHITE_BEGIN;
extern const char* BOLD_WHITE_END;
-
} //namespace Text
-namespace Html
-{
-
+namespace Html {
extern const char* BOLD_GREEN_BEGIN;
extern const char* BOLD_GREEN_END;
extern const char* PURPLE_BEGIN;
@@ -75,11 +66,8 @@ extern const char* BOLD_GOLD_BEGIN;
extern const char* BOLD_GOLD_END;
extern const char* BOLD_WHITE_BEGIN;
extern const char* BOLD_WHITE_END;
-
} //namespace Html
-
} //namespace Colors
-
} //namespace DPL
#endif /* DPL_COLORS_H */
diff --git a/modules/core/include/dpl/copy.h b/modules/core/include/dpl/copy.h
index d91fbbc..e796a61 100644
--- a/modules/core/include/dpl/copy.h
+++ b/modules/core/include/dpl/copy.h
@@ -26,8 +26,7 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
/**
* Copy failed exception
*/
@@ -38,18 +37,23 @@ DECLARE_EXCEPTION_TYPE(Exception, CopyFailed)
*
* @param[in] input Abstract waitable input to copy from
* @param[in] output Abstract waitable output to copy to
- * @throw CopyFailed An error occurred while copying. Look into exception trace for details.
+ * @throw CopyFailed An error occurred while copying. Look into exception trace
+ * for details.
*/
void Copy(AbstractWaitableInput *input, AbstractWaitableOutput *output);
/**
- * Copy exactly totalBytes bytes abstract waitable input to abstract waitable output
+ * Copy exactly totalBytes bytes abstract waitable input to abstract waitable
+ * output
*
* @param[in] input Abstract waitable input to copy from
* @param[in] output Abstract waitable output to copy to
- * @throw CopyFailed An error occurred while copying. Look into exception trace for details.
+ * @throw CopyFailed An error occurred while copying. Look into exception trace
+ * for details.
*/
-void Copy(AbstractWaitableInput *input, AbstractWaitableOutput *output, size_t totalBytes);
+void Copy(AbstractWaitableInput *input,
+ AbstractWaitableOutput *output,
+ size_t totalBytes);
} // namespace DPL
#endif // DPL_COPY_H
diff --git a/modules/core/include/dpl/enable_shared_from_this.h b/modules/core/include/dpl/enable_shared_from_this.h
index ed84130..0a0fb3a 100644
--- a/modules/core/include/dpl/enable_shared_from_this.h
+++ b/modules/core/include/dpl/enable_shared_from_this.h
@@ -26,18 +26,16 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
template
class EnableSharedFromThis : private Noncopyable
{
-
-private:
+ private:
// A weak pointer to shared counter
SharedCounter *m_counter;
Class *m_ptr;
-public:
+ public:
DPL::SharedPtr SharedFromThis()
{
Assert(m_counter != NULL && "Pointer is not shared!");
@@ -57,15 +55,13 @@ public:
m_ptr = ptr;
}
- EnableSharedFromThis()
- : m_counter(NULL),
- m_ptr(NULL)
- {
- }
+ EnableSharedFromThis() :
+ m_counter(NULL),
+ m_ptr(NULL)
+ {}
virtual ~EnableSharedFromThis()
- {
- }
+ {}
};
} // namespace DPL
diff --git a/modules/core/include/dpl/errno_string.h b/modules/core/include/dpl/errno_string.h
index d3da348..446dbc9 100644
--- a/modules/core/include/dpl/errno_string.h
+++ b/modules/core/include/dpl/errno_string.h
@@ -26,8 +26,7 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
DECLARE_EXCEPTION_TYPE(DPL::Exception, InvalidErrnoValue)
std::string GetErrnoString(int error = errno);
diff --git a/modules/core/include/dpl/exception.h b/modules/core/include/dpl/exception.h
index a2e3dcf..cdbdc53 100644
--- a/modules/core/include/dpl/exception.h
+++ b/modules/core/include/dpl/exception.h
@@ -29,25 +29,27 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
void LogUnhandledException(const std::string &str);
-void LogUnhandledException(const std::string &str, const char *filename, int line, const char *function);
+void LogUnhandledException(const std::string &str,
+ const char *filename,
+ int line,
+ const char *function);
}
-namespace DPL
-{
+namespace DPL {
class Exception
{
-private:
+ private:
static unsigned int m_exceptionCount;
static Exception* m_lastException;
static void (*m_terminateHandler)();
static void AddRef(Exception* exception)
{
- if (!m_exceptionCount)
- m_terminateHandler = std::set_terminate(&TerminateHandler);
+ if (!m_exceptionCount) {
+ m_terminateHandler = std::set_terminate(&TerminateHandler);
+ }
++m_exceptionCount;
m_lastException = exception;
@@ -55,13 +57,13 @@ private:
static void UnRef(Exception* e)
{
- if (m_lastException == e)
+ if (m_lastException == e) {
m_lastException = NULL;
+ }
--m_exceptionCount;
- if (!m_exceptionCount)
- {
+ if (!m_exceptionCount) {
std::set_terminate(m_terminateHandler);
m_terminateHandler = NULL;
}
@@ -69,13 +71,10 @@ private:
static void TerminateHandler()
{
- if (m_lastException != NULL)
- {
+ if (m_lastException != NULL) {
DisplayKnownException(*m_lastException);
abort();
- }
- else
- {
+ } else {
DisplayUnknownException();
abort();
}
@@ -86,15 +85,16 @@ private:
std::string m_function;
int m_line;
-protected:
+ protected:
std::string m_message;
std::string m_className;
-public:
+ public:
static std::string KnownExceptionToString(const Exception &e)
{
std::ostringstream message;
- message << "\033[1;5;31m\n=== Unhandled DPL exception occurred ===\033[m\n\n";
+ message <<
+ "\033[1;5;31m\n=== Unhandled DPL exception occurred ===\033[m\n\n";
message << "\033[1;33mException trace:\033[m\n\n";
message << e.DumpToString();
message << "\033[1;31m\n=== Will now abort ===\033[m\n";
@@ -105,8 +105,9 @@ public:
static std::string UnknownExceptionToString()
{
std::ostringstream message;
- message << "\033[1;5;31m\n=== Unhandled non-DPL exception occurred ===\033[m\n\n";
- message << "\033[1;31m\n=== Will now abort ===\033[m\n";
+ message <<
+ "\033[1;5;31m\n=== Unhandled non-DPL exception occurred ===\033[m\n\n";
+ message << "\033[1;31m\n=== Will now abort ===\033[m\n";
return message.str();
}
@@ -124,10 +125,11 @@ public:
Exception(const Exception &other)
{
// Deep copy
- if (other.m_reason != NULL)
+ if (other.m_reason != NULL) {
m_reason = new Exception(*other.m_reason);
- else
+ } else {
m_reason = NULL;
+ }
m_message = other.m_message;
m_path = other.m_path;
@@ -141,14 +143,16 @@ public:
const Exception &operator =(const Exception &other)
{
- if (this == &other)
+ if (this == &other) {
return *this;
+ }
// Deep copy
- if (other.m_reason != NULL)
+ if (other.m_reason != NULL) {
m_reason = new Exception(*other.m_reason);
- else
+ } else {
m_reason = NULL;
+ }
m_message = other.m_message;
m_path = other.m_path;
@@ -162,30 +166,36 @@ public:
return *this;
}
- Exception(const char *path, const char *function, int line, const std::string &message)
- : m_reason(NULL),
- m_path(path),
- m_function(function),
- m_line(line),
- m_message(message)
+ Exception(const char *path,
+ const char *function,
+ int line,
+ const std::string &message) :
+ m_reason(NULL),
+ m_path(path),
+ m_function(function),
+ m_line(line),
+ m_message(message)
{
AddRef(this);
}
- Exception(const char *path, const char *function, int line, const Exception &reason, const std::string &message)
- : m_reason(new Exception(reason)),
- m_path(path),
- m_function(function),
- m_line(line),
- m_message(message)
+ Exception(const char *path,
+ const char *function,
+ int line,
+ const Exception &reason,
+ const std::string &message) :
+ m_reason(new Exception(reason)),
+ m_path(path),
+ m_function(function),
+ m_line(line),
+ m_message(message)
{
AddRef(this);
}
virtual ~Exception() throw()
{
- if (m_reason != NULL)
- {
+ if (m_reason != NULL) {
delete m_reason;
m_reason = NULL;
}
@@ -196,16 +206,18 @@ public:
void Dump() const
{
// Show reason first
- if (m_reason != NULL)
+ if (m_reason != NULL) {
m_reason->Dump();
+ }
// Afterward, dump exception
const char *file = strchr(m_path.c_str(), '/');
- if (file == NULL)
+ if (file == NULL) {
file = m_path.c_str();
- else
+ } else {
++file;
+ }
printf("\033[0;36m[%s:%i]\033[m %s() \033[4;35m%s\033[m: %s\033[m\n",
file, m_line,
@@ -217,24 +229,29 @@ public:
std::string DumpToString() const
{
std::string ret;
- if (m_reason != NULL)
+ if (m_reason != NULL) {
ret = m_reason->DumpToString();
+ }
const char *file = strchr(m_path.c_str(), '/');
- if (file == NULL)
+ if (file == NULL) {
file = m_path.c_str();
- else
+ } else {
++file;
+ }
char buf[1024];
- snprintf(buf, sizeof(buf), "\033[0;36m[%s:%i]\033[m %s() \033[4;35m%s\033[m: %s\033[m\n",
- file, m_line,
- m_function.c_str(),
- m_className.c_str(),
- m_message.empty() ? "" : m_message.c_str());
-
- buf[sizeof(buf)-1] = '\n';
+ snprintf(buf,
+ sizeof(buf),
+ "\033[0;36m[%s:%i]\033[m %s() \033[4;35m%s\033[m: %s\033[m\n",
+ file,
+ m_line,
+ m_function.c_str(),
+ m_className.c_str(),
+ m_message.empty() ? "" : m_message.c_str());
+
+ buf[sizeof(buf) - 1] = '\n';
ret += buf;
return ret;
@@ -283,30 +300,41 @@ public:
std::ostringstream dplLoggingStream; \
dplLoggingStream << Message; \
throw ClassName(__FILE__, __FUNCTION__, __LINE__, dplLoggingStream.str()); \
- }while(0)
+ } while (0)
#define ReThrow(ClassName) \
throw ClassName(__FILE__, __FUNCTION__, __LINE__, _rethrown_exception)
#define ReThrowMsg(ClassName, Message) \
- throw ClassName(__FILE__, __FUNCTION__, __LINE__, _rethrown_exception, Message)
+ throw ClassName(__FILE__, \
+ __FUNCTION__, \
+ __LINE__, \
+ _rethrown_exception, \
+ Message)
#define Catch(ClassName) \
catch (const ClassName &_rethrown_exception)
#define DECLARE_EXCEPTION_TYPE(BaseClass, Class) \
- class Class \
- : public BaseClass \
+ class Class : \
+ public BaseClass \
{ \
- public: \
- Class(const char *path, const char *function, int line, const std::string &message = std::string()) \
- : BaseClass(path, function, line, message) \
+ public: \
+ Class(const char *path, \
+ const char *function, \
+ int line, \
+ const std::string & message = std::string()) : \
+ BaseClass(path, function, line, message) \
{ \
BaseClass::m_className = #Class; \
} \
\
- Class(const char *path, const char *function, int line, const DPL::Exception &reason, const std::string &message = std::string()) \
- : BaseClass(path, function, line, reason, message) \
+ Class(const char *path, \
+ const char *function, \
+ int line, \
+ const DPL::Exception & reason, \
+ const std::string & message = std::string()) : \
+ BaseClass(path, function, line, reason, message) \
{ \
BaseClass::m_className = #Class; \
} \
@@ -339,10 +367,8 @@ public:
abort(); \
}
-namespace DPL
-{
-namespace CommonException
-{
+namespace DPL {
+namespace CommonException {
/**
* Internal exception definitions
*
@@ -350,7 +376,9 @@ namespace CommonException
* Usually, exception trace with internal error includes
* important messages.
*/
-DECLARE_EXCEPTION_TYPE(Exception, InternalError) ///< Unexpected error from underlying libraries or kernel
+DECLARE_EXCEPTION_TYPE(Exception, InternalError) ///< Unexpected error from
+ // underlying libraries or
+ // kernel
}
}
diff --git a/modules/core/include/dpl/fast_delegate.h b/modules/core/include/dpl/fast_delegate.h
index 501c801..8bc1a4b 100644
--- a/modules/core/include/dpl/fast_delegate.h
+++ b/modules/core/include/dpl/fast_delegate.h
@@ -30,8 +30,7 @@
#include
#include
-namespace DPL
-{
+namespace DPL {
using namespace fastdelegate;
} // namespace DPL
diff --git a/modules/core/include/dpl/file_input.h b/modules/core/include/dpl/file_input.h
index d1e4641..3adcf21 100644
--- a/modules/core/include/dpl/file_input.h
+++ b/modules/core/include/dpl/file_input.h
@@ -26,25 +26,24 @@
#include
#include
-namespace DPL
+namespace DPL {
+class FileInput :
+ private Noncopyable,
+ public AbstractWaitableInput
{
-class FileInput
- : private Noncopyable,
- public AbstractWaitableInput
-{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, OpenFailed)
DECLARE_EXCEPTION_TYPE(Base, CloseFailed)
};
-protected:
+ protected:
int m_fd;
-public:
+ public:
FileInput();
FileInput(const std::string &fileName);
virtual ~FileInput();
diff --git a/modules/core/include/dpl/file_output.h b/modules/core/include/dpl/file_output.h
index 48532dc..90be8cd 100644
--- a/modules/core/include/dpl/file_output.h
+++ b/modules/core/include/dpl/file_output.h
@@ -26,25 +26,24 @@
#include
#include
-namespace DPL
+namespace DPL {
+class FileOutput :
+ private Noncopyable,
+ public AbstractWaitableOutput
{
-class FileOutput
- : private Noncopyable,
- public AbstractWaitableOutput
-{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, OpenFailed)
DECLARE_EXCEPTION_TYPE(Base, CloseFailed)
};
-protected:
+ protected:
int m_fd;
-public:
+ public:
FileOutput();
FileOutput(const std::string &fileName);
virtual ~FileOutput();
diff --git a/modules/core/include/dpl/foreach.h b/modules/core/include/dpl/foreach.h
index 0923609..bbe477a 100644
--- a/modules/core/include/dpl/foreach.h
+++ b/modules/core/include/dpl/foreach.h
@@ -18,18 +18,16 @@
* @author Bartosz Janiak (b.janiak@samsung.com)
* @author Lukasz Wrzosek (l.wrzosek@samsung.com)
* @version 1.0
- * @brief This file is the implementation file of foreach macro for stl containers
+ * @brief This file is the implementation file of foreach macro for stl
+ * containers
*/
#ifndef DPL_FOREACH_H
#define DPL_FOREACH_H
#include
-namespace DPL
-{
-namespace Private
-{
-
+namespace DPL {
+namespace Private {
/*
* Used to detect type of valid reference to value object.
*/
@@ -44,23 +42,20 @@ const T& ValueReference(const T& t)
{
return(t);
}
-
-
} //Private
} //DPL
-
#define DPL_FOREACH_IMPL(temporaryName, iterator, container) \
__typeof__ (DPL::Private::ValueReference((container))) & \
temporaryName = (container); \
- for (__typeof__ (temporaryName.begin()) iterator = \
+ for (__typeof__ (temporaryName.begin())iterator = \
temporaryName.begin(); \
(iterator) != temporaryName.end(); ++iterator)
#define FOREACH(iterator, container) \
DPL_FOREACH_IMPL( \
DPL_MACRO_CONCAT(foreachContainerReference, __COUNTER__), \
- iterator, \
- container)
+ iterator, \
+ container)
#endif // DPL_FOREACH_H
diff --git a/modules/core/include/dpl/generic_event.h b/modules/core/include/dpl/generic_event.h
index 371717a..b20d913 100644
--- a/modules/core/include/dpl/generic_event.h
+++ b/modules/core/include/dpl/generic_event.h
@@ -22,40 +22,35 @@
#ifndef DPL_GENERIC_EVENT_H
#define DPL_GENERIC_EVENT_H
-namespace DPL
-{
-
+namespace DPL {
class EventSender
{
-public:
- explicit EventSender(void *sender)
- : m_sender(sender)
- {
- }
+ public:
+ explicit EventSender(void *sender) :
+ m_sender(sender)
+ {}
void* GetSender() const
{
return m_sender;
}
-private:
+ private:
void *m_sender;
};
class GenericEvent
{
-protected:
+ protected:
void *m_sender;
-public:
- explicit GenericEvent(const EventSender &sender)
- : m_sender(sender.GetSender())
- {
- }
+ public:
+ explicit GenericEvent(const EventSender &sender) :
+ m_sender(sender.GetSender())
+ {}
virtual ~GenericEvent()
- {
- }
+ {}
void *GetSender() const
{
@@ -63,46 +58,40 @@ public:
}
};
-class GenericEvent0
- : public GenericEvent
+class GenericEvent0 :
+ public GenericEvent
{
-public:
- explicit GenericEvent0(const EventSender &sender)
- : GenericEvent(sender)
- {
- }
+ public:
+ explicit GenericEvent0(const EventSender &sender) :
+ GenericEvent(sender)
+ {}
virtual ~GenericEvent0()
- {
- }
-
+ {}
};
template
-class GenericEvent1
- : public GenericEvent0
+class GenericEvent1 :
+ public GenericEvent0
{
-public:
+ public:
typedef Arg0Type Arg0;
-protected:
+ protected:
Arg0 m_arg0;
-public:
- explicit GenericEvent1(const EventSender &sender)
- : GenericEvent0(sender)
- {
- }
+ public:
+ explicit GenericEvent1(const EventSender &sender) :
+ GenericEvent0(sender)
+ {}
- GenericEvent1(Arg0 arg0, const EventSender &sender)
- : GenericEvent0(sender),
- m_arg0(arg0)
- {
- }
+ GenericEvent1(Arg0 arg0, const EventSender &sender) :
+ GenericEvent0(sender),
+ m_arg0(arg0)
+ {}
virtual ~GenericEvent1()
- {
- }
+ {}
Arg0 GetArg0() const
{
@@ -111,31 +100,28 @@ public:
};
template
-class GenericEvent2
- : public GenericEvent1
+class GenericEvent2 :
+ public GenericEvent1
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
-protected:
+ protected:
Arg1 m_arg1;
-public:
- explicit GenericEvent2(const EventSender &sender)
- : GenericEvent1(sender)
- {
- }
+ public:
+ explicit GenericEvent2(const EventSender &sender) :
+ GenericEvent1(sender)
+ {}
- GenericEvent2(Arg0 arg0, Arg1 arg1, const EventSender &sender)
- : GenericEvent1(arg0, sender),
- m_arg1(arg1)
- {
- }
+ GenericEvent2(Arg0 arg0, Arg1 arg1, const EventSender &sender) :
+ GenericEvent1(arg0, sender),
+ m_arg1(arg1)
+ {}
virtual ~GenericEvent2()
- {
- }
+ {}
Arg1 GetArg1() const
{
@@ -144,32 +130,29 @@ public:
};
template
-class GenericEvent3
- : public GenericEvent2
+class GenericEvent3 :
+ public GenericEvent2
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
typedef Arg2Type Arg2;
-protected:
+ protected:
Arg2 m_arg2;
-public:
- explicit GenericEvent3(const EventSender &sender)
- : GenericEvent2(sender)
- {
- }
+ public:
+ explicit GenericEvent3(const EventSender &sender) :
+ GenericEvent2(sender)
+ {}
- GenericEvent3(Arg0 arg0, Arg1 arg1, Arg2 arg2, const EventSender &sender)
- : GenericEvent2(arg0, arg1, sender),
- m_arg2(arg2)
- {
- }
+ GenericEvent3(Arg0 arg0, Arg1 arg1, Arg2 arg2, const EventSender &sender) :
+ GenericEvent2(arg0, arg1, sender),
+ m_arg2(arg2)
+ {}
virtual ~GenericEvent3()
- {
- }
+ {}
Arg2 GetArg2() const
{
@@ -177,34 +160,36 @@ public:
}
};
-template
-class GenericEvent4
- : public GenericEvent3
+template
+class GenericEvent4 :
+ public GenericEvent3
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
typedef Arg2Type Arg2;
typedef Arg3Type Arg3;
-protected:
+ protected:
Arg3 m_arg3;
-public:
- explicit GenericEvent4(const EventSender &sender)
- : GenericEvent3(sender)
- {
- }
+ public:
+ explicit GenericEvent4(const EventSender &sender) :
+ GenericEvent3(sender)
+ {}
- GenericEvent4(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3, const EventSender &sender)
- : GenericEvent3(arg0, arg1, arg2, sender),
- m_arg3(arg3)
- {
- }
+ GenericEvent4(Arg0 arg0,
+ Arg1 arg1,
+ Arg2 arg2,
+ Arg3 arg3,
+ const EventSender &sender) :
+ GenericEvent3(arg0, arg1, arg2, sender),
+ m_arg3(arg3)
+ {}
virtual ~GenericEvent4()
- {
- }
+ {}
Arg3 GetArg3() const
{
@@ -212,35 +197,39 @@ public:
}
};
-template
-class GenericEvent5
- : public GenericEvent4
+template
+class GenericEvent5 :
+ public GenericEvent4
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
typedef Arg2Type Arg2;
typedef Arg3Type Arg3;
typedef Arg4Type Arg4;
-protected:
+ protected:
Arg4 m_arg4;
-public:
- explicit GenericEvent5(const EventSender &sender)
- : GenericEvent4(sender)
- {
- }
-
- GenericEvent5(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, const EventSender &sender)
- : GenericEvent4(arg0, arg1, arg2, arg3, sender),
- m_arg4(arg4)
- {
- }
+ public:
+ explicit GenericEvent5(const EventSender &sender) :
+ GenericEvent4(sender)
+ {}
+
+ GenericEvent5(Arg0 arg0,
+ Arg1 arg1,
+ Arg2 arg2,
+ Arg3 arg3,
+ Arg4 arg4,
+ const EventSender &sender) :
+ GenericEvent4(arg0, arg1, arg2,
+ arg3, sender),
+ m_arg4(arg4)
+ {}
virtual ~GenericEvent5()
- {
- }
+ {}
Arg4 GetArg4() const
{
@@ -248,11 +237,12 @@ public:
}
};
-template
-class GenericEvent6
- : public GenericEvent5
+template
+class GenericEvent6 :
+ public GenericEvent5
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
typedef Arg2Type Arg2;
@@ -260,24 +250,32 @@ public:
typedef Arg4Type Arg4;
typedef Arg5Type Arg5;
-protected:
+ protected:
Arg5 m_arg5;
-public:
- explicit GenericEvent6(const EventSender &sender)
- : GenericEvent5(sender)
- {
- }
-
- GenericEvent6(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, const EventSender &sender)
- : GenericEvent5(arg0, arg1, arg2, arg3, arg4, sender),
- m_arg5(arg5)
- {
- }
+ public:
+ explicit GenericEvent6(const EventSender &sender) :
+ GenericEvent5(sender)
+ {}
+
+ GenericEvent6(Arg0 arg0,
+ Arg1 arg1,
+ Arg2 arg2,
+ Arg3 arg3,
+ Arg4 arg4,
+ Arg5 arg5,
+ const EventSender &sender) :
+ GenericEvent5(arg0,
+ arg1,
+ arg2,
+ arg3,
+ arg4,
+ sender),
+ m_arg5(arg5)
+ {}
virtual ~GenericEvent6()
- {
- }
+ {}
Arg5 GetArg5() const
{
@@ -285,11 +283,14 @@ public:
}
};
-template
-class GenericEvent7
- : public GenericEvent6
+template
+class GenericEvent7 :
+ public GenericEvent6
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
typedef Arg2Type Arg2;
@@ -298,24 +299,30 @@ public:
typedef Arg5Type Arg5;
typedef Arg6Type Arg6;
-protected:
+ protected:
Arg6 m_arg6;
-public:
- explicit GenericEvent7(const EventSender &sender)
- : GenericEvent6(sender)
- {
- }
-
- GenericEvent7(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6, const EventSender &sender)
- : GenericEvent6(arg0, arg1, arg2, arg3, arg4, arg5, sender),
- m_arg6(arg6)
- {
- }
+ public:
+ explicit GenericEvent7(const EventSender &sender) :
+ GenericEvent6(sender)
+ {}
+
+ GenericEvent7(Arg0 arg0,
+ Arg1 arg1,
+ Arg2 arg2,
+ Arg3 arg3,
+ Arg4 arg4,
+ Arg5 arg5,
+ Arg6 arg6,
+ const EventSender &sender) :
+ GenericEvent6(arg0, arg1, arg2, arg3, arg4, arg5, sender),
+ m_arg6(arg6)
+ {}
virtual ~GenericEvent7()
- {
- }
+ {}
Arg6 GetArg6() const
{
@@ -323,11 +330,15 @@ public:
}
};
-template
-class GenericEvent8
- : public GenericEvent7
+template
+class GenericEvent8 :
+ public GenericEvent7
{
-public:
+ public:
typedef Arg0Type Arg0;
typedef Arg1Type Arg1;
typedef Arg2Type Arg2;
@@ -337,176 +348,290 @@ public:
typedef Arg6Type Arg6;
typedef Arg7Type Arg7;
-protected:
+ protected:
Arg7 m_arg7;
-public:
- explicit GenericEvent8(const EventSender &sender)
- : GenericEvent7(sender)
- {
- }
-
- GenericEvent8(Arg0 arg0, Arg1 arg1, Arg2 arg2, Arg3 arg3, Arg4 arg4, Arg5 arg5, Arg6 arg6, Arg7 arg7, const EventSender &sender)
- : GenericEvent7(arg0, arg1, arg2, arg3, arg4, arg5, arg6, sender),
- m_arg7(arg7)
- {
- }
+ public:
+ explicit GenericEvent8(const EventSender &sender) :
+ GenericEvent7(sender)
+ {}
+
+ GenericEvent8(Arg0 arg0,
+ Arg1 arg1,
+ Arg2 arg2,
+ Arg3 arg3,
+ Arg4 arg4,
+ Arg5 arg5,
+ Arg6 arg6,
+ Arg7 arg7,
+ const EventSender &sender) :
+ GenericEvent7(arg0, arg1, arg2, arg3, arg4, arg5,
+ arg6, sender),
+ m_arg7(arg7)
+ {}
virtual ~GenericEvent8()
- {
- }
+ {}
Arg7 GetArg7() const
{
return m_arg7;
}
};
-
} // namespace DPL
#define DECLARE_GENERIC_EVENT_0(ClassName) \
- class ClassName \
- : public DPL::GenericEvent0 \
+ class ClassName : \
+ public DPL::GenericEvent0 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent0(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent0(sender) \
{ \
} \
};
#define DECLARE_GENERIC_EVENT_1(ClassName, Arg0Type) \
- class ClassName \
- : public DPL::GenericEvent1 \
+ class ClassName : \
+ public DPL::GenericEvent1 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent1(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent1(sender) \
{ \
} \
\
explicit ClassName(Arg0Type arg0, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent1(arg0, sender) \
+ const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent1(arg0, sender) \
{ \
} \
};
#define DECLARE_GENERIC_EVENT_2(ClassName, Arg0Type, Arg1Type) \
- class ClassName \
- : public DPL::GenericEvent2 \
+ class ClassName : \
+ public DPL::GenericEvent2 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent2(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent2(sender) \
{ \
} \
\
ClassName(Arg0Type arg0, Arg1Type arg1, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent2(arg0, arg1, sender) \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent2(arg0, arg1, sender) \
{ \
} \
};
#define DECLARE_GENERIC_EVENT_3(ClassName, Arg0Type, Arg1Type, Arg2Type) \
- class ClassName \
- : public DPL::GenericEvent3 \
+ class ClassName : \
+ public DPL::GenericEvent3 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent3(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent3(sender) \
{ \
} \
\
ClassName(Arg0Type arg0, Arg1Type arg1, Arg2Type arg2, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent3(arg0, arg1, arg2, sender) \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent3(arg0, \
+ arg1, \
+ arg2, \
+ sender) \
{ \
} \
};
-#define DECLARE_GENERIC_EVENT_4(ClassName, Arg0Type, Arg1Type, Arg2Type, Arg3Type) \
- class ClassName \
- : public DPL::GenericEvent4 \
+#define DECLARE_GENERIC_EVENT_4(ClassName, \
+ Arg0Type, \
+ Arg1Type, \
+ Arg2Type, \
+ Arg3Type) \
+ class ClassName : \
+ public DPL::GenericEvent4 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent4(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent4(sender) \
{ \
} \
\
ClassName(Arg0Type arg0, Arg1Type arg1, Arg2Type arg2, Arg3Type arg3, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent4(arg0, arg1, arg2, arg3, sender) \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent4(arg0, \
+ arg1, \
+ arg2, \
+ arg3, \
+ sender) \
{ \
} \
};
-#define DECLARE_GENERIC_EVENT_5(ClassName, Arg0Type, Arg1Type, Arg2Type, Arg3Type, Arg4Type) \
- class ClassName \
- : public DPL::GenericEvent5 \
+#define DECLARE_GENERIC_EVENT_5(ClassName, \
+ Arg0Type, \
+ Arg1Type, \
+ Arg2Type, \
+ Arg3Type, \
+ Arg4Type) \
+ class ClassName : \
+ public DPL::GenericEvent5 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent5(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent5( \
+ sender) \
{ \
} \
\
- ClassName(Arg0Type arg0, Arg1Type arg1, Arg2Type arg2, Arg3Type arg3, Arg4Type arg4, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent5(arg0, arg1, arg2, arg3, arg4, sender) \
+ ClassName(Arg0Type arg0, \
+ Arg1Type arg1, \
+ Arg2Type arg2, \
+ Arg3Type arg3, \
+ Arg4Type arg4, \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent5( \
+ arg0, \
+ arg1, \
+ arg2, \
+ arg3, \
+ arg4, \
+ sender) \
{ \
} \
};
-#define DECLARE_GENERIC_EVENT_6(ClassName, Arg0Type, Arg1Type, Arg2Type, Arg3Type, Arg4Type, Arg5Type) \
- class ClassName \
- : public DPL::GenericEvent6 \
+#define DECLARE_GENERIC_EVENT_6(ClassName, \
+ Arg0Type, \
+ Arg1Type, \
+ Arg2Type, \
+ Arg3Type, \
+ Arg4Type, \
+ Arg5Type) \
+ class ClassName : \
+ public DPL::GenericEvent6 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent6(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent6(sender) \
{ \
} \
\
- ClassName(Arg0Type arg0, Arg1Type arg1, Arg2Type arg2, Arg3Type arg3, Arg4Type arg4, Arg5Type arg5, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent6(arg0, arg1, arg2, arg3, arg4, arg5, sender) \
+ ClassName(Arg0Type arg0, \
+ Arg1Type arg1, \
+ Arg2Type arg2, \
+ Arg3Type arg3, \
+ Arg4Type arg4, \
+ Arg5Type arg5, \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent6(arg0, \
+ arg1, \
+ arg2, \
+ arg3, \
+ arg4, \
+ arg5, \
+ sender) \
{ \
} \
};
-#define DECLARE_GENERIC_EVENT_7(ClassName, Arg0Type, Arg1Type, Arg2Type, Arg3Type, Arg4Type, Arg5Type, Arg6Type) \
- class ClassName \
- : public DPL::GenericEvent7 \
+#define DECLARE_GENERIC_EVENT_7(ClassName, \
+ Arg0Type, \
+ Arg1Type, \
+ Arg2Type, \
+ Arg3Type, \
+ Arg4Type, \
+ Arg5Type, \
+ Arg6Type) \
+ class ClassName : \
+ public DPL::GenericEvent7 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent7(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent7(sender) \
{ \
} \
\
- ClassName(Arg0Type arg0, Arg1Type arg1, Arg2Type arg2, Arg3Type arg3, Arg4Type arg4, Arg5Type arg5, Arg6Type arg6, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent7(arg0, arg1, arg2, arg3, arg4, arg5, arg6, sender) \
+ ClassName(Arg0Type arg0, \
+ Arg1Type arg1, \
+ Arg2Type arg2, \
+ Arg3Type arg3, \
+ Arg4Type arg4, \
+ Arg5Type arg5, \
+ Arg6Type arg6, \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent7(arg0, \
+ arg1, \
+ arg2, \
+ arg3, \
+ arg4, \
+ arg5, \
+ arg6, \
+ sender) \
{ \
} \
};
-#define DECLARE_GENERIC_EVENT_8(ClassName, Arg0Type, Arg1Type, Arg2Type, Arg3Type, Arg4Type, Arg5Type, Arg6Type, Arg7Type) \
- class ClassName \
- : public DPL::GenericEvent8 \
+#define DECLARE_GENERIC_EVENT_8(ClassName, \
+ Arg0Type, \
+ Arg1Type, \
+ Arg2Type, \
+ Arg3Type, \
+ Arg4Type, \
+ Arg5Type, \
+ Arg6Type, \
+ Arg7Type) \
+ class ClassName : \
+ public DPL::GenericEvent8 \
{ \
- public: \
- explicit ClassName(const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent8(sender) \
+ public: \
+ explicit ClassName(const DPL::EventSender & sender = \
+ DPL::EventSender(NULL)) : \
+ DPL::GenericEvent8(sender) \
{ \
} \
\
- ClassName(Arg0Type arg0, Arg1Type arg1, Arg2Type arg2, Arg3Type arg3, Arg4Type arg4, Arg5Type arg5, Arg6Type arg6, Arg7Type arg7, \
- const DPL::EventSender &sender = DPL::EventSender(NULL)) \
- : DPL::GenericEvent8(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, sender) \
+ ClassName(Arg0Type arg0, \
+ Arg1Type arg1, \
+ Arg2Type arg2, \
+ Arg3Type arg3, \
+ Arg4Type arg4, \
+ Arg5Type arg5, \
+ Arg6Type arg6, \
+ Arg7Type arg7, \
+ const DPL::EventSender & sender = DPL::EventSender(NULL)) : \
+ DPL::GenericEvent8(arg0, \
+ arg1, \
+ arg2, \
+ arg3, \
+ arg4, \
+ arg5, \
+ arg6, \
+ arg7, \
+ sender) \
{ \
} \
};
diff --git a/modules/core/include/dpl/lexical_cast.h b/modules/core/include/dpl/lexical_cast.h
index 57eb5e0..1b54026 100644
--- a/modules/core/include/dpl/lexical_cast.h
+++ b/modules/core/include/dpl/lexical_cast.h
@@ -24,8 +24,7 @@
#include
-namespace DPL
-{
+namespace DPL {
template
TargetType lexical_cast(const SourceType &data)
{
diff --git a/modules/core/include/dpl/main.h b/modules/core/include/dpl/main.h
index 62bd7e0..cb088cf 100644
--- a/modules/core/include/dpl/main.h
+++ b/modules/core/include/dpl/main.h
@@ -29,25 +29,27 @@
#include
#include
-namespace DPL
+namespace DPL {
+class Main :
+ public WaitableHandleWatchSupport
{
-class Main
- : public WaitableHandleWatchSupport
-{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, CreateFailed)
};
-protected:
+ protected:
Ecore_Fd_Handler *m_invokerHandler;
- static Eina_Bool StaticDispatchInvoker(void *data, Ecore_Fd_Handler *fd_handler);
- static Eina_Bool StaticDispatchReadWatcher(void *data, Ecore_Fd_Handler *fd_handler);
- static Eina_Bool StaticDispatchWriteWatcher(void *data, Ecore_Fd_Handler *fd_handler);
+ static Eina_Bool StaticDispatchInvoker(void *data,
+ Ecore_Fd_Handler *fd_handler);
+ static Eina_Bool StaticDispatchReadWatcher(void *data,
+ Ecore_Fd_Handler *fd_handler);
+ static Eina_Bool StaticDispatchWriteWatcher(void *data,
+ Ecore_Fd_Handler *fd_handler);
typedef std::list EcoreFdHandlerList;
@@ -66,13 +68,18 @@ protected:
#ifdef DPL_ENABLE_GLIB_LOOP_INTEGRATION_WORKAROUND
// GLIB loop intergration workaround
- typedef int (*EcoreSelectType)(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
+ typedef int (*EcoreSelectType)(int nfds, fd_set *readfds, fd_set *writefds,
+ fd_set *exceptfds, struct timeval *timeout);
EcoreSelectType m_oldEcoreSelect;
- static int EcoreSelectInterceptor(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
+ static int EcoreSelectInterceptor(int nfds,
+ fd_set *readfds,
+ fd_set *writefds,
+ fd_set *exceptfds,
+ struct timeval *timeout);
#endif // DPL_ENABLE_GLIB_LOOP_INTEGRATION_WORKAROUND
-public:
+ public:
explicit Main();
virtual ~Main();
};
diff --git a/modules/core/include/dpl/mutex.h b/modules/core/include/dpl/mutex.h
index fbc0c5b..315a92c 100644
--- a/modules/core/include/dpl/mutex.h
+++ b/modules/core/include/dpl/mutex.h
@@ -26,43 +26,41 @@
#include
#include
-namespace DPL
+namespace DPL {
+class Mutex :
+ private Noncopyable
{
-class Mutex
- : private Noncopyable
-{
-public:
- class ScopedLock
- : private Noncopyable
+ public:
+ class ScopedLock :
+ private Noncopyable
{
- private:
+ private:
Mutex *m_mutex;
- public:
+ public:
explicit ScopedLock(Mutex *mutex);
~ScopedLock();
};
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, CreateFailed)
DECLARE_EXCEPTION_TYPE(Base, LockFailed)
DECLARE_EXCEPTION_TYPE(Base, UnlockFailed)
};
-private:
+ private:
mutable pthread_mutex_t m_mutex;
void Lock() const;
void Unlock() const;
-public:
+ public:
Mutex();
~Mutex();
};
-
} // namespace DPL
#endif // DPL_MUTEX_H
diff --git a/modules/core/include/dpl/named_base_pipe.h b/modules/core/include/dpl/named_base_pipe.h
index ab7630b..45714ef 100644
--- a/modules/core/include/dpl/named_base_pipe.h
+++ b/modules/core/include/dpl/named_base_pipe.h
@@ -24,21 +24,20 @@
#include
-namespace DPL
-{
+namespace DPL {
class NamedBasePipe
{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, AlreadyExist)
DECLARE_EXCEPTION_TYPE(Base, CreateFailed)
DECLARE_EXCEPTION_TYPE(Base, DestroyFailed)
};
-public:
+ public:
virtual ~NamedBasePipe();
static void Create(const std::string &fileName);
diff --git a/modules/core/include/dpl/named_input_pipe.h b/modules/core/include/dpl/named_input_pipe.h
index 7f10c5d..cf7b4b7 100644
--- a/modules/core/include/dpl/named_input_pipe.h
+++ b/modules/core/include/dpl/named_input_pipe.h
@@ -26,11 +26,10 @@
#include
#include
-namespace DPL
-{
-class NamedInputPipe
- : public NamedBasePipe,
- public FileInput
+namespace DPL {
+class NamedInputPipe :
+ public NamedBasePipe,
+ public FileInput
{};
} // namespace DPL
diff --git a/modules/core/include/dpl/named_output_pipe.h b/modules/core/include/dpl/named_output_pipe.h
index 9855a81..573d1d2 100644
--- a/modules/core/include/dpl/named_output_pipe.h
+++ b/modules/core/include/dpl/named_output_pipe.h
@@ -27,26 +27,25 @@
#include
#include
-namespace DPL
+namespace DPL {
+class NamedOutputPipe :
+ private Noncopyable,
+ public NamedBasePipe,
+ public AbstractWaitableOutput
{
-class NamedOutputPipe
- : private Noncopyable,
- public NamedBasePipe,
- public AbstractWaitableOutput
-{
-public:
+ public:
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, OpenFailed)
DECLARE_EXCEPTION_TYPE(Base, CloseFailed)
};
-protected:
+ protected:
int m_fifo;
-public:
+ public:
NamedOutputPipe();
virtual ~NamedOutputPipe();
diff --git a/modules/core/include/dpl/noncopyable.h b/modules/core/include/dpl/noncopyable.h
index 2cc95d4..98d57dd 100644
--- a/modules/core/include/dpl/noncopyable.h
+++ b/modules/core/include/dpl/noncopyable.h
@@ -22,18 +22,17 @@
#ifndef DPL_NONCOPYABLE_H
#define DPL_NONCOPYABLE_H
-namespace DPL
-{
+namespace DPL {
class Noncopyable
{
-private:
+ private:
Noncopyable(const Noncopyable &);
const Noncopyable &operator=(const Noncopyable &);
-public:
+
+ public:
Noncopyable();
virtual ~Noncopyable();
};
-
} // namespace DPL
#endif // DPL_NONCOPYABLE_H
diff --git a/modules/core/include/dpl/once.h b/modules/core/include/dpl/once.h
index 2b9039e..610f366 100644
--- a/modules/core/include/dpl/once.h
+++ b/modules/core/include/dpl/once.h
@@ -27,17 +27,16 @@
#include
#include
-namespace DPL
+namespace DPL {
+class Once :
+ private Noncopyable
{
-class Once
- : private Noncopyable
-{
-public:
+ public:
typedef FastDelegate Delegate;
void Call(Delegate delegate);
-private:
+ private:
Atomic m_atomic;
Mutex m_mutex;
};
diff --git a/modules/core/include/dpl/optional.h b/modules/core/include/dpl/optional.h
index 0a0736c..f1fb9ba 100644
--- a/modules/core/include/dpl/optional.h
+++ b/modules/core/include/dpl/optional.h
@@ -24,31 +24,27 @@
#include
-namespace DPL
-{
-
+namespace DPL {
template
class Optional
{
class Exception
{
- public:
+ public:
DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
DECLARE_EXCEPTION_TYPE(Base, NullReference)
};
-public:
+ public:
Optional() :
m_null(true),
m_value()
- {
- }
+ {}
Optional(const Type& t) :
m_null(false),
m_value(t)
- {
- }
+ {}
bool IsNull() const
{
@@ -57,25 +53,33 @@ public:
Type& operator*()
{
- if (m_null) Throw(typename Exception::NullReference);
+ if (m_null) {
+ Throw(typename Exception::NullReference);
+ }
return m_value;
}
const Type& operator*() const
{
- if (m_null) Throw(typename Exception::NullReference);
+ if (m_null) {
+ Throw(typename Exception::NullReference);
+ }
return m_value;
}
const Type* operator->() const
{
- if (m_null) Throw(typename Exception::NullReference);
+ if (m_null) {
+ Throw(typename Exception::NullReference);
+ }
return &m_value;
}
Type* operator->()
{
- if (m_null) Throw(typename Exception::NullReference);
+ if (m_null) {
+ Throw(typename Exception::NullReference);
+ }
return &m_value;
}
@@ -93,7 +97,8 @@ public:
bool operator==(const Optional& aSecond) const
{
- return LogicalOperator(*this, aSecond, std::equal_to(), std::equal_to());
+ return LogicalOperator(*this, aSecond,
+ std::equal_to(), std::equal_to());
}
bool operator==(const Type& aSecond) const
@@ -108,12 +113,14 @@ public:
bool operator<(const Optional& aSecond) const
{
- return LogicalOperator(*this, aSecond, std::less(), std::less());
+ return LogicalOperator(*this, aSecond,
+ std::less(), std::less());
}
bool operator>(const Optional& aSecond) const
{
- return LogicalOperator(*this, aSecond, std::greater(), std::greater());
+ return LogicalOperator(*this, aSecond,
+ std::greater(), std::greater());
}
bool operator<=(const Optional& aSecond) const
@@ -128,27 +135,23 @@ public:
static Optional Null;
-private:
+ private:
bool m_null;
Type m_value;
template
- static bool LogicalOperator(const Optional& aFirst, const Optional& aSecond,
- taComparator aComparator, taNullComparator aNullComparator)
+ static bool LogicalOperator(const Optional