Skip to content

Commit

Permalink
Rename classes in adaptor.hpp to snake_case to make them public later
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikTH committed Oct 28, 2023
1 parent c5e4724 commit b117fb1
Show file tree
Hide file tree
Showing 28 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion include/ureact/adaptor/adjacent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace detail
{

template <size_t N>
struct AdjacentClosure : AdaptorClosure
struct AdjacentClosure : adaptor_closure
{
static_assert( N >= 1 );

Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/adjacent_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace detail
{

template <size_t N>
struct AdjacentFilterAdaptor : Adaptor
struct AdjacentFilterAdaptor : adaptor
{
static_assert( N >= 1 );

Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/adjacent_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace detail
{

template <size_t N>
struct AdjacentTransformAdaptor : Adaptor
struct AdjacentTransformAdaptor : adaptor
{
static_assert( N >= 1 );

Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/changed_to.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct ChangedToAdaptor : Adaptor
struct ChangedToAdaptor : adaptor
{
template <typename V, typename S = std::decay_t<V>>
UREACT_WARN_UNUSED_RESULT constexpr auto operator()( const signal<S>& target, V&& value ) const
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/collect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace detail
{

template <template <typename...> class ContT>
struct CollectClosure : AdaptorClosure
struct CollectClosure : adaptor_closure
{
/*!
* @brief Collects received events into signal<ContT<E>>
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/enumerate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct EnumerateAdaptorClosure : AdaptorClosure
struct EnumerateAdaptorClosure : adaptor_closure
{
template <typename E>
UREACT_WARN_UNUSED_RESULT constexpr auto operator()( const events<E>& source ) const
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/flatten.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class event_flatten_node final : public event_stream_node<InnerE>
std::shared_ptr<event_stream_node<InnerE>> m_inner;
};

struct FlattenClosure : AdaptorClosure
struct FlattenClosure : adaptor_closure
{
/*!
* @brief Create a new event stream by flattening a signal
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/fold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class fold_node final : public signal_node<S>
signal_pack<Deps...> m_deps;
};

struct FoldAdaptor : Adaptor
struct FoldAdaptor : adaptor
{
/*!
* @brief Folds values from an event stream into a signal
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/hold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct HoldAdaptor : Adaptor
struct HoldAdaptor : adaptor
{
/*!
* @brief Holds the most recent event in a signal
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/join.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct JoinClosure : AdaptorClosure
struct JoinClosure : adaptor_closure
{
/*!
* @brief Emits the sequence obtained from flattening received event value
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/join_with.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct JoinWithAdaptor : Adaptor
struct JoinWithAdaptor : adaptor
{
/*!
* @brief Emits the sequence obtained from flattening received event value, with the delimiter in between elements
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/lift.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct unary_plus
};

template <typename SIn = void>
struct LiftAdaptor : Adaptor
struct LiftAdaptor : adaptor
{

/*!
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/merge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class event_merge_node final : public event_stream_node<E>
};

template <typename EIn = void>
struct MergeAdaptor : Adaptor
struct MergeAdaptor : adaptor
{
/// TODO: rewrite to something more sane. Unfortunately conditional_t doesn't work
template <typename... Sources>
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/monitor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class monitor_node final : public event_stream_node<S>
signal<S> m_target;
};

struct MonitorClosure : AdaptorClosure
struct MonitorClosure : adaptor_closure
{
/*!
* @brief Emits value changes of signal as events
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/monitor_change.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct MonitorChangeClosure : AdaptorClosure
struct MonitorChangeClosure : adaptor_closure
{
/*!
* @brief Emits pairs of value changes of signal as events
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/observe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ auto observe_events_impl(
context, subject, std::forward<InF>( func ), dep_pack );
}

struct ObserveAdaptor : Adaptor
struct ObserveAdaptor : adaptor
{
/*!
* @brief Create observer for signal
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/process.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class event_processing_node final : public event_stream_node<OutE>
};

template <typename OutE>
struct ProcessAdaptor : Adaptor
struct ProcessAdaptor : adaptor
{
/*!
* @brief Create a new event stream by batch processing events from other stream
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/pulse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct PulseAdaptor : Adaptor
struct PulseAdaptor : adaptor
{
/*!
* @brief Emits the value of a target signal when an event is received
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/reactive_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct decay_input<member_var_signal<Owner, S>>
template <typename T>
using decay_input_t = typename decay_input<T>::type;

struct ReactiveRefAdaptor : Adaptor
struct ReactiveRefAdaptor : adaptor
{
/*!
* @brief Adaptor to flatten public signal attribute of class pointed be reference
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/slice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct SliceAdaptor : Adaptor
struct SliceAdaptor : adaptor
{
/*!
* @brief Keeps given range (begin through end-1) of elements from the source stream
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/snapshot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct SnapshotAdaptor : Adaptor
struct SnapshotAdaptor : adaptor
{
/*!
* @brief Sets the signal value to the value of a target signal when an event is received
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/stride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct StrideAdaptor : Adaptor
struct StrideAdaptor : adaptor
{
/*!
* @brief Advances N elements from the source stream at a time
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/tap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class event_tap_node final : public event_stream_node<E>
observer m_observer;
};

struct TapAdaptor : Adaptor
struct TapAdaptor : adaptor
{
/*!
* @brief Create tapped copy for observed signal
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/zip.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct ZipAdaptor : Adaptor
struct ZipAdaptor : adaptor
{
/*!
* @brief Emit a tuple (e1,…,eN) for each complete set of values for sources 1...N
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/adaptor/zip_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ UREACT_BEGIN_NAMESPACE
namespace detail
{

struct ZipTransformAdaptor : Adaptor
struct ZipTransformAdaptor : adaptor
{
/*!
* @brief Emit an invoke result for func(e1,…,eN) for each complete set of values for sources 1...N
Expand Down
22 changes: 11 additions & 11 deletions include/ureact/detail/adaptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ namespace detail
{

// Forward
struct AdaptorClosure;
struct adaptor_closure;

template <typename Lhs, typename Rhs>
class Pipe;
class pipe;

/*!
* @brief Return if type is closure
*/
template <typename T>
struct is_closure : std::is_base_of<AdaptorClosure, remove_cvref_t<T>>
struct is_closure : std::is_base_of<adaptor_closure, remove_cvref_t<T>>
{};

/*!
Expand Down Expand Up @@ -59,7 +59,7 @@ inline constexpr bool is_closure_v = is_closure<T>::value;
*
* @note similar to https://en.cppreference.com/w/cpp/ranges#Range_adaptor_closure_objects
*/
struct AdaptorClosure
struct adaptor_closure
{
/// chain two closures to make another one
template <typename Lhs,
Expand All @@ -68,7 +68,7 @@ struct AdaptorClosure
class = std::enable_if_t<is_closure_v<Rhs>>>
UREACT_WARN_UNUSED_RESULT friend constexpr auto operator|( Lhs lhs, Rhs rhs )
{
return Pipe<Lhs, Rhs>{ std::move( lhs ), std::move( rhs ) };
return pipe<Lhs, Rhs>{ std::move( lhs ), std::move( rhs ) };
}

/// apply arg to given closure and return its result
Expand All @@ -85,10 +85,10 @@ struct AdaptorClosure

/// Composition of the adaptor closures Lhs and Rhs.
template <typename Lhs, typename Rhs>
class Pipe : public AdaptorClosure
class pipe : public adaptor_closure
{
public:
constexpr Pipe( Lhs lhs, Rhs rhs )
constexpr pipe( Lhs lhs, Rhs rhs )
: m_lhs( std::move( lhs ) )
, m_rhs( std::move( rhs ) )
{}
Expand All @@ -115,10 +115,10 @@ class Pipe : public AdaptorClosure

/// Partial application of the adaptor
template <typename Adaptor, typename... Args>
class Partial : public AdaptorClosure
class partial : public adaptor_closure
{
public:
constexpr explicit Partial( Args... args )
constexpr explicit partial( Args... args )
: m_args( std::move( args )... )
{}

Expand Down Expand Up @@ -154,13 +154,13 @@ class Partial : public AdaptorClosure
*
* Equivalent of "Range adaptors" from std ranges library
*/
struct Adaptor
struct adaptor
{
protected:
template <typename Derived, typename... Args>
static constexpr auto make_partial( Args&&... args )
{
return Partial<Derived, std::decay_t<Args>...>{ std::forward<Args>( args )... };
return partial<Derived, std::decay_t<Args>...>{ std::forward<Args>( args )... };
}
};

Expand Down
2 changes: 1 addition & 1 deletion include/ureact/detail/synced_adaptor_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace detail
{

template <typename Derived>
struct SyncedAdaptorBase : Adaptor
struct SyncedAdaptorBase : adaptor
{
template <typename E, typename F>
UREACT_WARN_UNUSED_RESULT constexpr auto operator()( const events<E>& source, F&& func ) const
Expand Down
2 changes: 1 addition & 1 deletion include/ureact/detail/take_drop_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class countdown
};

template <typename Derived>
struct TakeDropAdaptorBase : Adaptor
struct TakeDropAdaptorBase : adaptor
{
template <typename N, class = std::enable_if_t<std::is_integral_v<N>>>
UREACT_WARN_UNUSED_RESULT constexpr auto operator()( const N count ) const
Expand Down

0 comments on commit b117fb1

Please sign in to comment.