Skip to content

Commit

Permalink
Demonstrate use of DeclareAutoFilter function.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Hare committed Aug 13, 2014
1 parent 2ef9162 commit 5be1f0f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/autowiring/test/AutoFilterTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <autowiring/AutoPacketFactory.h>
#include <autowiring/Deferred.h>
#include <autowiring/NewAutoFilter.h>
#include <autowiring/DeclareAutoFilter.h>
#include <autowiring/AutoSelfUpdate.h>
#include THREAD_HEADER

Expand Down Expand Up @@ -1133,16 +1134,12 @@ struct MultiFilter01 {

MultiFilter01() {
// Constructor wraps each method in an AutoFilter call
AutoConstruct<MicroAutoFilter<void, const Decoration<0>&>>([this] (const Decoration<0>& arg) {
Call0(std::move(arg));
});
AutoConstruct<MicroAutoFilter<void, const Decoration<1>&>>([this] (const Decoration<1>& arg) {
Call1(std::move(arg));
});
DeclareAutoFilter(this, &MultiFilter01::Call0);
DeclareAutoFilter(this, &MultiFilter01::Call1);
}
};

TEST_F(AutoFilterTest, MultiMicroAutoFilter) {
TEST_F(AutoFilterTest, DeclareAutoFilterTest) {
AutoCurrentContext()->Initiate();
AutoRequired<AutoPacketFactory> factory;
AutoRequired<MultiFilter01> mf01;
Expand Down

0 comments on commit 5be1f0f

Please sign in to comment.