Merge branch 'dev' into fb-mini-snake

fb-mini-snake
Claudius Holeksa 2022-12-18 16:17:25 +01:00
commit 03d8924cf4
7 changed files with 37 additions and 9 deletions

26
.clang-tidy Normal file
View File

@ -0,0 +1,26 @@
Checks: '-*,clang-analyzer-*,clang-analyzer-cplusplus*,readability-identifier-naming'
CheckOptions:
- { key: readability-identifier-naming.AggressiveDependentMemberLookup, value: true }
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.EnumCase, value: lower_case }
- { key: readability-identifier-naming.ConstexprFunctionCase, value: lower_case }
- { key: readability-identifier-naming.ConstexprMethodCase, value: lower_case }
- { key: readability-identifier-naming.ConstexprVariableCase, value: lower_case }
- { key: readability-identifier-naming.EnumConstantCase, value: lower_case }
- { key: readability-identifier-naming.ScopedEnumConstantCase, value: lower_case }
- { key: readability-identifier-naming.AbstractClassCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: lower_case }
- { key: readability-identifier-naming.ClassMethod, value: lower_case }
- { key: readability-identifier-naming.VirtualMethodCase, value: lower_case }
- { key: readability-identifier-naming.MemberCase, value: lower_case }
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.ValueTemplateParameterCase, value: lower_case }
- { key: readability-identifier-naming.TypeTemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.ParameterCase, value: lower_case }
- { key: readability-identifier-naming.TypeAliasCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberSuffix, value: '_' }
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: '_' }

View File

@ -1,4 +1,4 @@
#include "driver/io-unix.h"
#include "io-unix.h"
#include <sstream>

View File

@ -5,9 +5,9 @@
name = "forstio";
nativeBuildInputs = [
scons
clang-tools_12
clang-tools_14
clang-analyzer
clang_12
clang_14
cppcheck
];

View File

@ -1,6 +1,5 @@
#pragma once
#include "async.h"
#include "common.h"
#include "error.h"

View File

@ -3,6 +3,7 @@
#include "async.h"
#include "io.h"
#include "message.h"
#include "buffer.h"
namespace saw {
@ -34,7 +35,7 @@ public:
/**
* Send a message to the remote peer
*/
void send(HeapMessageRoot<Outgoing, OutContainer> builder);
Error send(HeapMessageRoot<Outgoing, OutContainer> builder);
/**
* A phantom conveyor feeder. Meant for interfacing with other components
@ -44,6 +45,7 @@ public:
Conveyor<void> onReadDisconnected();
private:
/// @unimplemented
class PeerConveyorFeeder final
: public ConveyorFeeder<HeapMessageRoot<Outgoing, OutContainer>> {
public:
@ -52,7 +54,7 @@ private:
OutContainer, BufferT> &peer_)
: peer{peer_} {}
void feed(T &&data) override { (void)data; }
void feed(HeapMessageRoot<Outgoing, OutContainer> &&data) override { (void)data; }
void fail(Error &&error) override { (void)error; }
@ -76,8 +78,8 @@ private:
BufferT in_buffer;
BufferT out_buffer;
SinkConveyor sink_read;
SinkConveyor sink_write;
ConveyorSink sink_read;
ConveyorSink sink_write;
PeerConveyorFeeder conveyor_feeder;
};

View File

@ -70,7 +70,7 @@ StreamingIoPeer<Codec, Incoming, Outgoing, InContainer, OutContainer, BufferT>::
template <typename Codec, typename Incoming, typename Outgoing,
typename InContainer, typename OutContainer, typename BufferT>
void StreamingIoPeer<Codec, Incoming, Outgoing, InContainer, OutContainer,
Error StreamingIoPeer<Codec, Incoming, Outgoing, InContainer, OutContainer,
BufferT>::send(HeapMessageRoot<Outgoing, OutContainer>
msg) {
bool restart_write = out_buffer.readSegmentLength() == 0;

View File

@ -1,6 +1,7 @@
#pragma once
#include "string_literal.h"
#include "common.h"
namespace saw {
namespace schema {