Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,18 @@ BasedOnStyle: LLVM
# Disable automatic line-breaks in comments
# as this breaks SPDX headers
ReflowComments: false

# Regroup #include directives to villas - std - other
IncludeBlocks: Regroup
IncludeIsMainRegex: / # disable main header heuristic
IncludeCategories:
- Regex: '^<villas/'
Priority: 3
CaseSensitive: true
- Regex: '^<[[:lower:]_]+>$'
Priority: 1
CaseSensitive: true
- Regex: '^<.*>$'
Priority: 2
- Regex: '^".*"$'
Priority: 4
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#define RTLAB
#include "AsyncApi.h"
#include "OpalPrint.h"

#include "config.h"
#include "socket.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* to the OpalDisplay. Otherwise stdout will be used. */
#define RTLAB
#include "OpalPrint.h"

#include "config.h"
#include "utils.h"

Expand Down
3 changes: 1 addition & 2 deletions common/include/villas/buffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@

#pragma once

#include <vector>

#include <cstdlib>
#include <vector>

#include <jansson.h>

Expand Down
1 change: 1 addition & 0 deletions common/include/villas/cpuset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifdef __linux__

#include <cstdint>

#include <sched.h>

#include <villas/exceptions.hpp>
Expand Down
1 change: 1 addition & 0 deletions common/include/villas/dsp/moving_average_window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <cstddef>

#include <villas/dsp/window.hpp>

namespace villas {
Expand Down
1 change: 0 additions & 1 deletion common/include/villas/dsp/window_cosine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#pragma once

#include <cmath>

#include <vector>

#include <villas/dsp/window.hpp>
Expand Down
1 change: 1 addition & 0 deletions common/include/villas/graph/edge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <fmt/ostream.h>

#include <villas/config.hpp>
#include <villas/graph/vertex.hpp>

Expand Down
4 changes: 3 additions & 1 deletion common/include/villas/graph/vertex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

#pragma once

#include <fmt/ostream.h>
#include <list>
#include <sstream>

#include <fmt/ostream.h>

#include <villas/config.hpp>

namespace villas {
Expand Down
1 change: 1 addition & 0 deletions common/include/villas/kernel/devices/device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <filesystem>
#include <optional>

#include <villas/kernel/devices/driver.hpp>

namespace villas {
Expand Down
2 changes: 2 additions & 0 deletions common/include/villas/kernel/devices/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#pragma once

#include <string>

namespace villas {
namespace kernel {
namespace devices {
Expand Down
2 changes: 2 additions & 0 deletions common/include/villas/kernel/devices/ip_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#pragma once

#include <filesystem>
#include <vector>

#include <villas/kernel/devices/platform_device.hpp>

namespace villas {
Expand Down
1 change: 1 addition & 0 deletions common/include/villas/kernel/devices/linux_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <filesystem>
#include <fstream>
#include <iostream>

#include <villas/kernel/devices/driver.hpp>

namespace villas {
Expand Down
5 changes: 2 additions & 3 deletions common/include/villas/kernel/devices/pci_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

#pragma once

#include <fstream>
#include <list>

#include <cstddef>
#include <cstdint>
#include <fstream>
#include <list>

#include <villas/log.hpp>

Expand Down
1 change: 1 addition & 0 deletions common/include/villas/kernel/devices/platform_device.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#pragma once

#include <filesystem>

#include <villas/kernel/devices/device.hpp>
#include <villas/kernel/devices/driver.hpp>

Expand Down
3 changes: 2 additions & 1 deletion common/include/villas/list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
#pragma once

#include <cstring>
#include <pthread.h>
#include <string>

#include <pthread.h>
#include <sys/types.h>

#include <villas/common.hpp>
Expand Down
3 changes: 1 addition & 2 deletions common/include/villas/log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
#include <list>
#include <string>

#include <jansson.h>
#include <spdlog/sinks/dist_sink.h>
#include <spdlog/sinks/stdout_color_sinks.h>
#include <spdlog/spdlog.h>

#include <jansson.h>

namespace villas {

// Forward declarations
Expand Down
1 change: 1 addition & 0 deletions common/include/villas/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <string>

#include <unistd.h>

#include <villas/log.hpp>
Expand Down
4 changes: 3 additions & 1 deletion common/include/villas/memory_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
#pragma once

#include <cstdint>
#include <fmt/ostream.h>
#include <map>
#include <stdexcept>
#include <string>

#include <fmt/ostream.h>
#include <unistd.h>

#include <villas/config.hpp>
#include <villas/graph/directed.hpp>
#include <villas/log.hpp>
Expand Down
6 changes: 4 additions & 2 deletions common/include/villas/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@

#pragma once

#include <fmt/ostream.h>
#include <iostream>
#include <jansson.h>
#include <list>
#include <string>

#include <fmt/ostream.h>
#include <jansson.h>

#include <villas/common.hpp>
#include <villas/config.hpp>
#include <villas/log.hpp>
Expand Down
7 changes: 3 additions & 4 deletions common/include/villas/popen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,16 @@

#pragma once

#include <signal.h>

#include <ext/stdio_filebuf.h>

#include <istream>
#include <map>
#include <memory>
#include <ostream>
#include <string>
#include <vector>

#include <ext/stdio_filebuf.h>
#include <signal.h>

namespace villas {
namespace utils {

Expand Down
1 change: 0 additions & 1 deletion common/include/villas/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <cstdint>
#include <cstdio>

#include <ctime>

namespace villas {
Expand Down
1 change: 0 additions & 1 deletion common/include/villas/timing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <cstdint>
#include <cstdio>

#include <ctime>

// Compare two timestamps. Return zero if they are equal.
Expand Down
9 changes: 4 additions & 5 deletions common/include/villas/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@

#pragma once

#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <filesystem>
#include <list>
#include <string>
#include <vector>

#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <openssl/sha.h>
#include <sched.h>
#include <signal.h>
#include <sys/types.h>

#include <openssl/sha.h>

#include <villas/config.hpp>

#ifdef __GNUC__
Expand Down
4 changes: 2 additions & 2 deletions common/lib/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <villas/common.hpp>

#include <cstdlib>

#include <villas/common.hpp>

std::string stateToString(enum State s) {
switch (s) {
case State::DESTROYED:
Expand Down
1 change: 1 addition & 0 deletions common/lib/compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

#include <cstring>

#include <jansson.h>
#include <unistd.h>

Expand Down
1 change: 1 addition & 0 deletions common/lib/dsp/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <cmath>
#include <iostream>

#include <villas/dsp/pid.hpp>

using namespace std;
Expand Down
3 changes: 1 addition & 2 deletions common/lib/kernel/devices/device_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <villas/kernel/devices/device_connection.hpp>

#include <memory>

#include <villas/kernel/devices/device_connection.hpp>
#include <villas/kernel/devices/linux_driver.hpp>
#include <villas/memory_manager.hpp>

Expand Down
3 changes: 1 addition & 2 deletions common/lib/kernel/devices/linux_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <villas/kernel/devices/linux_driver.hpp>

#include <villas/kernel/devices/device.hpp>
#include <villas/kernel/devices/linux_driver.hpp>
#include <villas/utils.hpp>

using villas::kernel::devices::Device, villas::kernel::devices::LinuxDriver;
Expand Down
1 change: 1 addition & 0 deletions common/lib/kernel/devices/pci_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

#include <cstring>

#include <dirent.h>
#include <fcntl.h>
#include <libgen.h>
Expand Down
10 changes: 4 additions & 6 deletions common/lib/kernel/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@
#include <cstdio>
#include <cstring>
#include <ctime>
#include <fcntl.h>
#include <sys/utsname.h>
#include <unistd.h>

#include <fcntl.h>
#include <sys/types.h>
#include <sys/utsname.h>
#include <sys/wait.h>
#include <unistd.h>

#include <villas/config.hpp>
#include <villas/exceptions.hpp>
#include <villas/kernel/kernel.hpp>
#include <villas/log.hpp>
#include <villas/utils.hpp>

#include <villas/exceptions.hpp>
#include <villas/kernel/kernel.hpp>

using namespace villas;
using namespace villas::utils;

Expand Down
5 changes: 2 additions & 3 deletions common/lib/kernel/rt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
#include <villas/config.hpp>
#include <villas/cpuset.hpp>
#include <villas/exceptions.hpp>
#include <villas/log.hpp>
#include <villas/utils.hpp>

#include <villas/kernel/kernel.hpp>
#include <villas/kernel/rt.hpp>
#include <villas/log.hpp>
#include <villas/utils.hpp>

#ifdef __linux__
using villas::utils::CpuSet;
Expand Down
7 changes: 3 additions & 4 deletions common/lib/kernel/vfio_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@

#include <algorithm>
#include <array>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <sstream>
#include <string>

#include <cstdlib>
#include <cstring>

#include <cstdint>
#include <fcntl.h>
#include <linux/pci_regs.h>
#include <sys/eventfd.h>
Expand Down
Loading