Skip to content

Commit

Permalink
Update formatting for all project source files (#766)
Browse files Browse the repository at this point in the history
  • Loading branch information
achristoforides committed Dec 20, 2022
1 parent 4b9298c commit 990a832
Show file tree
Hide file tree
Showing 697 changed files with 75,468 additions and 73,317 deletions.
47 changes: 40 additions & 7 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,9 +1,42 @@
---
BasedOnStyle: Mozilla

# Reflowing comments interfers with .rst identation
ReflowComments: false
AlwaysBreakAfterReturnType: None
AlwaysBreakAfterDefinitionReturnType: None
BasedOnStyle: Microsoft
AlignArrayOfStructures: Right
AlignConsecutiveAssignments:
AcrossEmptyLines: true
AlignCompound: true
AlignConsecutiveBitFields:
AlignCompound: true
AlignConsecutiveDeclarations:
AlignCompound: true
PadOperators: true
AlignConsecutiveMacros:
Enabled: true
AlignEscapedNewlines: Left
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Always
AllowShortFunctionsOnASingleLine: All
AlwaysBreakAfterReturnType: AllDefinitions
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: true
AfterClass: false
AfterUnion: true
SplitEmptyFunction: false
BreakBeforeBinaryOperators: All
BreakBeforeBraces: Allman
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
Cpp11BracedListStyle: false
IndentCaseLabels: true
IndentGotoLabels: false
IndentPPDirectives: AfterHash
...
NamespaceIndentation: All
PackConstructorInitializers: CurrentLine
PointerAlignment: Left
QualifierAlignment: Right
ReferenceAlignment: Left
SpaceAroundPointerQualifiers: Before
SpaceBeforeCpp11BracedList: true
17 changes: 9 additions & 8 deletions cmake/CMakeResourceDependencies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
=============================================================================*/

namespace {

// This is dummy code to silence some linkers warning about
// empty object files.
struct CMakeResourceDependencies
namespace
{
CMakeResourceDependencies() {}
};
}

// This is dummy code to silence some linkers warning about
// empty object files.
struct CMakeResourceDependencies
{
CMakeResourceDependencies() {}
};
} // namespace
9 changes: 5 additions & 4 deletions cmake/try_compile/us_have_regex.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include <regex>
int main()
int
main()
{
auto regex_iter_end = std::sregex_iterator();
(void)regex_iter_end;
return 0;
auto regex_iter_end = std::sregex_iterator();
(void)regex_iter_end;
return 0;
}
5 changes: 3 additions & 2 deletions cmake/try_compile/us_have_thread_local.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

// We use a non-POD type for this test
static thread_local std::string dummy;
int main()
int
main()
{
return 0;
return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,47 @@

#include <future>

namespace cppmicroservices {
namespace async {
namespace cppmicroservices
{
namespace async
{

/**
\defgroup gr_asyncworkservice AsyncWorkService
/**
\defgroup gr_asyncworkservice AsyncWorkService
\brief Groups AsyncWorkService class related symbols
*/
\brief Groups AsyncWorkService class related symbols
*/

/**
* \ingroup MicroService
* \ingroup gr_asyncworkservice
*
* Provides a method which controls how DeclarativeServices internally schedules asynchronous work.
* Creating an AsyncWorkService implementation is not required; this is intended to be used in specialty situations where the client application has requirements that the default asynchronous work scheduling mechanism does not conform to.
*
* @remarks This class is thread safe.
*/
class US_usAsyncWorkService_EXPORT AsyncWorkService
{
public:
virtual ~AsyncWorkService();
/**
* \ingroup MicroService
* \ingroup gr_asyncworkservice
*
* Provides a method which controls how DeclarativeServices internally schedules asynchronous work.
* Creating an AsyncWorkService implementation is not required; this is intended to be used in specialty
* situations where the client application has requirements that the default asynchronous work scheduling
* mechanism does not conform to.
*
* @remarks This class is thread safe.
*/
class US_usAsyncWorkService_EXPORT AsyncWorkService
{
public:
virtual ~AsyncWorkService();

/**
* Run a std::packaged_task<void()> (optionally on another thread asynchronously).
* The std::future<void> associated with the std::packaged_task<void()> task
* object will contain the result from the task object.
*
* @param task A std::packaged_task<void()> wrapping a Callable target to
* execute asynchronously.
*
* @note The caller is required to manage the std::future<void> associated
* with the std::packaged_task<void()> in order to wait on the async task.
*/
virtual void post(std::packaged_task<void()>&& task) = 0;
};
}
}
/**
* Run a std::packaged_task<void()> (optionally on another thread asynchronously).
* The std::future<void> associated with the std::packaged_task<void()> task
* object will contain the result from the task object.
*
* @param task A std::packaged_task<void()> wrapping a Callable target to
* execute asynchronously.
*
* @note The caller is required to manage the std::future<void> associated
* with the std::packaged_task<void()> in order to wait on the async task.
*/
virtual void post(std::packaged_task<void()>&& task) = 0;
};
} // namespace async
} // namespace cppmicroservices

#endif // CPPMICROSERVICES_ASYNC_WORK_SERVICE_H__
12 changes: 7 additions & 5 deletions compendium/AsyncWorkService/src/AsyncWorkService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@

#include "cppmicroservices/asyncworkservice/AsyncWorkService.hpp"

namespace cppmicroservices {
namespace async {
namespace cppmicroservices
{
namespace async
{

AsyncWorkService::~AsyncWorkService() = default;
AsyncWorkService::~AsyncWorkService() = default;

}
}
}
} // namespace cppmicroservices

0 comments on commit 990a832

Please sign in to comment.