reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
DumFeatureChain.cxx
Go to the documentation of this file.
6
7#include <utility>
8
9using namespace resip;
10using namespace std;
11
13{
14 public:
16 : DumFeature(dum, target)
17 {}
18
20 {
22 }
23};
24
26 FeatureList features,
28 : mFeatures(std::move(features))
29{
30 mFeatures.emplace_back(std::make_shared<GuardFeature>(dum, target));
31 for (FeatureList::size_type i = 0; i < mFeatures.size(); ++i)
32 {
33 mActiveFeatures.push_back(true);
34 }
35}
36
38{
39 FeatureList::iterator feat = mFeatures.begin();
40 vector<bool>::iterator active = mActiveFeatures.begin();
41 bool stop = false;
42
44 do
45 {
46 if (*active)
47 {
48 pres = (*feat)->process(msg);
49
50 switch(pres)
51 {
53 stop = true;
54 break;
56 *active = false;
57 break;
62 *active = false;
63 stop = true;
64 break;
65 }
66
67 if (static_cast<unsigned int>(pres) & DumFeature::EventDoneBit)
68 {
69 delete msg;
70 unsigned int bits = pres;
73 pres = static_cast<DumFeature::ProcessingResult>(bits);
74 }
75 }
76
77 active++;
78 feat++;
79 }
80 while(!stop && feat != mFeatures.end());
81
82
83 unsigned int chainBits = 0;
84 if (static_cast<unsigned int>(pres) & DumFeature::ChainDoneBit || feat == mFeatures.end())
85 {
86 chainBits |= ChainDoneBit;
87 }
88
89 if (static_cast<unsigned int>(pres) & DumFeature::EventTakenBit)
90 {
91 chainBits |= EventTakenBit;
92 }
93
94 return static_cast<DumFeatureChain::ProcessingResult>(chainBits);
95}
Data bits(size_t v)
Definition Data.cxx:2342
virtual ProcessingResult process(Message *msg)
GuardFeature(DialogUsageManager &dum, TargetCommand::Target &target)
ProcessingResult process(Message *msg)
DumFeatureChain(DialogUsageManager &dum, FeatureList features, TargetCommand::Target &target)
std::vector< std::shared_ptr< DumFeature > > FeatureList
The base-class used for message-passing.
Definition Message.hxx:21
dcm! – add UnusedChecking(_enum) below;