Commit 4e4c8732 authored by Dominik Charousset's avatar Dominik Charousset

Remove reduntant inline declarations

parent eb5a2275
......@@ -54,7 +54,7 @@ constexpr actor_id invalid_actor_id = 0;
class CAF_CORE_EXPORT abstract_actor : public abstract_channel {
public:
// allow placement new (only)
inline void* operator new(std::size_t, void* ptr) {
void* operator new(std::size_t, void* ptr) {
return ptr;
}
......@@ -140,17 +140,17 @@ public:
static constexpr int is_cleaned_up_flag = 0x1000; // monitorable_actor
static constexpr int is_shutting_down_flag = 0x2000; // scheduled_actor
inline void setf(int flag) {
void setf(int flag) {
auto x = flags();
flags(x | flag);
}
inline void unsetf(int flag) {
void unsetf(int flag) {
auto x = flags();
flags(x & ~flag);
}
inline bool getf(int flag) const {
bool getf(int flag) const {
return (flags() & flag) != 0;
}
......
......@@ -53,15 +53,15 @@ public:
static constexpr int is_hidden_flag = 0x10000000;
inline bool is_abstract_actor() const {
bool is_abstract_actor() const {
return static_cast<bool>(flags() & is_abstract_actor_flag);
}
inline bool is_abstract_group() const {
bool is_abstract_group() const {
return static_cast<bool>(flags() & is_abstract_group_flag);
}
inline bool is_actor_decorator() const {
bool is_actor_decorator() const {
return static_cast<bool>(flags() & is_actor_decorator_mask);
}
......@@ -72,11 +72,11 @@ protected:
// flags that are considered constant after an actor has launched are
// read by others, i.e., there is no acquire/release semantic between
// setting and reading flags
inline int flags() const {
int flags() const {
return flags_.load(std::memory_order_relaxed);
}
inline void flags(int new_value) {
void flags(int new_value) {
flags_.store(new_value, std::memory_order_relaxed);
}
......
......@@ -65,12 +65,12 @@ public:
// -- observers --------------------------------------------------------------
/// Returns the parent module.
inline group_module& module() const {
group_module& module() const {
return parent_;
}
/// Returns the hosting system.
inline actor_system& system() const {
actor_system& system() const {
return system_;
}
......
......@@ -91,12 +91,12 @@ public:
actor& operator=(const scoped_actor& x);
/// Queries whether this actor handle is valid.
inline explicit operator bool() const {
explicit operator bool() const {
return static_cast<bool>(ptr_);
}
/// Queries whether this actor handle is invalid.
inline bool operator!() const {
bool operator!() const {
return !ptr_;
}
......@@ -104,17 +104,17 @@ public:
actor_addr address() const noexcept;
/// Returns the ID of this actor.
inline actor_id id() const noexcept {
actor_id id() const noexcept {
return ptr_->id();
}
/// Returns the origin node of this actor.
inline node_id node() const noexcept {
node_id node() const noexcept {
return ptr_->node();
}
/// Returns the hosting actor system.
inline actor_system& home_system() const noexcept {
actor_system& home_system() const noexcept {
return *ptr_->home_system;
}
......@@ -123,7 +123,7 @@ public:
/// @cond PRIVATE
inline abstract_actor* operator->() const noexcept {
abstract_actor* operator->() const noexcept {
CAF_ASSERT(ptr_);
return ptr_->get();
}
......@@ -138,11 +138,11 @@ public:
/// @endcond
friend inline std::string to_string(const actor& x) {
friend std::string to_string(const actor& x) {
return to_string(x.ptr_);
}
friend inline void append_to_string(std::string& x, const actor& y) {
friend void append_to_string(std::string& x, const actor& y) {
return append_to_string(x, y.ptr_);
}
......@@ -158,11 +158,11 @@ public:
}
private:
inline actor_control_block* get() const noexcept {
actor_control_block* get() const noexcept {
return ptr_.get();
}
inline actor_control_block* release() noexcept {
actor_control_block* release() noexcept {
return ptr_.release();
}
......@@ -192,7 +192,7 @@ CAF_CORE_EXPORT bool operator!=(abstract_actor* lhs, const actor& rhs);
namespace std {
template <>
struct hash<caf::actor> {
inline size_t operator()(const caf::actor& ref) const {
size_t operator()(const caf::actor& ref) const noexcept {
return static_cast<size_t>(ref ? ref->id() : 0);
}
};
......
......@@ -61,24 +61,24 @@ public:
actor_addr& operator=(std::nullptr_t);
/// Returns the ID of this actor.
inline actor_id id() const noexcept {
actor_id id() const noexcept {
return ptr_->id();
}
/// Returns the origin node of this actor.
inline node_id node() const noexcept {
node_id node() const noexcept {
return ptr_->node();
}
/// Returns the hosting actor system.
inline actor_system& home_system() const noexcept {
actor_system& home_system() const noexcept {
return *ptr_->home_system;
}
/// Exchange content of `*this` and `other`.
void swap(actor_addr& other) noexcept;
inline explicit operator bool() const {
explicit operator bool() const {
return static_cast<bool>(ptr_);
}
......@@ -93,19 +93,19 @@ public:
intptr_t compare(const actor_control_block* other) const noexcept;
inline intptr_t compare(const weak_actor_ptr& other) const noexcept {
intptr_t compare(const weak_actor_ptr& other) const noexcept {
return compare(other.get());
}
inline intptr_t compare(const strong_actor_ptr& other) const noexcept {
intptr_t compare(const strong_actor_ptr& other) const noexcept {
return compare(other.get());
}
friend inline std::string to_string(const actor_addr& x) {
friend std::string to_string(const actor_addr& x) {
return to_string(x.ptr_);
}
friend inline void append_to_string(std::string& x, const actor_addr& y) {
friend void append_to_string(std::string& x, const actor_addr& y) {
return append_to_string(x, y.ptr_);
}
......@@ -122,18 +122,18 @@ public:
actor_addr(actor_control_block*, bool);
inline actor_control_block* get() const noexcept {
actor_control_block* get() const noexcept {
return ptr_.get();
}
/// @endcond
private:
inline actor_control_block* release() noexcept {
actor_control_block* release() noexcept {
return ptr_.release();
}
inline actor_control_block* get_locked() const noexcept {
actor_control_block* get_locked() const noexcept {
return ptr_.get_locked();
}
......@@ -164,7 +164,7 @@ inline bool operator!=(std::nullptr_t, const actor_addr& x) {
namespace std {
template <>
struct hash<caf::actor_addr> {
inline size_t operator()(const caf::actor_addr& ref) const {
size_t operator()(const caf::actor_addr& ref) const {
return static_cast<size_t>(ref.id());
}
};
......
......@@ -107,7 +107,7 @@ public:
"functiion pointer and regular pointers have different size");
/// Returns a pointer to the actual actor instance.
inline abstract_actor* get() {
abstract_actor* get() {
// this pointer arithmetic is compile-time checked in actor_storage's ctor
return reinterpret_cast<abstract_actor*>(reinterpret_cast<intptr_t>(this)
+ CAF_CACHE_LINE_SIZE);
......@@ -125,11 +125,11 @@ public:
actor_addr address();
inline actor_id id() const noexcept {
actor_id id() const noexcept {
return aid;
}
inline const node_id& node() const noexcept {
const node_id& node() const noexcept {
return nid;
}
......@@ -233,14 +233,14 @@ namespace std {
template <>
struct hash<caf::strong_actor_ptr> {
inline size_t operator()(const caf::strong_actor_ptr& ptr) const {
size_t operator()(const caf::strong_actor_ptr& ptr) const {
return ptr ? static_cast<size_t>(ptr->id()) : 0;
}
};
template <>
struct hash<caf::weak_actor_ptr> {
inline size_t operator()(const caf::weak_actor_ptr& ptr) const {
size_t operator()(const caf::weak_actor_ptr& ptr) const {
return ptr ? static_cast<size_t>(ptr->id()) : 0;
}
};
......
......@@ -66,12 +66,12 @@ public:
static void redirect_all(actor_system& sys, std::string fn, int flags = 0);
/// Writes `arg` to the buffer allocated for the calling actor.
inline actor_ostream& operator<<(const char* arg) {
actor_ostream& operator<<(const char* arg) {
return write(arg);
}
/// Writes `arg` to the buffer allocated for the calling actor.
inline actor_ostream& operator<<(std::string arg) {
actor_ostream& operator<<(std::string arg) {
return write(std::move(arg));
}
......@@ -79,12 +79,12 @@ public:
/// calling either `std::to_string` or `caf::to_string` depending on
/// the argument.
template <class T>
inline actor_ostream& operator<<(const T& arg) {
actor_ostream& operator<<(const T& arg) {
return write(deep_to_string(arg));
}
/// Apply `f` to `*this`.
inline actor_ostream& operator<<(actor_ostream::fun_type f) {
actor_ostream& operator<<(actor_ostream::fun_type f) {
return f(*this);
}
......
......@@ -358,7 +358,7 @@ public:
virtual mailbox_element_ptr dequeue();
/// Returns the queue for storing incoming messages.
inline mailbox_type& mailbox() {
mailbox_type& mailbox() {
return mailbox_;
}
/// @cond PRIVATE
......@@ -404,11 +404,11 @@ public:
// -- backwards compatibility ------------------------------------------------
inline mailbox_element_ptr next_message() {
mailbox_element_ptr next_message() {
return dequeue();
}
inline bool has_next_message() {
bool has_next_message() {
return !mailbox_.empty();
}
......
......@@ -28,9 +28,8 @@ class delegated {
// nop
};
template <class... Ts>
inline bool operator==(const delegated<Ts...>&, const delegated<Ts...>&) {
bool operator==(const delegated<Ts...>&, const delegated<Ts...>&) {
return true;
}
......
......@@ -68,7 +68,7 @@ template <class F, class Container>
struct container_view {
Container& x;
using value_type = typename detail::get_callable_trait<F>::result_type;
inline size_t size() const {
size_t size() const noexcept {
return x.size();
}
value_type operator[](size_t i) {
......
......@@ -48,25 +48,25 @@ public:
void clear();
inline bool empty() const {
bool empty() const {
return elements_.empty();
}
inline behavior& back() {
behavior& back() {
CAF_ASSERT(!empty());
return elements_.back();
}
inline void push_back(behavior&& what) {
void push_back(behavior&& what) {
elements_.emplace_back(std::move(what));
}
template <class... Ts>
inline void emplace_back(Ts&&... xs) {
void emplace_back(Ts&&... xs) {
elements_.emplace_back(std::forward<Ts>(xs)...);
}
inline void cleanup() {
void cleanup() {
erased_elements_.clear();
}
......
......@@ -111,7 +111,7 @@ struct make_blocking_behavior_t {
// nop
}
inline blocking_behavior operator()(behavior* x) const {
blocking_behavior operator()(behavior* x) const {
CAF_ASSERT(x != nullptr);
return {*x};
}
......
......@@ -27,7 +27,7 @@ namespace caf::detail {
template <class To, bool LargeUnsigned = sizeof(To) >= sizeof(int64_t)
&& std::is_unsigned<To>::value>
struct bounds_checker {
static inline bool check(int64_t x) {
static constexpr bool check(int64_t x) noexcept {
return x >= std::numeric_limits<To>::min()
&& x <= std::numeric_limits<To>::max();
}
......@@ -35,7 +35,7 @@ struct bounds_checker {
template <class To>
struct bounds_checker<To, true> {
static inline bool check(int64_t x) {
static constexpr bool check(int64_t x) noexcept {
return x >= 0;
}
};
......
......@@ -26,7 +26,7 @@ namespace caf::detail {
class disposer {
public:
inline void operator()(memory_managed* ptr) const noexcept {
void operator()(memory_managed* ptr) const noexcept {
ptr->request_deletion(false);
}
......
......@@ -53,7 +53,7 @@ public:
value_impl(config_value{std::forward<T>(x)});
}
inline abstract_ini_consumer* parent() {
abstract_ini_consumer* parent() {
return parent_;
}
......
......@@ -53,14 +53,14 @@ inline uint64_t to_network_order(uint64_t value) {
#else
template <class T>
inline T to_network_order(T value) {
T to_network_order(T value) {
return value;
}
#endif
template <class T>
inline T from_network_order(T value) {
T from_network_order(T value) {
// swapping the bytes again gives the native order
return to_network_order(value);
}
......
......@@ -67,25 +67,25 @@ public:
using opt_msg = optional<message>;
inline opt_msg operator()(const none_t&) const {
opt_msg operator()(const none_t&) const {
return none;
}
inline opt_msg operator()(const skip_t&) const {
opt_msg operator()(const skip_t&) const {
return none;
}
inline opt_msg operator()(const unit_t&) const {
opt_msg operator()(const unit_t&) const {
return message{};
}
inline opt_msg operator()(optional<skip_t>& val) const {
opt_msg operator()(optional<skip_t>& val) const {
if (val)
return none;
return message{};
}
inline opt_msg operator()(opt_msg& msg) {
opt_msg operator()(opt_msg& msg) {
return msg;
}
......
......@@ -29,15 +29,15 @@ struct any_char_t {};
constexpr any_char_t any_char = any_char_t{};
constexpr bool in_whitelist(any_char_t, char) {
constexpr bool in_whitelist(any_char_t, char) noexcept {
return true;
}
constexpr bool in_whitelist(char whitelist, char ch) {
constexpr bool in_whitelist(char whitelist, char ch) noexcept {
return whitelist == ch;
}
inline bool in_whitelist(const char* whitelist, char ch) {
inline bool in_whitelist(const char* whitelist, char ch) noexcept {
// Note: using strchr breaks if `ch == '\0'`.
for (char c = *whitelist++; c != '\0'; c = *whitelist++)
if (c == ch)
......@@ -45,7 +45,7 @@ inline bool in_whitelist(const char* whitelist, char ch) {
return false;
}
inline bool in_whitelist(bool (*filter)(char), char ch) {
inline bool in_whitelist(bool (*filter)(char), char ch) noexcept {
return filter(ch);
}
......
......@@ -22,27 +22,18 @@ namespace caf::detail::parser {
/// Returns whether `c` is a valid digit for a given base.
template <int Base>
bool is_digit(char c);
template <>
inline bool is_digit<2>(char c) {
return c == '0' || c == '1';
}
template <>
inline bool is_digit<8>(char c) {
return c >= '0' && c <= '7';
}
template <>
inline bool is_digit<10>(char c) {
return c >= '0' && c <= '9';
}
template <>
inline bool is_digit<16>(char c) {
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')
|| (c >= 'a' && c <= 'f');
constexpr bool is_digit(char c) noexcept {
if constexpr (Base == 2) {
return c == '0' || c == '1';
} else if constexpr (Base == 8) {
return c >= '0' && c <= '7';
} else if constexpr (Base == 10) {
return c >= '0' && c <= '9';
} else {
static_assert(Base == 16);
return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')
|| (c >= 'a' && c <= 'f');
}
}
} // namespace caf::detail::parser
......@@ -153,7 +153,7 @@ template <class F>
struct read_ipv6_address_piece_consumer {
F callback;
inline void value(uint16_t x) {
void value(uint16_t x) {
union {
uint16_t bits;
std::array<uint8_t, 2> bytes;
......@@ -162,7 +162,7 @@ struct read_ipv6_address_piece_consumer {
callback(val.bytes.data(), val.bytes.size());
}
inline void value(uint8_t x) {
void value(uint8_t x) {
callback(&x, 1);
}
};
......
......@@ -66,7 +66,7 @@ void read_uri_percent_encoded(State& ps, std::string& str) {
// clang-format on
}
inline bool uri_unprotected_char(char c) {
inline bool uri_unprotected_char(char c) noexcept {
// Consider valid characters not explicitly stated as reserved as unreserved.
return isprint(c) && !in_whitelist(":/?#[]@!$&'()*+,;=<>", c);
}
......
......@@ -45,15 +45,15 @@ struct pseudo_tuple {
data[i] = const_cast<void*>(xs.get(i));
}
inline const_pointer at(size_t p) const {
const_pointer at(size_t p) const {
return data[p];
}
inline pointer get_mutable(size_t p) {
pointer get_mutable(size_t p) {
return data[p];
}
inline pointer& operator[](size_t p) {
pointer& operator[](size_t p) {
return data[p];
}
};
......
......@@ -45,7 +45,7 @@ public:
/// Disables this guard, i.e., the guard does not
/// run its cleanup code as it goes out of scope.
inline void disable() {
void disable() noexcept {
enabled_ = false;
}
......
......@@ -77,7 +77,7 @@ private:
};
struct nop_split {
inline void operator()(actor_msg_vec& xs, message& y) const {
void operator()(actor_msg_vec& xs, message& y) const {
for (auto& x : xs) {
x.second = y;
}
......
......@@ -67,11 +67,11 @@ public:
// -- Accessors --------------------------------------------------------------
inline Policy& policy() {
Policy& policy() {
return policy_;
}
inline const Policy& policy() const {
const Policy& policy() const {
return policy_;
}
......
......@@ -62,7 +62,7 @@ public:
void interval(duration_type x);
/// Returns the time interval per tick.
inline duration_type interval() const {
duration_type interval() const {
return interval_;
}
......
......@@ -27,11 +27,11 @@
#define CAF_VARIANT_DATA_CONCAT(x, y) x##y
#define CAF_VARIANT_DATA_GETTER(pos) \
inline CAF_VARIANT_DATA_CONCAT(T, pos) \
& get(std::integral_constant<int, pos>) { \
CAF_VARIANT_DATA_CONCAT(T, pos) \
&get(std::integral_constant<int, pos>) { \
return CAF_VARIANT_DATA_CONCAT(v, pos); \
} \
inline const CAF_VARIANT_DATA_CONCAT(T, pos) \
const CAF_VARIANT_DATA_CONCAT(T, pos) \
& get(std::integral_constant<int, pos>) const { \
return CAF_VARIANT_DATA_CONCAT(v, pos); \
}
......
......@@ -69,15 +69,15 @@ public:
using iterator_bool_pair = std::pair<iterator, bool>;
struct mapped_type_less {
inline bool operator()(const value_type& x, string_view y) const {
bool operator()(const value_type& x, string_view y) const {
return x.first < y;
}
inline bool operator()(const value_type& x, const value_type& y) const {
bool operator()(const value_type& x, const value_type& y) const {
return x.first < y.first;
}
inline bool operator()(string_view x, const value_type& y) const {
bool operator()(string_view x, const value_type& y) const {
return x < y.first;
}
};
......@@ -313,17 +313,17 @@ private:
}
template <size_t N>
static inline std::string copy(const char (&str)[N]) {
static std::string copy(const char (&str)[N]) {
return std::string{str};
}
// Copies the content of `str` into a new string.
static inline std::string copy(string_view str) {
static std::string copy(string_view str) {
return std::string{str.begin(), str.end()};
}
// Moves the content of `str` into a new string.
static inline std::string copy(std::string str) {
static std::string copy(std::string str) {
return str;
}
......
......@@ -163,7 +163,7 @@ public:
virtual void abort(error reason);
/// Returns `num_paths() == 0`.
inline bool empty() const noexcept {
bool empty() const noexcept {
return num_paths() == 0;
}
......
......@@ -48,11 +48,11 @@ public:
// -- properties -------------------------------------------------------------
inline const map_type& paths() const {
const map_type& paths() const {
return paths_;
}
inline map_type& paths() {
map_type& paths() {
return paths_;
}
......
......@@ -132,12 +132,12 @@ public:
const message& context() const noexcept;
/// Returns `*this != none`.
inline explicit operator bool() const noexcept {
explicit operator bool() const noexcept {
return data_ != nullptr;
}
/// Returns `*this == none`.
inline bool operator!() const noexcept {
bool operator!() const noexcept {
return data_ == nullptr;
}
......@@ -158,7 +158,7 @@ public:
/// @cond PRIVATE
static inline error eval() {
static error eval() {
return none;
}
......
......@@ -63,7 +63,7 @@ private:
};
struct downstream_manager_selector {
inline downstream_manager* operator()(const message&) {
downstream_manager* operator()(const message&) {
return nullptr;
}
......
......@@ -61,12 +61,12 @@ public:
// -- observers --------------------------------------------------------------
/// Returns the hosting actor system.
inline actor_system& system() const {
actor_system& system() const {
return system_;
}
/// Returns the name of this module implementation.
inline const std::string& name() const {
const std::string& name() const {
return name_;
}
......
......@@ -65,33 +65,33 @@ public:
/// Returns the bits of the IP address in a single integer arranged in network
/// byte order.
inline uint32_t bits() const noexcept {
uint32_t bits() const noexcept {
return bits_;
}
/// Sets all bits of the IP address with a single 32-bit write. Expects
/// argument in network byte order.
inline void bits(uint32_t value) noexcept {
void bits(uint32_t value) noexcept {
bits_ = value;
}
/// Returns the bytes of the IP address as array.
inline array_type& bytes() noexcept {
array_type& bytes() noexcept {
return bytes_;
}
/// Returns the bytes of the IP address as array.
inline const array_type& bytes() const noexcept {
const array_type& bytes() const noexcept {
return bytes_;
}
/// Alias for `bytes()`.
inline array_type& data() noexcept {
array_type& data() noexcept {
return bytes_;
}
/// Alias for `bytes()`.
inline const array_type& data() const noexcept {
const array_type& data() const noexcept {
return bytes_;
}
......
......@@ -41,12 +41,12 @@ public:
// -- properties -------------------------------------------------------------
/// Returns the network address for this subnet.
inline const ipv4_address& network_address() const noexcept {
const ipv4_address& network_address() const noexcept {
return address_;
}
/// Returns the prefix length of the netmask in bits.
inline uint8_t prefix_length() const noexcept {
uint8_t prefix_length() const noexcept {
return prefix_length_;
}
......
......@@ -89,27 +89,27 @@ public:
bool is_loopback() const noexcept;
/// Returns the bytes of the IP address as array.
inline array_type& bytes() noexcept {
array_type& bytes() noexcept {
return bytes_;
}
/// Returns the bytes of the IP address as array.
inline const array_type& bytes() const noexcept {
const array_type& bytes() const noexcept {
return bytes_;
}
/// Alias for `bytes()`.
inline array_type& data() noexcept {
array_type& data() noexcept {
return bytes_;
}
/// Alias for `bytes()`.
inline const array_type& data() const noexcept {
const array_type& data() const noexcept {
return bytes_;
}
/// Returns whether this address contains only zeros, i.e., equals `::`.
inline bool zero() const noexcept {
bool zero() const noexcept {
return half_segments_[0] == 0 && half_segments_[1] == 0;
}
......
......@@ -62,12 +62,12 @@ public:
ipv4_subnet embedded_v4() const noexcept;
/// Returns the network address for this subnet.
inline const ipv6_address& network_address() const noexcept {
const ipv6_address& network_address() const noexcept {
return address_;
}
/// Returns the prefix length of the netmask.
inline uint8_t prefix_length() const noexcept {
uint8_t prefix_length() const noexcept {
return prefix_length_;
}
......
......@@ -28,7 +28,7 @@ struct no_stages_t {
// nop
}
inline operator mailbox_element::forwarding_stack() const {
operator mailbox_element::forwarding_stack() const {
return {};
}
};
......
......@@ -113,7 +113,7 @@ public:
// -- required functions for drr_queue ---------------------------------------
static inline task_size_type task_size(const mailbox_element&) noexcept {
static task_size_type task_size(const mailbox_element&) noexcept {
return 1;
}
};
......
......@@ -54,7 +54,7 @@ public:
// -- interface required by drr_queue ----------------------------------------
static inline task_size_type task_size(const mailbox_element&) noexcept {
static task_size_type task_size(const mailbox_element&) noexcept {
return 1;
}
};
......
......@@ -53,7 +53,7 @@ public:
// -- interface required by drr_queue ----------------------------------------
static inline task_size_type task_size(const mailbox_element&) noexcept {
static task_size_type task_size(const mailbox_element&) noexcept {
return 1;
}
};
......
......@@ -54,7 +54,7 @@ public:
// -- interface required by drr_queue ----------------------------------------
static inline task_size_type task_size(const mailbox_element&) noexcept {
static task_size_type task_size(const mailbox_element&) noexcept {
return 1;
}
};
......
......@@ -39,7 +39,7 @@ public:
~work_sharing() override;
struct coordinator_data {
inline explicit coordinator_data(scheduler::abstract_coordinator*) {
explicit coordinator_data(scheduler::abstract_coordinator*) {
// nop
}
......@@ -49,7 +49,7 @@ public:
};
struct worker_data {
inline explicit worker_data(scheduler::abstract_coordinator*) {
explicit worker_data(scheduler::abstract_coordinator*) {
// nop
}
};
......
......@@ -62,7 +62,7 @@ public:
// The coordinator has only a counter for round-robin enqueue to its workers.
struct coordinator_data {
inline explicit coordinator_data(scheduler::abstract_coordinator*)
explicit coordinator_data(scheduler::abstract_coordinator*)
: next_worker(0) {
// nop
}
......
......@@ -39,7 +39,7 @@ public:
ref_counted& operator=(const ref_counted&);
/// Increases reference count by one.
inline void ref() const noexcept {
void ref() const noexcept {
rc_.fetch_add(1, std::memory_order_relaxed);
}
......@@ -48,11 +48,11 @@ public:
void deref() const noexcept;
/// Queries whether there is exactly one reference.
inline bool unique() const noexcept {
bool unique() const noexcept {
return rc_ == 1;
}
inline size_t get_reference_count() const noexcept {
size_t get_reference_count() const noexcept {
return rc_;
}
......
......@@ -299,24 +299,24 @@ public:
// -- properties -------------------------------------------------------------
/// Returns the queue for storing incoming messages.
inline mailbox_type& mailbox() noexcept {
mailbox_type& mailbox() noexcept {
return mailbox_;
}
/// Returns map for all active streams.
inline stream_manager_map& stream_managers() noexcept {
stream_manager_map& stream_managers() noexcept {
return stream_managers_;
}
/// Returns map for all pending streams.
inline stream_manager_map& pending_stream_managers() noexcept {
stream_manager_map& pending_stream_managers() noexcept {
return pending_stream_managers_;
}
// -- event handlers ---------------------------------------------------------
/// Sets a custom handler for unexpected messages.
inline void set_default_handler(default_handler fun) {
void set_default_handler(default_handler fun) {
if (fun)
default_handler_ = std::move(fun);
else
......@@ -332,7 +332,7 @@ public:
}
/// Sets a custom handler for error messages.
inline void set_error_handler(error_handler fun) {
void set_error_handler(error_handler fun) {
if (fun)
error_handler_ = std::move(fun);
else
......@@ -346,7 +346,7 @@ public:
}
/// Sets a custom handler for down messages.
inline void set_down_handler(down_handler fun) {
void set_down_handler(down_handler fun) {
if (fun)
down_handler_ = std::move(fun);
else
......@@ -376,7 +376,7 @@ public:
}
/// Sets a custom handler for error messages.
inline void set_exit_handler(exit_handler fun) {
void set_exit_handler(exit_handler fun) {
if (fun)
exit_handler_ = std::move(fun);
else
......@@ -392,7 +392,7 @@ public:
#ifdef CAF_ENABLE_EXCEPTIONS
/// Sets a custom exception handler for this actor. If multiple handlers are
/// defined, only the functor that was added *last* is being executed.
inline void set_exception_handler(exception_handler fun) {
void set_exception_handler(exception_handler fun) {
if (fun)
exception_handler_ = std::move(fun);
else
......@@ -461,11 +461,11 @@ public:
// -- behavior management ----------------------------------------------------
/// Returns `true` if the behavior stack is not empty.
inline bool has_behavior() const noexcept {
bool has_behavior() const noexcept {
return !bhvr_stack_.empty();
}
inline behavior& current_behavior() {
behavior& current_behavior() {
return !awaited_responses_.empty() ? awaited_responses_.front().second
: bhvr_stack_.back();
}
......@@ -479,7 +479,7 @@ public:
bool finalize();
/// Returns the behavior stack.
inline detail::behavior_stack& bhvr_stack() {
detail::behavior_stack& bhvr_stack() {
return bhvr_stack_;
}
......@@ -643,7 +643,7 @@ public:
/// Returns `true` if the actor has a behavior, awaits responses, or
/// participates in streams.
/// @private
inline bool alive() const noexcept {
bool alive() const noexcept {
return !bhvr_stack_.empty() || !awaited_responses_.empty()
|| !multiplexed_responses_.empty() || !stream_managers_.empty()
|| !pending_stream_managers_.empty();
......
......@@ -44,29 +44,29 @@ public:
explicit abstract_coordinator(actor_system& sys);
/// Returns a handle to the central printing actor.
inline actor printer() const {
actor printer() const {
return actor_cast<actor>(utility_actors_[printer_id]);
}
/// Returns the number of utility actors.
inline size_t num_utility_actors() const {
size_t num_utility_actors() const {
return utility_actors_.size();
}
/// Puts `what` into the queue of a randomly chosen worker.
virtual void enqueue(resumable* what) = 0;
inline actor_system& system() {
actor_system& system() {
return system_;
}
const actor_system_config& config() const;
inline size_t max_throughput() const {
size_t max_throughput() const {
return max_throughput_;
}
inline size_t num_workers() const {
size_t num_workers() const {
return num_workers_;
}
......
......@@ -47,7 +47,7 @@ public:
std::deque<resumable*> jobs;
/// Returns whether at least one job is in the queue.
inline bool has_job() const {
bool has_job() const {
return !jobs.empty();
}
......
......@@ -50,30 +50,30 @@ public:
~scoped_actor();
inline explicit operator bool() const {
explicit operator bool() const {
return static_cast<bool>(self_);
}
inline actor_system& home_system() const {
actor_system& home_system() const {
return *self_->home_system;
}
inline blocking_actor* operator->() const {
blocking_actor* operator->() const {
return ptr();
}
inline blocking_actor& operator*() const {
blocking_actor& operator*() const {
return *ptr();
}
inline actor_addr address() const {
actor_addr address() const {
return ptr()->address();
}
blocking_actor* ptr() const;
private:
inline actor_control_block* get() const {
actor_control_block* get() const {
return self_.get();
}
......
......@@ -55,7 +55,7 @@ struct stream_slots : detail::comparable<stream_slots> {
return {receiver, sender};
}
inline long compare(stream_slots other) const noexcept {
long compare(stream_slots other) const noexcept {
static_assert(sizeof(long) >= sizeof(int32_t),
"sizeof(long) < sizeof(int32_t)");
long x = (sender << 16) | receiver;
......
......@@ -34,7 +34,7 @@ namespace caf {
// provide boost::split compatible interface
inline string_view is_any_of(string_view arg) {
constexpr string_view is_any_of(string_view arg) noexcept {
return arg;
}
......
......@@ -77,12 +77,12 @@ public:
// -- convenience functions --------------------------------------------------
/// Returns the type number for the stored value.
inline uint16_t type_nr() const {
uint16_t type_nr() const {
return type().first;
}
/// Checks whether the type of the stored value matches `rtti`.
inline bool matches(const rtti_pair& rtti) const {
bool matches(const rtti_pair& rtti) const {
return matches(rtti.first, rtti.second);
}
......
......@@ -157,18 +157,18 @@ public:
return *this;
}
inline typed_actor& operator=(std::nullptr_t) {
typed_actor& operator=(std::nullptr_t) {
ptr_.reset();
return *this;
}
/// Queries whether this actor handle is valid.
inline explicit operator bool() const {
explicit operator bool() const {
return static_cast<bool>(ptr_);
}
/// Queries whether this actor handle is invalid.
inline bool operator!() const {
bool operator!() const {
return !ptr_;
}
......@@ -188,7 +188,7 @@ public:
}
/// Returns the hosting actor system.
inline actor_system& home_system() const noexcept {
actor_system& home_system() const noexcept {
return *ptr_->home_system;
}
......@@ -227,11 +227,11 @@ public:
// nop
}
friend inline std::string to_string(const typed_actor& x) {
friend std::string to_string(const typed_actor& x) {
return to_string(x.ptr_);
}
friend inline void append_to_string(std::string& x, const typed_actor& y) {
friend void append_to_string(std::string& x, const typed_actor& y) {
return append_to_string(x, y.ptr_);
}
......
......@@ -33,8 +33,8 @@ public:
/// Constructs an invalid response promise.
typed_response_promise() = default;
inline typed_response_promise(strong_actor_ptr self, mailbox_element& src)
: promise_(std::move(self), src) {
typed_response_promise(strong_actor_ptr self, mailbox_element& src)
: promise_(std::move(self), src) {
// nop
}
......@@ -44,16 +44,15 @@ public:
typed_response_promise& operator=(const typed_response_promise&) = default;
/// Implicitly convertible to untyped response promise.
inline operator response_promise& () {
operator response_promise&() {
return promise_;
}
/// Satisfies the promise by sending a non-error response message.
template <class U, class... Us>
typename std::enable_if<
(sizeof...(Us) > 0) || !std::is_convertible<U, error>::value,
typed_response_promise
>::type
typename std::enable_if<(sizeof...(Us) > 0)
|| !std::is_convertible<U, error>::value,
typed_response_promise>::type
deliver(U&& x, Us&&... xs) {
static_assert(
std::is_same<detail::type_list<Ts...>,
......@@ -64,8 +63,8 @@ public:
return *this;
}
template <message_priority P = message_priority::normal,
class Handle = actor, class... Us>
template <message_priority P = message_priority::normal, class Handle = actor,
class... Us>
typed_response_promise delegate(const Handle& dest, Us&&... xs) {
promise_.template delegate<P>(dest, std::forward<Us>(xs)...);
return *this;
......@@ -73,13 +72,13 @@ public:
/// Satisfies the promise by sending an error response message.
/// For non-requests, nothing is done.
inline typed_response_promise deliver(error x) {
typed_response_promise deliver(error x) {
promise_.deliver(std::move(x));
return *this;
}
/// Queries whether this promise is a valid promise that is not satisfied yet.
inline bool pending() const {
bool pending() const {
return promise_.pending();
}
......@@ -88,4 +87,3 @@ private:
};
} // namespace caf
......@@ -52,7 +52,7 @@ public:
host_type host;
uint16_t port;
inline authority_type() : port(0) {
authority_type() : port(0) {
// nop
}
......
......@@ -214,11 +214,11 @@ public:
/// @cond PRIVATE
inline variant& get_data() {
variant& get_data() {
return *this;
}
inline const variant& get_data() const {
const variant& get_data() const {
return *this;
}
......@@ -300,7 +300,7 @@ public:
/// @endcond
private:
inline void destroy_data() {
void destroy_data() {
if (type_ == variant_npos) return; // nothing to do
detail::variant_data_destructor f;
apply<void>(f);
......
......@@ -177,7 +177,7 @@ public:
void flush(datagram_handle hdl);
/// Returns the middleman instance this broker belongs to.
inline middleman& parent() {
middleman& parent() {
return system().middleman();
}
......@@ -349,7 +349,7 @@ public:
// -- observers --------------------------------------------------------------
/// Returns the number of open connections.
inline size_t num_connections() const {
size_t num_connections() const {
return scribes_.size();
}
......@@ -374,16 +374,16 @@ protected:
/// @cond PRIVATE
// meta programming utility
inline doorman_map& get_map(accept_handle) {
doorman_map& get_map(accept_handle) {
return doormen_;
}
// meta programming utility
inline scribe_map& get_map(connection_handle) {
scribe_map& get_map(connection_handle) {
return scribes_;
}
inline datagram_servant_map& get_map(datagram_handle) {
datagram_servant_map& get_map(datagram_handle) {
return datagram_servants_;
}
/// @endcond
......@@ -399,7 +399,7 @@ protected:
}
private:
inline void launch_servant(scribe_ptr&) {
void launch_servant(scribe_ptr&) {
// nop
}
......
......@@ -59,7 +59,7 @@ public:
}
private:
inline accept_handle(int64_t handle_id) : super(handle_id) {
accept_handle(int64_t handle_id) : super(handle_id) {
// nop
}
};
......
......@@ -53,7 +53,7 @@ enum connection_state {
/// Returns whether the connection state requries a shutdown of the socket
/// connection.
inline bool requires_shutdown(connection_state x) {
constexpr bool requires_shutdown(connection_state x) noexcept {
// Any enum value other than await_header (0) and await_payload (1) signal the
// BASP broker to shutdown the connection.
return static_cast<int>(x) > 1;
......@@ -61,7 +61,7 @@ inline bool requires_shutdown(connection_state x) {
/// Converts the connection state to a system error code if it holds one of the
/// overlapping values. Otherwise returns `sec::none`.
inline sec to_sec(connection_state x) {
inline sec to_sec(connection_state x) noexcept {
switch (x) {
default:
return sec::none;
......
......@@ -64,7 +64,7 @@ public:
this->add_to_loop();
}
inline optional<size_t> activity_tokens() const {
optional<size_t> activity_tokens() const {
return activity_tokens_;
}
......
......@@ -30,8 +30,8 @@ namespace caf::io {
/// Tries to connect to given node.
/// @experimental
inline expected<node_id>
connect(actor_system& sys, std::string host, uint16_t port) {
inline expected<node_id> connect(actor_system& sys, std::string host,
uint16_t port) {
return sys.middleman().connect(std::move(host), port);
}
......
......@@ -60,7 +60,7 @@ public:
}
private:
inline connection_handle(int64_t handle_id) : super(handle_id) {
connection_handle(int64_t handle_id) : super(handle_id) {
// nop
}
};
......
......@@ -60,7 +60,7 @@ public:
}
private:
inline datagram_handle(int64_t handle_id) : super{handle_id} {
datagram_handle(int64_t handle_id) : super{handle_id} {
// nop
}
};
......
......@@ -115,12 +115,12 @@ public:
const std::string& host, uint16_t port);
/// Returns the enclosing actor system.
inline actor_system& system() {
actor_system& system() {
return system_;
}
/// Returns the systemw-wide configuration.
inline const actor_system_config& config() const {
const actor_system_config& config() const {
return system_.config();
}
......
......@@ -42,7 +42,7 @@ public:
/// Returns the accepted socket. This member function should
/// be called only from the `new_connection` callback.
inline native_socket& accepted_socket() {
native_socket& accepted_socket() {
return sock_;
}
......
......@@ -102,13 +102,13 @@ public:
};
struct event_less {
inline bool operator()(native_socket lhs, const event& rhs) const {
bool operator()(native_socket lhs, const event& rhs) const noexcept {
return lhs < rhs.fd;
}
inline bool operator()(const event& lhs, native_socket rhs) const {
bool operator()(const event& lhs, native_socket rhs) const noexcept {
return lhs.fd < rhs;
}
inline bool operator()(const event& lhs, const event& rhs) const {
bool operator()(const event& lhs, const event& rhs) const noexcept {
return lhs.fd < rhs.fd;
}
};
......
......@@ -45,7 +45,7 @@ public:
abstract_broker* parent();
/// Returns `true` if this manager has a parent, `false` otherwise.
inline bool detached() const {
bool detached() const {
return !parent_;
}
......
......@@ -154,11 +154,11 @@ public:
/// compiled using the default backend.
virtual multiplexer_backend* pimpl();
inline const std::thread::id& thread_id() const {
const std::thread::id& thread_id() const {
return tid_;
}
inline void thread_id(std::thread::id tid) {
void thread_id(std::thread::id tid) {
tid_ = std::move(tid);
}
......
......@@ -64,28 +64,28 @@ public:
receive_buffer& operator=(const receive_buffer& other);
/// Returns a pointer to the underlying buffer.
inline pointer data() noexcept {
pointer data() noexcept {
return buffer_.get();
}
/// Returns a const pointer to the data.
inline const_pointer data() const noexcept {
const_pointer data() const noexcept {
return buffer_.get();
}
/// Returns the number of stored elements.
inline size_type size() const noexcept {
size_type size() const noexcept {
return size_;
}
/// Returns the number of elements that the container has allocated space for.
inline size_type capacity() const noexcept {
size_type capacity() const noexcept {
return capacity_;
}
/// Returns the maximum possible number of elements the container
/// could theoretically hold.
inline size_type max_size() const noexcept {
size_type max_size() const noexcept {
return std::numeric_limits<size_t>::max();
}
......@@ -102,7 +102,7 @@ public:
void shrink_to_fit();
/// Check if the container is empty.
inline bool empty() const noexcept {
bool empty() const noexcept {
return size_ == 0;
}
......@@ -113,62 +113,62 @@ public:
void swap(receive_buffer& other) noexcept;
/// Returns an iterator to the beginning.
inline iterator begin() noexcept {
iterator begin() noexcept {
return buffer_.get();
}
/// Returns an iterator to the end.
inline iterator end() noexcept {
iterator end() noexcept {
return buffer_.get() + size_;
}
/// Returns an iterator to the beginning.
inline const_iterator begin() const noexcept {
const_iterator begin() const noexcept {
return buffer_.get();
}
/// Returns an iterator to the end.
inline const_iterator end() const noexcept {
const_iterator end() const noexcept {
return buffer_.get() + size_;
}
/// Returns an iterator to the beginning.
inline const_iterator cbegin() const noexcept {
const_iterator cbegin() const noexcept {
return buffer_.get();
}
/// Returns an iterator to the end.
inline const_iterator cend() const noexcept {
const_iterator cend() const noexcept {
return buffer_.get() + size_;
}
/// Returns jan iterator to the reverse beginning.
inline reverse_iterator rbegin() noexcept {
reverse_iterator rbegin() noexcept {
return reverse_iterator{buffer_.get() + size_};
}
/// Returns an iterator to the reverse end of the data.
inline reverse_iterator rend() noexcept {
reverse_iterator rend() noexcept {
return reverse_iterator{buffer_.get()};
}
/// Returns an iterator to the reverse beginning.
inline const_reverse_iterator rbegin() const noexcept {
const_reverse_iterator rbegin() const noexcept {
return const_reverse_iterator{buffer_.get() + size_};
}
/// Returns an iterator to the reverse end of the data.
inline const_reverse_iterator rend() const noexcept {
const_reverse_iterator rend() const noexcept {
return const_reverse_iterator{buffer_.get()};
}
/// Returns an iterator to the reverse beginning.
inline const_reverse_iterator crbegin() const noexcept {
const_reverse_iterator crbegin() const noexcept {
return const_reverse_iterator{buffer_.get() + size_};
}
/// Returns an iterator to the reverse end of the data.
inline const_reverse_iterator crend() const noexcept {
const_reverse_iterator crend() const noexcept {
return const_reverse_iterator{buffer_.get()};
}
......
......@@ -59,14 +59,14 @@ public:
/// Returns the write buffer of this stream.
/// @warning Must not be modified outside the IO multiplexers event loop
/// once the stream has been started.
inline byte_buffer& wr_buf() {
byte_buffer& wr_buf() {
return wr_offline_buf_;
}
/// Returns the read buffer of this stream.
/// @warning Must not be modified outside the IO multiplexers event loop
/// once the stream has been started.
inline byte_buffer& rd_buf() {
byte_buffer& rd_buf() {
return rd_buf_;
}
......
......@@ -262,22 +262,22 @@ public:
void flush_runnables();
/// Executes the next `num` enqueued runnables immediately.
inline void inline_next_runnables(size_t num) {
void inline_next_runnables(size_t num) {
inline_runnables_ += num;
}
/// Executes the next enqueued runnable immediately.
inline void inline_next_runnable() {
void inline_next_runnable() {
inline_next_runnables(1);
}
/// Resets the counter for the next inlined runnables.
inline void reset_inlining() {
void reset_inlining() {
inline_runnables_ = 0;
}
/// Installs a callback that is triggered on the next inlined runnable.
inline void after_next_inlined_runnable(std::function<void()> f) {
void after_next_inlined_runnable(std::function<void()> f) {
inline_runnable_callback_ = std::move(f);
}
......
......@@ -44,17 +44,17 @@ public:
void* subtype_ptr() override;
/// Returns an SSL-aware implementation of the middleman actor interface.
inline const io::middleman_actor& actor_handle() const {
const io::middleman_actor& actor_handle() const {
return manager_;
}
/// Returns the enclosing actor system.
inline actor_system& system() {
actor_system& system() {
return system_;
}
/// Returns the system-wide configuration.
inline const actor_system_config& config() const {
const actor_system_config& config() const {
return system_.config();
}
......
......@@ -241,15 +241,15 @@ public:
const std::string& name() const;
inline size_t good() {
size_t good() {
return good_;
}
inline size_t bad() {
size_t bad() {
return bad_;
}
inline bool disabled() const noexcept {
bool disabled() const noexcept {
return disabled_;
}
......@@ -325,7 +325,7 @@ public:
file_ << y;
}
inline void log(level lvl, const std::nullptr_t&) {
void log(level lvl, const std::nullptr_t&) {
log(lvl, "null");
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment