summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-12-18 07:23:34 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-12-19 14:15:46 +0000
commit8422625dcbb5710f3d721625ced51ea805b166fe (patch)
tree35b79fb18ea09d56a5fa814d4b86737f06b77cb7 /config
parent7b3546f050fa2420bb6dc5222f078d2401cdef62 (diff)
decouple slime from config.
Diffstat (limited to 'config')
-rw-r--r--config/src/tests/configgen/value_converter.cpp4
-rw-r--r--config/src/vespa/config/common/configvalue.cpp8
-rw-r--r--config/src/vespa/config/common/configvalue.h7
-rw-r--r--config/src/vespa/config/configgen/configpayload.h6
-rw-r--r--config/src/vespa/config/configgen/value_converter.h3
-rw-r--r--config/src/vespa/config/frt/compressioninfo.cpp3
-rw-r--r--config/src/vespa/config/frt/protocol.cpp6
-rw-r--r--config/src/vespa/config/frt/protocol.h9
-rw-r--r--config/src/vespa/config/print/CMakeLists.txt1
-rw-r--r--config/src/vespa/config/print/configdatabuffer.cpp14
-rw-r--r--config/src/vespa/config/print/configdatabuffer.h17
-rw-r--r--config/src/vespa/config/print/fileconfigformatter.cpp7
-rw-r--r--config/src/vespa/config/print/jsonconfigformatter.cpp7
13 files changed, 64 insertions, 28 deletions
diff --git a/config/src/tests/configgen/value_converter.cpp b/config/src/tests/configgen/value_converter.cpp
index 467075354f2..de16478a121 100644
--- a/config/src/tests/configgen/value_converter.cpp
+++ b/config/src/tests/configgen/value_converter.cpp
@@ -1,10 +1,8 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <vespa/log/log.h>
-LOG_SETUP("value_converter");
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/config/configgen/value_converter.h>
#include <vespa/config/common/exceptions.h>
+#include <vespa/vespalib/data/slime/slime.h>
using namespace config;
using namespace config::internal;
diff --git a/config/src/vespa/config/common/configvalue.cpp b/config/src/vespa/config/common/configvalue.cpp
index 97706d25401..ce6f0a47cbd 100644
--- a/config/src/vespa/config/common/configvalue.cpp
+++ b/config/src/vespa/config/common/configvalue.cpp
@@ -2,6 +2,7 @@
#include "configvalue.h"
#include "payload_converter.h"
#include "misc.h"
+#include <vespa/vespalib/data/slime/slime.h>
namespace config {
@@ -9,20 +10,19 @@ ConfigValue::ConfigValue(const std::vector<vespalib::string> & lines, const vesp
: _payload(),
_lines(lines),
_md5sum(md5sum)
-{}
+{ }
ConfigValue::ConfigValue()
: _payload(),
_lines(),
_md5sum()
-{}
+{ }
ConfigValue::ConfigValue(const PayloadPtr & payload, const vespalib::string & md5)
: _payload(payload),
_lines(),
_md5sum(md5)
-{
-}
+{ }
ConfigValue::~ConfigValue() { }
diff --git a/config/src/vespa/config/common/configvalue.h b/config/src/vespa/config/common/configvalue.h
index ee877352c69..b148528d6b8 100644
--- a/config/src/vespa/config/common/configvalue.h
+++ b/config/src/vespa/config/common/configvalue.h
@@ -4,10 +4,15 @@
#include <vespa/vespalib/stllike/string.h>
#include <vector>
#include <memory>
-#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/config/frt/protocol.h>
#include <vespa/config/configgen/configpayload.h>
+namespace vespalib {
+ namespace slime {
+ class Cursor;
+ }
+}
+
namespace config {
typedef std::shared_ptr<const protocol::Payload> PayloadPtr;
diff --git a/config/src/vespa/config/configgen/configpayload.h b/config/src/vespa/config/configgen/configpayload.h
index 411fdc0d443..47b904ed665 100644
--- a/config/src/vespa/config/configgen/configpayload.h
+++ b/config/src/vespa/config/configgen/configpayload.h
@@ -1,7 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vespalib/data/slime/slime.h>
+namespace vespalib {
+ namespace slime {
+ class Inspector;
+ }
+}
namespace config {
diff --git a/config/src/vespa/config/configgen/value_converter.h b/config/src/vespa/config/configgen/value_converter.h
index c951f558781..6778017a6e7 100644
--- a/config/src/vespa/config/configgen/value_converter.h
+++ b/config/src/vespa/config/configgen/value_converter.h
@@ -1,8 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vespalib/stllike/string.h>
#include "configpayload.h"
+#include <vespa/vespalib/stllike/string.h>
+#include <vespa/vespalib/data/slime/inspector.h>
namespace config {
diff --git a/config/src/vespa/config/frt/compressioninfo.cpp b/config/src/vespa/config/frt/compressioninfo.cpp
index 270d335b7ae..17766325573 100644
--- a/config/src/vespa/config/frt/compressioninfo.cpp
+++ b/config/src/vespa/config/frt/compressioninfo.cpp
@@ -1,6 +1,7 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/config/frt/protocol.h>
#include "compressioninfo.h"
+#include <vespa/config/frt/protocol.h>
+#include <vespa/vespalib/data/slime/inspector.h>
using namespace vespalib;
using namespace vespalib::slime;
diff --git a/config/src/vespa/config/frt/protocol.cpp b/config/src/vespa/config/frt/protocol.cpp
index 43eba571083..ccc56fd51b9 100644
--- a/config/src/vespa/config/frt/protocol.cpp
+++ b/config/src/vespa/config/frt/protocol.cpp
@@ -1,9 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/log/log.h>
-LOG_SETUP(".config.frt.protocol");
#include "protocol.h"
#include <lz4.h>
#include <vespa/vespalib/util/stringfmt.h>
+#include <vespa/vespalib/data/slime/slime.h>
+
+#include <vespa/log/log.h>
+LOG_SETUP(".config.frt.protocol");
using namespace vespalib;
using vespalib::alloc::Alloc;
diff --git a/config/src/vespa/config/frt/protocol.h b/config/src/vespa/config/frt/protocol.h
index 6d1c2b8226c..6334d78ceea 100644
--- a/config/src/vespa/config/frt/protocol.h
+++ b/config/src/vespa/config/frt/protocol.h
@@ -1,11 +1,18 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vespalib/data/slime/slime.h>
+#include <vespa/vespalib/data/slime/memory.h>
#include <vespa/vespalib/stllike/string.h>
#include <vespa/config/common/compressiontype.h>
#include <vespa/vespalib/util/alloc.h>
+namespace vespalib {
+ class Slime;
+ namespace slime {
+ class Inspector;
+ }
+}
+
namespace config {
namespace protocol {
diff --git a/config/src/vespa/config/print/CMakeLists.txt b/config/src/vespa/config/print/CMakeLists.txt
index 469ec46f0a8..5c8d6eb573c 100644
--- a/config/src/vespa/config/print/CMakeLists.txt
+++ b/config/src/vespa/config/print/CMakeLists.txt
@@ -10,5 +10,6 @@ vespa_add_library(config_print OBJECT
fileconfigsnapshotreader.cpp
asciiconfigsnapshotwriter.cpp
asciiconfigsnapshotreader.cpp
+ configdatabuffer.cpp
DEPENDS
)
diff --git a/config/src/vespa/config/print/configdatabuffer.cpp b/config/src/vespa/config/print/configdatabuffer.cpp
new file mode 100644
index 00000000000..b81274790c2
--- /dev/null
+++ b/config/src/vespa/config/print/configdatabuffer.cpp
@@ -0,0 +1,14 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#include "configdatabuffer.h"
+#include <vespa/vespalib/data/slime/slime.h>
+
+namespace config {
+
+ConfigDataBuffer::ConfigDataBuffer() :
+ _slime(std::make_unique<vespalib::Slime>())
+{ }
+
+ConfigDataBuffer::~ConfigDataBuffer() { }
+
+} // namespace config
diff --git a/config/src/vespa/config/print/configdatabuffer.h b/config/src/vespa/config/print/configdatabuffer.h
index ff485a19058..1f70833a515 100644
--- a/config/src/vespa/config/print/configdatabuffer.h
+++ b/config/src/vespa/config/print/configdatabuffer.h
@@ -1,9 +1,12 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/stllike/string.h>
+namespace vespalib {
+ class Slime;
+}
+
namespace config {
/**
@@ -12,12 +15,18 @@ namespace config {
class ConfigDataBuffer
{
public:
- vespalib::Slime & slimeObject() { return _slime; }
- const vespalib::Slime & slimeObject() const { return _slime; }
+ ConfigDataBuffer(const ConfigDataBuffer &) = delete;
+ ConfigDataBuffer & operator = (const ConfigDataBuffer &) = delete;
+ ConfigDataBuffer(ConfigDataBuffer &&) = default;
+ ConfigDataBuffer & operator = (ConfigDataBuffer &&) = default;
+ ConfigDataBuffer();
+ ~ConfigDataBuffer();
+ vespalib::Slime & slimeObject() { return *_slime; }
+ const vespalib::Slime & slimeObject() const { return *_slime; }
const vespalib::string & getEncodedString() const { return _encoded; }
void setEncodedString(const vespalib::string & encoded) { _encoded = encoded; }
private:
- vespalib::Slime _slime;
+ std::unique_ptr<vespalib::Slime> _slime;
vespalib::string _encoded;
};
diff --git a/config/src/vespa/config/print/fileconfigformatter.cpp b/config/src/vespa/config/print/fileconfigformatter.cpp
index 4c9c96f06c4..64421e2bbc8 100644
--- a/config/src/vespa/config/print/fileconfigformatter.cpp
+++ b/config/src/vespa/config/print/fileconfigformatter.cpp
@@ -1,12 +1,11 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <cmath>
-#include <stack>
-#include <vector>
#include "fileconfigformatter.h"
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/data/slime/slime.h>
+#include <cmath>
+#include <vector>
using namespace vespalib::slime::convenience;
diff --git a/config/src/vespa/config/print/jsonconfigformatter.cpp b/config/src/vespa/config/print/jsonconfigformatter.cpp
index 998895eeac4..ad6e41be756 100644
--- a/config/src/vespa/config/print/jsonconfigformatter.cpp
+++ b/config/src/vespa/config/print/jsonconfigformatter.cpp
@@ -1,14 +1,9 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/fastos/fastos.h>
-#include <cmath>
-#include <stack>
-#include <vector>
#include "jsonconfigformatter.h"
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/data/slime/json_format.h>
-
-using namespace vespalib::slime::convenience;
+#include <vespa/vespalib/data/slime/simple_buffer.h>
using vespalib::slime::SimpleBuffer;
using vespalib::slime::Output;