Commit d0ff9a53 authored by Andris Mednis's avatar Andris Mednis

Fix typos in libcaf_core

parent ef2e2fb2
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
virtual void attach(attachable_ptr ptr) = 0; virtual void attach(attachable_ptr ptr) = 0;
/// Convenience function that attaches the functor `f` to this actor. The /// Convenience function that attaches the functor `f` to this actor. The
/// actor executes `f()` on exit or immediatley if it is not running. /// actor executes `f()` on exit or immediately if it is not running.
template <class F> template <class F>
void attach_functor(F f) { void attach_functor(F f) {
attach(attachable_ptr{new detail::functor_attachable<F>(std::move(f))}); attach(attachable_ptr{new detail::functor_attachable<F>(std::move(f))});
...@@ -222,7 +222,7 @@ protected: ...@@ -222,7 +222,7 @@ protected:
mutable std::mutex mtx_; mutable std::mutex mtx_;
private: private:
// prohibit copies, assigments, and heap allocations // prohibit copies, assignments, and heap allocations
void* operator new(size_t); void* operator new(size_t);
void* operator new[](size_t); void* operator new[](size_t);
abstract_actor(const abstract_actor&) = delete; abstract_actor(const abstract_actor&) = delete;
......
...@@ -121,7 +121,7 @@ public: ...@@ -121,7 +121,7 @@ public:
friend class net::middleman; friend class net::middleman;
friend class abstract_actor; friend class abstract_actor;
/// The number of actors implictly spawned by the actor system on startup. /// The number of actors implicitly spawned by the actor system on startup.
static constexpr size_t num_internal_actors = 2; static constexpr size_t num_internal_actors = 2;
/// Returns the ID of an internal actor by its name. /// Returns the ID of an internal actor by its name.
...@@ -594,7 +594,7 @@ private: ...@@ -594,7 +594,7 @@ private:
template <class T> template <class T>
void check_invariants() { void check_invariants() {
static_assert(!std::is_base_of<prohibit_top_level_spawn_marker, T>::value, static_assert(!std::is_base_of<prohibit_top_level_spawn_marker, T>::value,
"This actor type cannot be spawned throught an actor system. " "This actor type cannot be spawned through an actor system. "
"Probably you have tried to spawn a broker or opencl actor."); "Probably you have tried to spawn a broker or opencl actor.");
} }
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
/// @pre `num_bytes <= remaining()` /// @pre `num_bytes <= remaining()`
void skip(size_t num_bytes); void skip(size_t num_bytes);
/// Assings a new input. /// Assigns a new input.
void reset(span<const byte> bytes); void reset(span<const byte> bytes);
protected: protected:
......
...@@ -409,7 +409,7 @@ public: ...@@ -409,7 +409,7 @@ public:
apply(std::chrono::duration<Rep, Period>& x) { apply(std::chrono::duration<Rep, Period>& x) {
using duration_type = std::chrono::duration<Rep, Period>; using duration_type = std::chrono::duration<Rep, Period>;
// always save/store durations as int64_t to work around possibly // always save/store durations as int64_t to work around possibly
// different integer types on different plattforms for standard typedefs // different integer types on different platforms for standard typedefs
struct { struct {
void operator()(duration_type& lhs, Rep& rhs) const { void operator()(duration_type& lhs, Rep& rhs) const {
duration_type tmp{rhs}; duration_type tmp{rhs};
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
******************************************************************************/ ******************************************************************************/
// The rationale of this header is to provide a serialization API // The rationale of this header is to provide a serialization API
// that is compatbile to boost.serialization. In particular, the // that is compatible to boost.serialization. In particular, the
// design goals are: // design goals are:
// - allow users to integrate existing boost.serialization-based code easily // - allow users to integrate existing boost.serialization-based code easily
// - allow to switch out this header with the actual boost header in boost.actor // - allow to switch out this header with the actual boost header in boost.actor
......
...@@ -120,7 +120,7 @@ public: ...@@ -120,7 +120,7 @@ public:
(*this)(const_cast<const unit_t&>(x)); (*this)(const_cast<const unit_t&>(x));
} }
// -- special-purpose handlers that don't procude results -------------------- // -- special-purpose handlers that don't produce results --------------------
/// Calls `(*this)()`. /// Calls `(*this)()`.
inline void operator()(response_promise&) { inline void operator()(response_promise&) {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
namespace caf::detail { namespace caf::detail {
/// Sets the name thread shown by the OS. Not supported on all plattforms /// Sets the name thread shown by the OS. Not supported on all platforms
/// (no-op on Windows). /// (no-op on Windows).
void set_thread_name(const char* name); void set_thread_name(const char* name);
......
...@@ -414,7 +414,7 @@ struct tl_reverse_impl<empty_type_list, E...> { ...@@ -414,7 +414,7 @@ struct tl_reverse_impl<empty_type_list, E...> {
using type = type_list<E...>; using type = type_list<E...>;
}; };
/// Creates a new list wih elements in reversed order. /// Creates a new list with elements in reversed order.
template <class List> template <class List>
struct tl_reverse { struct tl_reverse {
using type = typename tl_reverse_impl<List>::type; using type = typename tl_reverse_impl<List>::type;
...@@ -704,7 +704,7 @@ struct tl_map_conditional<empty_type_list, Trait, TraitResult, Funs...> { ...@@ -704,7 +704,7 @@ struct tl_map_conditional<empty_type_list, Trait, TraitResult, Funs...> {
// list pop_back() // list pop_back()
/// Creates a new list wih all but the last element of `List`. /// Creates a new list with all but the last element of `List`.
template <class List> template <class List>
struct tl_pop_back { struct tl_pop_back {
using type = typename tl_slice<List, 0, tl_size<List>::value - 1>::type; using type = typename tl_slice<List, 0, tl_size<List>::value - 1>::type;
......
...@@ -112,7 +112,7 @@ public: ...@@ -112,7 +112,7 @@ public:
/// Unique pointer to an outbound path. /// Unique pointer to an outbound path.
using typename super::unique_path_ptr; using typename super::unique_path_ptr;
// Lists all tempate parameters `[T, Ts...]`; // Lists all template parameters `[T, Ts...]`;
using param_list = detail::type_list<T, Ts...>; using param_list = detail::type_list<T, Ts...>;
/// State held for each slot. /// State held for each slot.
......
...@@ -151,7 +151,7 @@ public: ...@@ -151,7 +151,7 @@ public:
timestamp tstamp; timestamp tstamp;
}; };
/// Internal representation of format string entites. /// Internal representation of format string entities.
enum field_type { enum field_type {
invalid_field, invalid_field,
category_field, category_field,
...@@ -406,11 +406,11 @@ bool operator==(const logger::field& x, const logger::field& y); ...@@ -406,11 +406,11 @@ bool operator==(const logger::field& x, const logger::field& y);
// -- utility macros ----------------------------------------------------------- // -- utility macros -----------------------------------------------------------
#ifdef CAF_MSVC #ifdef CAF_MSVC
/// Expands to a string representation of the current funciton name that /// Expands to a string representation of the current function name that
/// includes the full function name and its signature. /// includes the full function name and its signature.
# define CAF_PRETTY_FUN __FUNCSIG__ # define CAF_PRETTY_FUN __FUNCSIG__
#else // CAF_MSVC #else // CAF_MSVC
/// Expands to a string representation of the current funciton name that /// Expands to a string representation of the current function name that
/// includes the full function name and its signature. /// includes the full function name and its signature.
# define CAF_PRETTY_FUN __PRETTY_FUNCTION__ # define CAF_PRETTY_FUN __PRETTY_FUNCTION__
#endif // CAF_MSVC #endif // CAF_MSVC
......
...@@ -99,7 +99,7 @@ config_option make_config_option(T& storage, string_view category, ...@@ -99,7 +99,7 @@ config_option make_config_option(T& storage, string_view category,
std::addressof(storage)}; std::addressof(storage)};
} }
// -- backward compatbility, do not use for new code ! ------------------------- // -- backward compatibility, do not use for new code ! ------------------------
// Inverts the value when writing to `storage`. // Inverts the value when writing to `storage`.
config_option make_negated_config_option(bool& storage, string_view category, config_option make_negated_config_option(bool& storage, string_view category,
......
...@@ -26,7 +26,7 @@ namespace caf { ...@@ -26,7 +26,7 @@ namespace caf {
class memory_managed { class memory_managed {
public: public:
/// Default implementations calls `delete this, but can /// Default implementations calls `delete this, but can
/// be overriden in case deletion depends on some condition or /// be overridden in case deletion depends on some condition or
/// the class doesn't use default new/delete. /// the class doesn't use default new/delete.
/// @param decremented_rc Indicates whether the caller did reduce the /// @param decremented_rc Indicates whether the caller did reduce the
/// reference of this object before calling this member /// reference of this object before calling this member
......
...@@ -322,7 +322,7 @@ struct message::cli_arg { ...@@ -322,7 +322,7 @@ struct message::cli_arg {
/// Full name of this CLI argument using format "<long name>[,<short name>]" /// Full name of this CLI argument using format "<long name>[,<short name>]"
std::string name; std::string name;
/// Desciption of this CLI argument for the auto-generated help text. /// Description of this CLI argument for the auto-generated help text.
std::string text; std::string text;
/// Auto-generated helptext for this item. /// Auto-generated helptext for this item.
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
namespace caf { namespace caf {
/// Provides a convenient interface for createing `message` objects /// Provides a convenient interface for creating `message` objects
/// from a series of values using the member function `append`. /// from a series of values using the member function `append`.
class message_builder { class message_builder {
public: public:
......
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
protected: protected:
/// Allows subclasses to add additional cleanup code to the /// Allows subclasses to add additional cleanup code to the
/// critical secion in `cleanup`. This member function is /// critical section in `cleanup`. This member function is
/// called inside of a critical section. /// called inside of a critical section.
virtual void on_cleanup(const error& reason); virtual void on_cleanup(const error& reason);
......
...@@ -59,7 +59,7 @@ enum class pec : uint8_t { ...@@ -59,7 +59,7 @@ enum class pec : uint8_t {
type_mismatch, type_mismatch,
/// Stopped at an unrecognized option name. /// Stopped at an unrecognized option name.
not_an_option, not_an_option,
/// Stopped at an unparseable argument. /// Stopped at an unparsable argument.
illegal_argument = 15, illegal_argument = 15,
/// Stopped because an argument was omitted. /// Stopped because an argument was omitted.
missing_argument, missing_argument,
......
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
template <class Worker> template <class Worker>
resumable* dequeue(Worker* self) { resumable* dequeue(Worker* self) {
// we wait for new jobs by polling our external queue: first, we // we wait for new jobs by polling our external queue: first, we
// assume an active work load on the machine and perform aggresive // assume an active work load on the machine and perform aggressive
// polling, then we relax our polling a bit and wait 50 us between // polling, then we relax our polling a bit and wait 50 us between
// dequeue attempts // dequeue attempts
auto& strategies = d(self).strategies; auto& strategies = d(self).strategies;
...@@ -153,8 +153,8 @@ public: ...@@ -153,8 +153,8 @@ public:
} }
if (strategies[k].sleep_duration.count() > 0) { if (strategies[k].sleep_duration.count() > 0) {
#ifdef CAF_MSVC #ifdef CAF_MSVC
// Windows cannot sleep less than 1000 us, so timeout is conveted to 0 // Windows cannot sleep less than 1000 us, so timeout is converted to
// inside sleep_for(), but Sleep(0) is dangerous so replace it with // 0 inside sleep_for(), but Sleep(0) is dangerous so replace it with
// yield() // yield()
if (strategies[k].sleep_duration.count() < 1000) if (strategies[k].sleep_duration.count() < 1000)
std::this_thread::yield(); std::this_thread::yield();
......
...@@ -33,7 +33,7 @@ namespace caf { ...@@ -33,7 +33,7 @@ namespace caf {
/// An event-based actor with managed state. The state is constructed /// An event-based actor with managed state. The state is constructed
/// before `make_behavior` will get called and destroyed after the /// before `make_behavior` will get called and destroyed after the
/// actor called `quit`. This state management brakes cycles and /// actor called `quit`. This state management brakes cycles and
/// allows actors to automatically release ressources as soon /// allows actors to automatically release resources as soon
/// as possible. /// as possible.
template <class State, class Base /* = event_based_actor (see fwd.hpp) */> template <class State, class Base /* = event_based_actor (see fwd.hpp) */>
class stateful_actor : public Base { class stateful_actor : public Base {
......
...@@ -31,7 +31,7 @@ namespace caf { ...@@ -31,7 +31,7 @@ namespace caf {
namespace detail { namespace detail {
// Catches `std::string`, `std::string_view` and all classes mimicing those, // Catches `std::string`, `std::string_view` and all classes mimicking those,
// but not `std::vector<char>` or other buffers. // but not `std::vector<char>` or other buffers.
template <class T> template <class T>
struct is_string_like { struct is_string_like {
...@@ -212,7 +212,7 @@ public: ...@@ -212,7 +212,7 @@ public:
void assign(const_pointer data, size_type len); void assign(const_pointer data, size_type len);
// -- algortihms ------------------------------------------------------------- // -- algorithms -------------------------------------------------------------
size_type copy(pointer dest, size_type n, size_type pos = 0) const; size_type copy(pointer dest, size_type n, size_type pos = 0) const;
......
...@@ -106,10 +106,10 @@ actor_system_config::actor_system_config() ...@@ -106,10 +106,10 @@ actor_system_config::actor_system_config()
opt_group{custom_options_, "logger"} opt_group{custom_options_, "logger"}
.add<atom_value>("verbosity", "default verbosity for file and console") .add<atom_value>("verbosity", "default verbosity for file and console")
.add<string>("file-name", "filesystem path of the log file") .add<string>("file-name", "filesystem path of the log file")
.add<string>("file-format", "line format for individual log file entires") .add<string>("file-format", "line format for individual log file entries")
.add<atom_value>("file-verbosity", "file output verbosity") .add<atom_value>("file-verbosity", "file output verbosity")
.add<atom_value>("console", "std::clog output: none, colored, or uncolored") .add<atom_value>("console", "std::clog output: none, colored, or uncolored")
.add<string>("console-format", "line format for printed log entires") .add<string>("console-format", "line format for printed log entries")
.add<atom_value>("console-verbosity", "console output verbosity") .add<atom_value>("console-verbosity", "console output verbosity")
.add<std::vector<atom_value>>("component-blacklist", .add<std::vector<atom_value>>("component-blacklist",
"excluded components for logging") "excluded components for logging")
...@@ -223,7 +223,7 @@ actor_system_config::make_help_text(const std::vector<message::cli_arg>& xs) { ...@@ -223,7 +223,7 @@ actor_system_config::make_help_text(const std::vector<message::cli_arg>& xs) {
auto op = [](size_t tmp, const message::cli_arg& arg) { auto op = [](size_t tmp, const message::cli_arg& arg) {
return std::max(tmp, arg.helptext.size()); return std::max(tmp, arg.helptext.size());
}; };
// maximum string lenght of all options // maximum string length of all options
auto name_width = std::accumulate(xs.begin(), xs.end(), size_t{0}, op); auto name_width = std::accumulate(xs.begin(), xs.end(), size_t{0}, op);
// iterators to the vector with respect to partition point // iterators to the vector with respect to partition point
auto first = xs.begin(); auto first = xs.begin();
......
...@@ -58,7 +58,7 @@ config_option_set& config_option_set::add(config_option opt) { ...@@ -58,7 +58,7 @@ config_option_set& config_option_set::add(config_option opt) {
} }
std::string config_option_set::help_text(bool global_only) const { std::string config_option_set::help_text(bool global_only) const {
//<--- argument --------> <---- desciption ----> //<--- argument --------> <---- description --->
// (-w|--write) <string> : output file // (-w|--write) <string> : output file
auto build_argument = [](const config_option& x) { auto build_argument = [](const config_option& x) {
string_builder sb; string_builder sb;
......
...@@ -409,7 +409,7 @@ void logger::render_fun_prefix(std::ostream& out, const event& x) { ...@@ -409,7 +409,7 @@ void logger::render_fun_prefix(std::ostream& out, const event& x) {
// ^~~~~~~~~~~~~ // ^~~~~~~~~~~~~
// Here, we output Java-style "my.namespace" to `out`. // Here, we output Java-style "my.namespace" to `out`.
auto reduced = x.pretty_fun; auto reduced = x.pretty_fun;
// Skip all prefixes that can preceed the return type. // Skip all prefixes that can precede the return type.
auto skip = [&](string_view str) { auto skip = [&](string_view str) {
if (starts_with(reduced, str)) { if (starts_with(reduced, str)) {
reduced.remove_prefix(str.size()); reduced.remove_prefix(str.size());
......
...@@ -363,7 +363,7 @@ message::cli_res message::extract_opts(std::vector<cli_arg> xs, ...@@ -363,7 +363,7 @@ message::cli_res message::extract_opts(std::vector<cli_arg> xs,
return skip(); return skip();
if (arg == "--") { if (arg == "--") {
skip_remainder = true; skip_remainder = true;
// drop frist remainder indicator // drop first remainder indicator
return none; return none;
} }
if (arg.empty() || arg.front() != '-') { if (arg.empty() || arg.front() != '-') {
......
...@@ -29,7 +29,7 @@ std::string replies_to_type_name(size_t input_size, ...@@ -29,7 +29,7 @@ std::string replies_to_type_name(size_t input_size,
std::string result; std::string result;
// 'void' is not an announced type, hence we check whether uniform_typeid // 'void' is not an announced type, hence we check whether uniform_typeid
// did return a valid pointer to identify 'void' (this has the // did return a valid pointer to identify 'void' (this has the
// possibility of false positives, but those will be catched anyways) // possibility of false positives, but those will be caught anyways)
result = "caf::replies_to<"; result = "caf::replies_to<";
result += join(input, input + input_size, glue); result += join(input, input + input_size, glue);
result += ">::with<"; result += ">::with<";
......
...@@ -460,7 +460,7 @@ void scheduled_actor::quit(error x) { ...@@ -460,7 +460,7 @@ void scheduled_actor::quit(error x) {
for (auto i = managers.begin(); i != e; ++i) { for (auto i = managers.begin(); i != e; ++i) {
auto& mgr = *i; auto& mgr = *i;
mgr->shutdown(); mgr->shutdown();
// Managers can become done after calling quit if they were continous. // Managers can become done after calling quit if they were continuous.
if (mgr->done()) { if (mgr->done()) {
mgr->stop(); mgr->stop();
erase_stream_manager(mgr); erase_stream_manager(mgr);
...@@ -1076,7 +1076,7 @@ void scheduled_actor::erase_stream_manager(const stream_manager_ptr& mgr) { ...@@ -1076,7 +1076,7 @@ void scheduled_actor::erase_stream_manager(const stream_manager_ptr& mgr) {
invoke_message_result invoke_message_result
scheduled_actor::handle_open_stream_msg(mailbox_element& x) { scheduled_actor::handle_open_stream_msg(mailbox_element& x) {
CAF_LOG_TRACE(CAF_ARG(x)); CAF_LOG_TRACE(CAF_ARG(x));
// Fetches a stream manger from a behavior. // Fetches a stream manager from a behavior.
struct visitor : detail::invoke_result_visitor { struct visitor : detail::invoke_result_visitor {
void operator()() override { void operator()() override {
// nop // nop
......
...@@ -83,7 +83,7 @@ void string_view::assign(const_pointer data, size_type len) { ...@@ -83,7 +83,7 @@ void string_view::assign(const_pointer data, size_type len) {
size_ = len; size_ = len;
} }
// -- algortihms --------------------------------------------------------------- // -- algorithms ---------------------------------------------------------------
string_view::size_type string_view::copy(pointer dest, size_type n, string_view::size_type string_view::copy(pointer dest, size_type n,
size_type pos) const { size_type pos) const {
......
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