summaryrefslogtreecommitdiffstats
path: root/vdslib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-07-25 10:46:55 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2017-07-25 10:46:55 +0200
commit2c8eb16011e4488a6d587c5d7dbd24025d231c9d (patch)
treed15d5fd6166fb9f611e0a06165922722912cd66f /vdslib
parent45859d96151b273cbf00afb35e0101f405a3cb31 (diff)
Use nested namespace syntax.
Do not include more than you need.
Diffstat (limited to 'vdslib')
-rw-r--r--vdslib/src/tests/distribution/distributiontest.cpp7
-rw-r--r--vdslib/src/vespa/vdslib/distribution/distribution.cpp3
-rw-r--r--vdslib/src/vespa/vdslib/state/clusterstate.h7
-rw-r--r--vdslib/src/vespa/vdslib/state/diskstate.cpp6
-rw-r--r--vdslib/src/vespa/vdslib/state/diskstate.h10
-rw-r--r--vdslib/src/vespa/vdslib/state/nodestate.cpp7
-rw-r--r--vdslib/src/vespa/vdslib/state/nodestate.h9
-rw-r--r--vdslib/src/vespa/vdslib/state/random.h9
-rw-r--r--vdslib/src/vespa/vdslib/state/state.h7
9 files changed, 21 insertions, 44 deletions
diff --git a/vdslib/src/tests/distribution/distributiontest.cpp b/vdslib/src/tests/distribution/distributiontest.cpp
index 0af60bd2eea..3090910d2bb 100644
--- a/vdslib/src/tests/distribution/distributiontest.cpp
+++ b/vdslib/src/tests/distribution/distributiontest.cpp
@@ -2,6 +2,7 @@
#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vdslib/distribution/idealnodecalculator.h>
+#include <vespa/vdslib/state/random.h>
#include <vespa/config/helper/configfetcher.h>
#include <vespa/vespalib/data/slime/slime.h>
#include <vespa/vespalib/io/fileutil.h>
@@ -18,8 +19,7 @@
#include <thread>
#include <fstream>
-namespace storage {
-namespace lib {
+namespace storage::lib {
struct DistributionTest : public CppUnit::TestFixture {
void testVerifyJavaDistributions();
@@ -1491,5 +1491,4 @@ DistributionTest::testEmptyAndCopy()
CPPUNIT_ASSERT_EQUAL(uint16_t(1), d.getReadyCopies());
}
-} // lib
-} // storage
+}
diff --git a/vdslib/src/vespa/vdslib/distribution/distribution.cpp b/vdslib/src/vespa/vdslib/distribution/distribution.cpp
index e8b94adba36..908de49e311 100644
--- a/vdslib/src/vespa/vdslib/distribution/distribution.cpp
+++ b/vdslib/src/vespa/vdslib/distribution/distribution.cpp
@@ -1,8 +1,9 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "distribution.h"
-#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/vdslib/state/clusterstate.h>
+#include <vespa/vdslib/state/random.h>
+#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/vespalib/util/bobhash.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <boost/lexical_cast.hpp>
diff --git a/vdslib/src/vespa/vdslib/state/clusterstate.h b/vdslib/src/vespa/vdslib/state/clusterstate.h
index a4e2a520e70..b60f2f6f1cc 100644
--- a/vdslib/src/vespa/vdslib/state/clusterstate.h
+++ b/vdslib/src/vespa/vdslib/state/clusterstate.h
@@ -12,8 +12,7 @@
#include "nodestate.h"
#include <map>
-namespace storage {
-namespace lib {
+namespace storage::lib {
class Distribution;
class Group;
@@ -79,6 +78,4 @@ private:
};
-} // lib
-} // storage
-
+}
diff --git a/vdslib/src/vespa/vdslib/state/diskstate.cpp b/vdslib/src/vespa/vdslib/state/diskstate.cpp
index 49cc789f349..bcc380e0d75 100644
--- a/vdslib/src/vespa/vdslib/state/diskstate.cpp
+++ b/vdslib/src/vespa/vdslib/state/diskstate.cpp
@@ -10,8 +10,7 @@
LOG_SETUP(".vdslib.diskstate");
-namespace storage {
-namespace lib {
+namespace storage::lib {
DiskState::DiskState()
: _state(0),
@@ -161,5 +160,4 @@ DiskState::operator!=(const DiskState& other) const
return (_state != other._state || _capacity != other._capacity);
}
-} // lib
-} // storage
+}
diff --git a/vdslib/src/vespa/vdslib/state/diskstate.h b/vdslib/src/vespa/vdslib/state/diskstate.h
index fde88680d86..0dcde1e7879 100644
--- a/vdslib/src/vespa/vdslib/state/diskstate.h
+++ b/vdslib/src/vespa/vdslib/state/diskstate.h
@@ -10,8 +10,7 @@
#include <vespa/document/util/printable.h>
#include <vespa/vespalib/objects/floatingpointtype.h>
-namespace storage {
-namespace lib {
+namespace storage::lib {
class DiskState : public document::Printable {
const State* _state;
@@ -23,8 +22,7 @@ public:
typedef std::shared_ptr<DiskState> SP;
DiskState();
- DiskState(const State&, const vespalib::stringref & description = "",
- double capacity = 1.0);
+ DiskState(const State&, const vespalib::stringref & description = "", double capacity = 1.0);
explicit DiskState(const vespalib::stringref & serialized);
void serialize(vespalib::asciistream & out, const vespalib::stringref & prefix = "",
@@ -44,6 +42,4 @@ public:
};
-} // lib
-} // storage
-
+}
diff --git a/vdslib/src/vespa/vdslib/state/nodestate.cpp b/vdslib/src/vespa/vdslib/state/nodestate.cpp
index f6c3747bed2..ff6c8f31c89 100644
--- a/vdslib/src/vespa/vdslib/state/nodestate.cpp
+++ b/vdslib/src/vespa/vdslib/state/nodestate.cpp
@@ -7,15 +7,13 @@
#include <vespa/document/util/stringutil.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/stllike/asciistream.h>
-#include <vespa/vdslib/state/random.h>
#include <sstream>
#include <cmath>
#include <vespa/log/log.h>
LOG_SETUP(".vdslib.nodestate");
-namespace storage {
-namespace lib {
+namespace storage::lib {
NodeState::NodeState(const NodeState &) = default;
NodeState & NodeState::operator = (const NodeState &) = default;
@@ -615,5 +613,4 @@ NodeState::getTextualDifference(const NodeState& other) const {
return total.str();
}
-} // lib
-} // storage
+}
diff --git a/vdslib/src/vespa/vdslib/state/nodestate.h b/vdslib/src/vespa/vdslib/state/nodestate.h
index 36b3179f6e2..edf2a308fa0 100644
--- a/vdslib/src/vespa/vdslib/state/nodestate.h
+++ b/vdslib/src/vespa/vdslib/state/nodestate.h
@@ -11,12 +11,9 @@
#pragma once
#include "diskstate.h"
-#include "state.h"
-#include "random.h"
#include <vespa/document/bucket/bucketidfactory.h>
-namespace storage {
-namespace lib {
+namespace storage::lib {
class NodeState : public document::Printable
{
@@ -104,6 +101,4 @@ public:
};
-} // lib
-} // storage
-
+}
diff --git a/vdslib/src/vespa/vdslib/state/random.h b/vdslib/src/vespa/vdslib/state/random.h
index c2b123e96e4..8344f89d600 100644
--- a/vdslib/src/vespa/vdslib/state/random.h
+++ b/vdslib/src/vespa/vdslib/state/random.h
@@ -3,14 +3,13 @@
#include <vespa/vespalib/util/random.h>
-namespace storage {
-namespace lib {
+namespace storage::lib {
/**
* Random number generator. Compatible with java.util.Random
* Calls PRNG from vespalib, but throws away the first number generated.
*/
-class RandomGen : public vespalib::RandomGen{
+class RandomGen : public vespalib::RandomGen {
public:
RandomGen(int32_t seed) : vespalib::RandomGen(seed) {
nextDouble();
@@ -30,6 +29,4 @@ public:
}
};
-} // lib
-} // storage
-
+}
diff --git a/vdslib/src/vespa/vdslib/state/state.h b/vdslib/src/vespa/vdslib/state/state.h
index 3ce66c35943..e0857fe8ccd 100644
--- a/vdslib/src/vespa/vdslib/state/state.h
+++ b/vdslib/src/vespa/vdslib/state/state.h
@@ -14,8 +14,7 @@
#include <vespa/vespalib/stllike/string.h>
#include <vector>
-namespace storage {
-namespace lib {
+namespace storage::lib {
class State : public vespalib::Printable {
vespalib::string _name;
@@ -82,6 +81,4 @@ public:
bool oneOf(const char* states) const;
};
-} // lib
-} // storage
-
+}