Skip to content

Commit

Permalink
Move all library identifiers to the seastar namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
avikivity committed May 20, 2017
1 parent f726938 commit ed52971
Show file tree
Hide file tree
Showing 229 changed files with 1,160 additions and 384 deletions.
1 change: 1 addition & 0 deletions apps/fair_queue_tester/fair_queue_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <iomanip>
#include <random>

using namespace seastar;
using namespace std::chrono_literals;

static auto random_seed = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
Expand Down
1 change: 1 addition & 0 deletions apps/httpd/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

namespace bpo = boost::program_options;

using namespace seastar;
using namespace httpd;

class handl : public httpd::handler_base {
Expand Down
4 changes: 4 additions & 0 deletions apps/iotune/iotune.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,13 @@
#include "core/aligned_buffer.hh"
#include "util/defer.hh"

using namespace seastar;
using namespace std::chrono_literals;

namespace seastar {
bool filesystem_has_good_aio_support(sstring directory, bool verbose);
}

class iotune_manager;

class iotune_timeout_exception : public std::exception {
Expand Down
2 changes: 2 additions & 0 deletions apps/memcached/ascii.rl
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <algorithm>
#include <functional>

using namespace seastar;

%%{

machine memcache_ascii_protocol;
Expand Down
5 changes: 3 additions & 2 deletions apps/memcached/memcache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
#define VERSION "v1.0"
#define VERSION_STRING PLATFORM " " VERSION

using namespace seastar;
using namespace net;

namespace bi = boost::intrusive;

namespace memcache {

namespace bi = boost::intrusive;

static constexpr double default_slab_growth_factor = 1.25;
static constexpr uint64_t default_slab_page_size = 1UL*MB;
static constexpr uint64_t default_per_cpu_slab_size = 0UL; // zero means reclaimer is enabled.
Expand Down
2 changes: 2 additions & 0 deletions apps/memcached/memcached.hh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

namespace memcache {

using namespace seastar;

class item;
class cache;

Expand Down
2 changes: 2 additions & 0 deletions apps/seawreck/seawreck.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "core/future-util.hh"
#include <chrono>

using namespace seastar;

template <typename... Args>
void http_debug(const char* fmt, Args&&... args) {
#if HTTP_DEBUG
Expand Down
4 changes: 4 additions & 0 deletions core/align.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <cstdint>
#include <cstdlib>

namespace seastar {

template <typename T>
inline constexpr
T align_up(T v, T align) {
Expand All @@ -51,4 +53,6 @@ T* align_down(T* v, size_t align) {
return reinterpret_cast<T*>(align_down(reinterpret_cast<uintptr_t>(v), align));
}

}

#endif /* ALIGN_HH_ */
4 changes: 4 additions & 0 deletions core/aligned_buffer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#include <stdexcept>
#include "print.hh"

namespace seastar {


struct free_deleter {
void operator()(void* p) { ::free(p); }
};
Expand All @@ -45,3 +48,4 @@ std::unique_ptr<CharType[], free_deleter> allocate_aligned_buffer(size_t size, s
}


}
4 changes: 4 additions & 0 deletions core/app-template.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#include <fstream>
#include <cstdlib>

namespace seastar {

namespace bpo = boost::program_options;

app_template::app_template(app_template::config cfg)
Expand Down Expand Up @@ -141,3 +143,5 @@ app_template::run_deprecated(int ac, char ** av, std::function<void ()>&& func)
smp::cleanup();
return exit_code;
}

}
4 changes: 4 additions & 0 deletions core/app-template.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <core/future.hh>
#include <core/sstring.hh>

namespace seastar {

class app_template {
public:
struct config {
Expand Down Expand Up @@ -63,4 +65,6 @@ public:
int run(int ac, char ** av, std::function<future<> ()>&& func);
};

}

#endif
4 changes: 4 additions & 0 deletions core/apply.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <tuple>
#include <utility>

namespace seastar {

template <typename Func, typename Args, typename IndexList>
struct apply_helper;

Expand Down Expand Up @@ -56,4 +58,6 @@ auto apply(Func&& func, const std::tuple<T...>& args) {
return helper::apply(std::forward<Func>(func), args);
}

}

#endif /* APPLY_HH_ */
4 changes: 3 additions & 1 deletion core/array_map.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <array>

namespace seastar {

// unordered_map implemented as a simple array

template <typename Value, size_t Max>
Expand All @@ -46,6 +48,6 @@ public:
}
};


}

#endif /* ARRAY_MAP_HH_ */
4 changes: 4 additions & 0 deletions core/bitops.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#include <limits>

namespace seastar {

inline
constexpr unsigned count_leading_zeros(unsigned x) {
return __builtin_clz(x);
Expand Down Expand Up @@ -66,4 +68,6 @@ inline constexpr unsigned log2floor(T n) {
return std::numeric_limits<T>::digits - count_leading_zeros(n) - 1;
}

}

#endif /* BITOPS_HH_ */
3 changes: 3 additions & 0 deletions core/bitset-iter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <bitset>
#include <limits>

namespace seastar {

namespace bitsets {

static constexpr int ulong_bits = std::numeric_limits<unsigned long>::digits;
Expand Down Expand Up @@ -172,6 +174,7 @@ static inline set_range<N> for_each_set(std::bitset<N> bitset, int offset = 0)
return set_range<N>(bitset, offset);
}

}

}

Expand Down
4 changes: 4 additions & 0 deletions core/byteorder.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <endian.h>
#include "unaligned.hh"

namespace seastar {

inline uint8_t cpu_to_le(uint8_t x) { return x; }
inline uint8_t le_to_cpu(uint8_t x) { return x; }
inline uint16_t cpu_to_le(uint16_t x) { return htole16(x); }
Expand Down Expand Up @@ -121,3 +123,5 @@ produce_be(char*& p, T datum) {
write_be<T>(p, datum);
p += sizeof(T);
}

}
4 changes: 4 additions & 0 deletions core/chunked_fifo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

#pragma once

namespace seastar {

// An unbounded FIFO queue of objects of type T.
//
// It provides operations to push items in one end of the queue, and pop them
Expand Down Expand Up @@ -462,3 +464,5 @@ void chunked_fifo<T, items_per_chunk>::reserve(size_t n) {
++_nfree_chunks;
}
}

}
4 changes: 4 additions & 0 deletions core/circular_buffer.hh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#include <memory>
#include <algorithm>

namespace seastar {

template <typename T, typename Alloc = std::allocator<T>>
class circular_buffer {
struct impl : Alloc {
Expand Down Expand Up @@ -440,4 +442,6 @@ circular_buffer<T, Alloc>::erase(iterator first, iterator last) {
}
}

}

#endif /* CIRCULAR_BUFFER_HH_ */
4 changes: 4 additions & 0 deletions core/condition-variable.hh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "core/future-util.hh"
#include "core/semaphore.hh"

namespace seastar {

/// \addtogroup fiber-module
/// @{

Expand Down Expand Up @@ -174,3 +176,5 @@ public:
};

/// @}

}
4 changes: 4 additions & 0 deletions core/deleter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#include <assert.h>
#include <type_traits>

namespace seastar {

/// \addtogroup memory-module
/// @{

Expand Down Expand Up @@ -272,4 +274,6 @@ make_object_deleter(deleter d, T&& obj) {

/// @}

}

#endif /* DELETER_HH_ */
7 changes: 6 additions & 1 deletion core/distributed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,10 @@

#include "sharded.hh"

namespace seastar {


template <typename Service>
using distributed = seastar::sharded<Service>;
using distributed = sharded<Service>;

}
4 changes: 4 additions & 0 deletions core/do_with.hh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include <memory>
#include <tuple>

namespace seastar {

/// \addtogroup future-util
/// @{

Expand Down Expand Up @@ -112,3 +114,5 @@ do_with(T1&& rv1, T2&& rv2, T3_or_F&& rv3, More&&... more) {
}

/// @}

}
4 changes: 4 additions & 0 deletions core/dpdk_rte.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <experimental/optional>
#include <rte_pci.h>

namespace seastar {

namespace dpdk {

bool eal::initialized = false;
Expand Down Expand Up @@ -111,4 +113,6 @@ size_t eal::mem_size(int num_cpus, bool hugetlbfs_membackend)

} // namespace dpdk

}

#endif // HAVE_DPDK
5 changes: 5 additions & 0 deletions core/dpdk_rte.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#endif
/******************************************************************************/

namespace seastar {

namespace dpdk {

// DPDK Environment Abstraction Layer
Expand All @@ -57,5 +59,8 @@ public:
};

} // namespace dpdk

}

#endif // HAVE_DPDK
#endif // DPDK_RTE_HH_
4 changes: 4 additions & 0 deletions core/enum.hh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include <functional>
#include <cstddef>

namespace seastar {

template <typename T>
class enum_hash {
static_assert(std::is_enum<T>::value, "must be an enum");
Expand All @@ -40,3 +42,5 @@ public:
return std::hash<utype>()(static_cast<utype>(e));
}
};

}
4 changes: 4 additions & 0 deletions core/expiring_fifo.hh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include "future-util.hh"
#include "lowres_clock.hh"

namespace seastar {

template<typename T>
struct dummy_expiry {
void operator()(T&) noexcept {};
Expand Down Expand Up @@ -165,3 +167,5 @@ public:
drop_expired_front();
}
};

}
4 changes: 4 additions & 0 deletions core/fair_queue.hh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
#include <unordered_set>
#include <cmath>

namespace seastar {

/// \addtogroup io-module
/// @{

Expand Down Expand Up @@ -227,3 +229,5 @@ public:
}
};
/// @}

}
3 changes: 3 additions & 0 deletions core/file-impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include <deque>
#include <atomic>

namespace seastar {

class posix_file_handle_impl : public seastar::file_handle_impl {
int _fd;
std::atomic<unsigned>* _refcount;
Expand Down Expand Up @@ -157,3 +159,4 @@ public:
virtual future<> allocate(uint64_t position, uint64_t length) override;
};

}
Loading

0 comments on commit ed52971

Please sign in to comment.