// Copyright Sebastian Jeckel 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef REACT_DETAIL_EVENTBASE_H_INCLUDED
#define REACT_DETAIL_EVENTBASE_H_INCLUDED
#pragma once
#include "react/detail/Defs.h"
#include
#include "react/detail/ReactiveBase.h"
#include "react/detail/ReactiveInput.h"
#include "react/detail/graph/EventNodes.h"
/***************************************/ REACT_IMPL_BEGIN /**************************************/
///////////////////////////////////////////////////////////////////////////////////////////////////
/// EventStreamBase
///////////////////////////////////////////////////////////////////////////////////////////////////
template
<
typename D,
typename E
>
class EventStreamBase : public CopyableReactive
{
public:
EventStreamBase() = default;
EventStreamBase(const EventStreamBase&) = default;
template
EventStreamBase(T&& t) :
EventStreamBase::CopyableReactive( std::forward(t) )
{}
protected:
template
void emit(T&& e) const
{
DomainSpecificInputManager::Instance().AddInput(
*reinterpret_cast(this->ptr_.get()),
std::forward(e));
}
};
/****************************************/ REACT_IMPL_END /***************************************/
#endif // REACT_DETAIL_EVENTBASE_H_INCLUDED