Skip to content
Snippets Groups Projects
Commit a4cb190a authored by dw6's avatar dw6
Browse files

major bugs fixed :-)

parent 7eccff90
No related branches found
No related tags found
No related merge requests found
......@@ -20,30 +20,37 @@
#include "ForwardSwitch.hh"
#define prefix_
#define prefix_ inline
prefix_ ForwardSwitch::ForwardSwitch(bool state)
prefix_ senf::ppi::module::ForwardSwitch::ForwardSwitch(bool state)
{
route( input, output );
input.onRequest( &ForwardSwitch::onRequest );
forward_ = state;
}
prefix_ bool ForwardSwitch::forward(){
prefix_ void senf::ppi::module::ForwardSwitch::onRequest()
{
if(forward_){
output(input());
}
}
prefix_ bool senf::ppi::module::ForwardSwitch::forward(){
return forward_;
}
prefix_ bool ForwardSwitch::forward(bool state){
prefix_ bool senf::ppi::module::ForwardSwitch::forward(bool state){
forward_ = state;
return state;
}
prefix_ void ForwardSwitch::stopForwarding(){
prefix_ bool senf::ppi::module::ForwardSwitch::stopForwarding(){
return forward(false);
}
prefix_ void ForwardSwitch::startForwarding(){
prefix_ bool senf::ppi::module::ForwardSwitch::startForwarding(){
return forward(true);
}
......
......@@ -35,18 +35,20 @@ class ForwardSwitch
SENF_PPI_MODULE(ForwardSwitch);
public:
connector::ActiveInput<> input;
connector::PassiveInput<> input;
connector::ActiveOutput<> output;
ForwardSwitch(bool state);
private:
void onRequest();
bool forward_;
bool forward();
bool forward(bool state);
void stopForwarding();
void startForwarding();
bool stopForwarding();
bool startForwarding();
};
}}} //namespaces
#include "ForwardSwitch.cci"
#endif /*FORWARDSWITCH_HH_*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment