summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-03-04 00:19:23 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-03-08 21:38:39 +0000
commitdc28bbbd37e04b254b9a3f5a3f47709fbf22371e (patch)
treece15bb4025cb99cfa4e4ce0e6831859036305b4a /config
parent032de590a77215ac3625e380dd94fbe5fd8aa19f (diff)
Deinline destructors/constructors
Diffstat (limited to 'config')
-rw-r--r--config/src/apps/configproxy-cmd/flags.h14
-rw-r--r--config/src/apps/configproxy-cmd/main.cpp1
-rw-r--r--config/src/apps/configproxy-cmd/proxycmd.cpp14
-rw-r--r--config/src/apps/configproxy-cmd/proxycmd.h13
-rw-r--r--config/src/tests/configfetcher/configfetcher.cpp8
-rw-r--r--config/src/tests/configmanager/configmanager.cpp13
-rw-r--r--config/src/tests/frt/frt.cpp18
-rw-r--r--config/src/tests/functiontest/functiontest.cpp11
8 files changed, 56 insertions, 36 deletions
diff --git a/config/src/apps/configproxy-cmd/flags.h b/config/src/apps/configproxy-cmd/flags.h
deleted file mode 100644
index ce64889256b..00000000000
--- a/config/src/apps/configproxy-cmd/flags.h
+++ /dev/null
@@ -1,14 +0,0 @@
-// 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 <vector>
-
-struct Flags {
- vespalib::string method;
- std::vector<vespalib::string> args;
- vespalib::string hostname;
- int portnumber;
- Flags() : method("cache"), args(), hostname("localhost"), portnumber(19090) {}
-};
-
diff --git a/config/src/apps/configproxy-cmd/main.cpp b/config/src/apps/configproxy-cmd/main.cpp
index b9090d3b641..3a8cf33c343 100644
--- a/config/src/apps/configproxy-cmd/main.cpp
+++ b/config/src/apps/configproxy-cmd/main.cpp
@@ -1,6 +1,5 @@
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include "flags.h"
#include "proxycmd.h"
#include "methods.h"
#include <vespa/fastos/app.h>
diff --git a/config/src/apps/configproxy-cmd/proxycmd.cpp b/config/src/apps/configproxy-cmd/proxycmd.cpp
index 48c343367f7..794c005f485 100644
--- a/config/src/apps/configproxy-cmd/proxycmd.cpp
+++ b/config/src/apps/configproxy-cmd/proxycmd.cpp
@@ -4,12 +4,24 @@
#include <iostream>
#include <vespa/vespalib/util/stringfmt.h>
+Flags::Flags(const Flags &) = default;
+Flags & Flags::operator=(const Flags &) = default;
+Flags::Flags()
+ : method("cache"),
+ args(),
+ hostname("localhost"),
+ portnumber(19090)
+{ }
+Flags::~Flags() { }
+
ProxyCmd::ProxyCmd(const Flags& flags)
: _supervisor(NULL),
_target(NULL),
_req(NULL),
_flags(flags)
-{}
+{ }
+
+ProxyCmd::~ProxyCmd() { }
void ProxyCmd::initRPC() {
_supervisor = new FRT_Supervisor();
diff --git a/config/src/apps/configproxy-cmd/proxycmd.h b/config/src/apps/configproxy-cmd/proxycmd.h
index 6fc8261991f..a0ef02edaae 100644
--- a/config/src/apps/configproxy-cmd/proxycmd.h
+++ b/config/src/apps/configproxy-cmd/proxycmd.h
@@ -1,9 +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 "flags.h"
#include <vespa/fnet/frt/frt.h>
+struct Flags {
+ vespalib::string method;
+ std::vector<vespalib::string> args;
+ vespalib::string hostname;
+ int portnumber;
+ Flags(const Flags &);
+ Flags & operator=(const Flags &);
+ Flags();
+ ~Flags();
+};
class ProxyCmd
{
@@ -22,7 +31,7 @@ private:
public:
ProxyCmd(const Flags& flags);
- virtual ~ProxyCmd() {}
+ virtual ~ProxyCmd();
int action();
};
diff --git a/config/src/tests/configfetcher/configfetcher.cpp b/config/src/tests/configfetcher/configfetcher.cpp
index 6d319fdff67..5d4ee8dcd2b 100644
--- a/config/src/tests/configfetcher/configfetcher.cpp
+++ b/config/src/tests/configfetcher/configfetcher.cpp
@@ -12,8 +12,9 @@ using namespace config;
class MyCallback : public IFetcherCallback<MyConfig>
{
public:
- MyCallback(const std::string & badConfig="") : _config(), _configured(false), _badConfig(badConfig) { }
- void configure(std::unique_ptr<MyConfig> config)
+ MyCallback(const std::string & badConfig="");
+ ~MyCallback();
+ void configure(std::unique_ptr<MyConfig> config) override
{
_config = std::move(config);
_configured = true;
@@ -26,6 +27,9 @@ public:
std::string _badConfig;
};
+MyCallback::MyCallback(const std::string & badConfig) : _config(), _configured(false), _badConfig(badConfig) { }
+MyCallback::~MyCallback() { }
+
TEST("requireThatConfigIsAvailableOnConstruction") {
RawSpec spec("myField \"foo\"\n");
MyCallback cb;
diff --git a/config/src/tests/configmanager/configmanager.cpp b/config/src/tests/configmanager/configmanager.cpp
index d0e8f5444e0..1b20458b47e 100644
--- a/config/src/tests/configmanager/configmanager.cpp
+++ b/config/src/tests/configmanager/configmanager.cpp
@@ -106,11 +106,8 @@ namespace {
ConfigManager _mgr;
ConfigSubscription::SP sub;
- ManagerTester(const ConfigKey & k, const MySpec & s)
- : key(k),
- _mgr(s.createSourceFactory(testTimingValues), 1)
- {
- }
+ ManagerTester(const ConfigKey & k, const MySpec & s);
+ ~ManagerTester();
void subscribe()
{
@@ -118,6 +115,12 @@ namespace {
}
};
+ ManagerTester::ManagerTester(const ConfigKey & k, const MySpec & s)
+ : key(k),
+ _mgr(s.createSourceFactory(testTimingValues), 1)
+ { }
+ ManagerTester::~ManagerTester() { }
+
}
TEST("requireThatSubscriptionTimesout") {
diff --git a/config/src/tests/frt/frt.cpp b/config/src/tests/frt/frt.cpp
index 597951af352..89cf9dd9e6a 100644
--- a/config/src/tests/frt/frt.cpp
+++ b/config/src/tests/frt/frt.cpp
@@ -128,13 +128,8 @@ namespace {
FRT_Supervisor supervisor;
FNET_Scheduler scheduler;
vespalib::string address;
- ConnectionMock(FRT_RPCRequest * answer = NULL)
- : errorCode(0),
- timeout(0),
- ans(answer),
- supervisor(),
- address()
- { }
+ ConnectionMock(FRT_RPCRequest * answer = NULL);
+ ~ConnectionMock();
FRT_RPCRequest * allocRPCRequest() { return supervisor.AllocRPCRequest(); }
void setError(int ec) { errorCode = ec; }
void invoke(FRT_RPCRequest * req, double t, FRT_IRequestWait * waiter)
@@ -149,6 +144,15 @@ namespace {
void setTransientDelay(int64_t delay) { (void) delay; }
};
+ ConnectionMock::ConnectionMock(FRT_RPCRequest * answer)
+ : errorCode(0),
+ timeout(0),
+ ans(answer),
+ supervisor(),
+ address()
+ { }
+ ConnectionMock::~ConnectionMock() { }
+
struct FactoryMock : public ConnectionFactory {
ConnectionMock * current;
FactoryMock(ConnectionMock * c) : current(c) { }
diff --git a/config/src/tests/functiontest/functiontest.cpp b/config/src/tests/functiontest/functiontest.cpp
index 24d50b44ca4..deed6f15f1a 100644
--- a/config/src/tests/functiontest/functiontest.cpp
+++ b/config/src/tests/functiontest/functiontest.cpp
@@ -94,13 +94,16 @@ struct LazyTestFixture
ConfigHandle<FunctionTestConfig>::UP _handle;
std::unique_ptr<FunctionTestConfig> _config;
- LazyTestFixture(const std::string & dirName)
+ LazyTestFixture(const std::string & dirName);
+ ~LazyTestFixture();
+};
+
+LazyTestFixture::LazyTestFixture(const std::string & dirName)
: _spec(TEST_PATH(dirName)),
_subscriber(_spec),
_handle(_subscriber.subscribe<FunctionTestConfig>(""))
- {
- }
-};
+{ }
+LazyTestFixture::~LazyTestFixture() { }
struct TestFixture : public LazyTestFixture
{