diff --git a/.clang-format b/.clang-format
index 0d03f70..a2683b8 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,4 +1,3 @@
----
Language: Cpp
# BasedOnStyle: LLVM
# should be in line with IndentWidth
@@ -13,8 +12,8 @@ AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
-AllowShortIfStatementsOnASingleLine: true
-AllowShortLoopsOnASingleLine: true
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
@@ -39,8 +38,8 @@ BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
-ColumnLimit: 120
-CommentPragmas: '^ IWYU pragma:'
+ColumnLimit: 140
+CommentPragmas: '^( IWYU pragma:| @suppress)'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 0
ContinuationIndentWidth: 4
@@ -76,13 +75,13 @@ PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
-PointerAlignment: Right
+PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
-SpaceBeforeParens: ControlStatements
+SpaceBeforeParens: Never
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..0ce60af
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,3 @@
+---
+Checks: 'clang-diagnostic-*,clang-analyzer-*,clang-diagnostic-*,clang-analyzer-*'
+WarningsAsErrors: ''
diff --git a/.cproject b/.cproject
index a71d80d..bf2d74a 100644
--- a/.cproject
+++ b/.cproject
@@ -28,6 +28,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -36,26 +72,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
@@ -69,4 +135,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index 67d8511..a12f4a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,4 @@
/*.fst
/*.gtkw
/.envrc.*
+/.direnv/
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d295322..746423b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,21 +42,21 @@ if(ENABLE_COVERAGE)
set(COVERAGE_EXCLUDES "osci-lib/scc/*" "/engr/dev/tools/*")
endif()
-find_program(CLANG_TIDY_EXE NAMES "clang-tidy-9")
+find_program(CLANG_TIDY_EXE NAMES "clang-tidy")
if(ENABLE_CLANG_TIDY)
-if(CLANG_TIDY_EXE)
- message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
- set(CLANG_TIDY_CHECKS "-*,modernize-*,-modernize-use-trailing-return-type,clang-analyzer-core.*,clang-analyzer-cplusplus.*")
- set(CMAKE_CXX_CLANG_TIDY
- ${CLANG_TIDY_EXE};
- -checks=${CLANG_TIDY_CHECKS};
- -fix;)
-else()
- message(AUTHOR_WARNING "clang-tidy not found!")
- set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it
-endif()
+ if(CLANG_TIDY_EXE)
+ message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
+ #set(CLANG_TIDY_CHECKS "-*,modernize-*,-modernize-use-trailing-return-type,clang-analyzer-core.*,clang-analyzer-cplusplus.*")
+ set(CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_EXE};-fix)
+ else()
+ message(AUTHOR_WARNING "clang-tidy not found!")
+ set(CMAKE_CXX_CLANG_TIDY "" CACHE STRING "" FORCE) # delete it
+ endif()
endif()
+set(CLANG_FORMAT_EXCLUDE_PATTERNS "/third_party/")
+find_package(ClangFormat)
+
set(CONAN_CMAKE_SILENT_OUTPUT ON)
conan_check()
conan_configure(REQUIRES fmt/8.0.1 spdlog/1.9.2 boost/1.75.0 gsl-lite/0.37.0 systemc/2.3.3 catch2/3.1.0 zlib/1.2.11 lz4/1.9.4
diff --git a/scc b/scc
index ffa0f2f..6063f8d 160000
--- a/scc
+++ b/scc
@@ -1 +1 @@
-Subproject commit ffa0f2f7ef98790984fa3786c36b8778c5b52237
+Subproject commit 6063f8da997247d68aec9422e39c93458f18bba0
diff --git a/src/factory.cpp b/src/factory.cpp
index dc35d7d..ca5e446 100644
--- a/src/factory.cpp
+++ b/src/factory.cpp
@@ -7,39 +7,33 @@ auto factory::get_instance() -> factory& {
return instance;
}
-factory::factory() :
- m_constructors{},
- m_objects{}
-{ }
+factory::factory()
+: m_constructors{}
+, m_objects{} {}
void factory::create() {
- for (const auto& item : m_constructors) {
+ for(const auto& item : m_constructors) {
m_objects[item.first] = item.second();
}
}
-void factory::destroy() {
- m_objects.clear();
-}
+void factory::destroy() { m_objects.clear(); }
void factory::add_object(const std::string& name, constructor create) {
auto it = m_constructors.find(name);
- if (it == m_constructors.cend()) {
+ if(it == m_constructors.cend()) {
m_constructors[name] = create;
- }
- else {
- throw std::runtime_error("factory::add(): "
- + name + " object already exist in factory");
+ } else {
+ throw std::runtime_error("factory::add(): " + name + " object already exist in factory");
}
}
auto factory::get_object(const std::string& name) -> void* {
auto it = m_objects.find(name);
- if (it == m_objects.cend()) {
- throw std::runtime_error("factory::get(): "
- + name + " object doesn't exist in factory");
+ if(it == m_objects.cend()) {
+ throw std::runtime_error("factory::get(): " + name + " object doesn't exist in factory");
}
return it->second.get();
diff --git a/src/factory.h b/src/factory.h
index 7184037..2c57fce 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -9,29 +9,28 @@
#ifndef SRC_FACTORY_H_
#define SRC_FACTORY_H_
-#include