diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-02-23 23:46:48 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-02-23 23:46:48 +0000 |
commit | d2c9bd6588e23b449c4b672bec023ddb535bc9ec (patch) | |
tree | 125cc501bdba4d13ed6e24b766fd6e71c46c22af /fnet | |
parent | 0d90251fe2dee64524836751b9d27dc71e3ab2e1 (diff) |
- Add debug logging.
- std::make_unique
- Reduce code visibility.
Diffstat (limited to 'fnet')
-rw-r--r-- | fnet/src/tests/frt/values/values_test.cpp | 1 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/rpcrequest.h | 1 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/values.cpp | 5 | ||||
-rw-r--r-- | fnet/src/vespa/fnet/frt/values.h | 5 |
4 files changed, 8 insertions, 4 deletions
diff --git a/fnet/src/tests/frt/values/values_test.cpp b/fnet/src/tests/frt/values/values_test.cpp index 5bc6b0e2dce..3b36e8989c1 100644 --- a/fnet/src/tests/frt/values/values_test.cpp +++ b/fnet/src/tests/frt/values/values_test.cpp @@ -3,6 +3,7 @@ #include <vespa/fnet/frt/values.h> #include <vespa/fnet/databuffer.h> #include <vespa/fnet/info.h> +#include <vespa/vespalib/util/stash.h> using vespalib::Stash; diff --git a/fnet/src/vespa/fnet/frt/rpcrequest.h b/fnet/src/vespa/fnet/frt/rpcrequest.h index cc871e7ac0c..eaa34a46b7a 100644 --- a/fnet/src/vespa/fnet/frt/rpcrequest.h +++ b/fnet/src/vespa/fnet/frt/rpcrequest.h @@ -5,6 +5,7 @@ #include "values.h" #include "error.h" #include <vespa/fnet/context.h> +#include <vespa/vespalib/util/stash.h> #include <atomic> class FNETConnection; diff --git a/fnet/src/vespa/fnet/frt/values.cpp b/fnet/src/vespa/fnet/frt/values.cpp index a5f59df19b2..3b37aa9a1bc 100644 --- a/fnet/src/vespa/fnet/frt/values.cpp +++ b/fnet/src/vespa/fnet/frt/values.cpp @@ -3,6 +3,7 @@ #include "values.h" #include <vespa/fnet/databuffer.h> #include <vespa/vespalib/util/stringfmt.h> +#include <vespa/vespalib/util/stash.h> #include <cassert> static_assert(sizeof(uint8_t) == 1, "uint8_t must be 1 byte."); @@ -81,7 +82,7 @@ FRT_Values::FRT_Values(Stash &stash) _stash(stash) { } -FRT_Values::~FRT_Values() { } +FRT_Values::~FRT_Values() = default; LocalBlob::LocalBlob(const char *data, uint32_t len) : _data(Alloc::alloc(len)), @@ -294,7 +295,7 @@ FRT_Values::AddSharedData(FRT_ISharedBlob *blob) { } void -FRT_Values::AddData(vespalib::alloc::Alloc buf, uint32_t len) { +FRT_Values::AddData(vespalib::alloc::Alloc && buf, uint32_t len) { AddSharedData(&_stash.create<LocalBlob>(std::move(buf), len)); } diff --git a/fnet/src/vespa/fnet/frt/values.h b/fnet/src/vespa/fnet/frt/values.h index e00aec8423c..2aa7551c423 100644 --- a/fnet/src/vespa/fnet/frt/values.h +++ b/fnet/src/vespa/fnet/frt/values.h @@ -3,9 +3,10 @@ #pragma once #include "isharedblob.h" -#include <vespa/vespalib/util/stash.h> #include <cstring> +namespace vespalib { class Stash; } +namespace vespalib::alloc { class Alloc; } namespace fnet { char * copyString(char *dst, const char *src, size_t len); char * copyData(char *dst, const void *src, size_t len); @@ -216,7 +217,7 @@ public: char *AddString(uint32_t len); FRT_StringValue *AddStringArray(uint32_t len); void AddSharedData(FRT_ISharedBlob *blob); - void AddData(Alloc buf, uint32_t len); + void AddData(Alloc && buf, uint32_t len); void AddData(const char *buf, uint32_t len); char *AddData(uint32_t len); FRT_DataValue *AddDataArray(uint32_t len); |