diff --git a/source/kelgin/async.h b/source/kelgin/async.h index af69cfc..2e2cf47 100644 --- a/source/kelgin/async.h +++ b/source/kelgin/async.h @@ -183,7 +183,7 @@ public: * Useful for resource lifetime control. */ template - [[nodiscard]] Conveyor attach(Args &&...args); + [[nodiscard]] Conveyor attach(Args &&... args); /** @todo implement * This method limits the total amount of passed elements @@ -601,7 +601,7 @@ private: std::tuple attached_data; public: - AttachConveyorNode(Own &&dep, Args &&...args) + AttachConveyorNode(Own &&dep, Args &&... args) : AttachConveyorNodeBase(std::move(dep)), attached_data{ std::move(args...)} {} }; diff --git a/source/kelgin/async.tmpl.h b/source/kelgin/async.tmpl.h index 67312e5..292a38d 100644 --- a/source/kelgin/async.tmpl.h +++ b/source/kelgin/async.tmpl.h @@ -73,7 +73,7 @@ template Conveyor Conveyor::buffer(size_t size) { template template -Conveyor Conveyor::attach(Args &&...args) { +Conveyor Conveyor::attach(Args &&... args) { Own> attach_node = heap>(std::move(node), std::move(args...)); return Conveyor{std::move(attach_node), storage}; diff --git a/source/kelgin/common.h b/source/kelgin/common.h index 3939076..58d4d2b 100644 --- a/source/kelgin/common.h +++ b/source/kelgin/common.h @@ -39,11 +39,11 @@ template using Our = std::shared_ptr; template using Lent = std::weak_ptr; -template Own heap(Args &&...args) { +template Own heap(Args &&... args) { return Own(new T(std::forward(args)...)); } -template Our share(Args &&...args) { +template Our share(Args &&... args) { return std::make_shared(std::forward(args)...); } diff --git a/source/kelgin/json.h b/source/kelgin/json.h index 189a491..edb5b6f 100644 --- a/source/kelgin/json.h +++ b/source/kelgin/json.h @@ -835,9 +835,7 @@ Error JsonCodec::decodeValue(Own &message, Buffer &buffer, decodeNull(buffer); message = std::move(msg_null); } break; - default: { - return criticalError("Cannot identify next JSON value"); - } + default: { return criticalError("Cannot identify next JSON value"); } } skipWhitespace(buffer); diff --git a/source/kelgin/message.h b/source/kelgin/message.h index 2c50b68..6d39046 100644 --- a/source/kelgin/message.h +++ b/source/kelgin/message.h @@ -122,13 +122,9 @@ public: } }; - Builder build(){ - return Builder{*this}; - } + Builder build() { return Builder{*this}; } - Reader read(){ - return Reader{*this}; - } + Reader read() { return Reader{*this}; } }; /* @@ -375,19 +371,20 @@ public: } }; -template> +template > class HeapMessageRoot { private: Own> root; -public: - HeapMessageRoot(Own> r):root{std::move(r)}{} - typename Message::Builder build(){ +public: + HeapMessageRoot(Own> r) : root{std::move(r)} {} + + typename Message::Builder build() { assert(root); return root->build(); } - typename Message::Reader read(){ + typename Message::Reader read() { assert(root); return root->read(); } @@ -396,10 +393,9 @@ public: /* * Minor helper for creating a message root */ -template> +template > inline HeapMessageRoot heapMessageRoot() { Own> root = heap>(); return HeapMessageRoot{std::move(root)}; - } } // namespace gin