|
reSIProcate/repro
9694
|
#include <ProcessorChain.hxx>


Public Types | |
| typedef std::vector< Processor * > | Chain |
Public Member Functions | |
| ProcessorChain (ChainType type) | |
| virtual | ~ProcessorChain () |
| void | addProcessor (std::auto_ptr< Processor >) |
| virtual processor_action_t | process (RequestContext &) |
| virtual void | setChainType (ChainType type) |
| virtual void | pushAddress (const std::vector< short > &address) |
| virtual void | pushAddress (const short address) |
Private Attributes | |
| Chain | mChain |
Friends | |
| EncodeStream & | operator<< (EncodeStream &os, const repro::ProcessorChain &pc) |
Definition at line 11 of file ProcessorChain.hxx.
| typedef std::vector<Processor*> repro::ProcessorChain::Chain |
Definition at line 21 of file ProcessorChain.hxx.
| ProcessorChain::ProcessorChain | ( | Processor::ChainType | type | ) |
Definition at line 22 of file ProcessorChain.cxx.
: Processor(Data::Empty, type) { switch(type) { case REQUEST_CHAIN: setName("RequestProcessor"); break; case RESPONSE_CHAIN: setName("ResponseProcessor"); break; case TARGET_CHAIN: setName("TargetProcessor"); break; case NO_TYPE: default: setName("UnknownProcessor"); break; } DebugLog(<< "Instantiating new " << mName << " chain"); }
| repro::ProcessorChain::~ProcessorChain | ( | ) | [virtual] |
Definition at line 44 of file ProcessorChain.cxx.
| void repro::ProcessorChain::addProcessor | ( | std::auto_ptr< Processor > | ) |
| repro::Processor::processor_action_t repro::ProcessorChain::process | ( | RequestContext & | rc | ) | [virtual] |
Implements repro::Processor.
Definition at line 66 of file ProcessorChain.cxx.
{
//DebugLog(<< mName << " handling request: " << *this << "; reqcontext = " << rc);
processor_action_t action;
unsigned int position=0;
resip::Message* msg = rc.getCurrentEvent();
if(msg)
{
ProcessorMessage* proc = dynamic_cast<ProcessorMessage*>(msg);
if(proc)
{
position=proc->popAddr();
}
}
for (; (position >=0 && position < mChain.size()); ++position)
{
DebugLog(<< "Chain invoking " << mName << ": " << *(mChain[position]));
action = mChain[position]->process(rc);
if (action == SkipAllChains)
{
DebugLog(<< mName << " aborted all chains: " << *(mChain[position]));
return SkipAllChains;
}
if (action == WaitingForEvent)
{
DebugLog(<< mName << " waiting for async response: " << *(mChain[position]));
return WaitingForEvent;
}
if (action == SkipThisChain)
{
DebugLog(<< mName << " skipping current chain: " << *(mChain[position]));
return Continue;
}
}
//DebugLog(<< "Monkey done processing: " << *(mChain[position]));
return Continue;
}
| void ProcessorChain::pushAddress | ( | const std::vector< short > & | address | ) | [virtual] |
Reimplemented from repro::Processor.
Definition at line 115 of file ProcessorChain.cxx.
{
Processor::pushAddress(address);
for(std::vector<Processor*>::iterator i=mChain.begin();i!=mChain.end();++i)
{
(**i).pushAddress(address);
}
}
| void ProcessorChain::pushAddress | ( | const short | address | ) | [virtual] |
Reimplemented from repro::Processor.
Definition at line 125 of file ProcessorChain.cxx.
{
Processor::pushAddress(address);
for(std::vector<Processor*>::iterator i=mChain.begin();i!=mChain.end();++i)
{
(**i).pushAddress(address);
}
}
| void ProcessorChain::setChainType | ( | ChainType | type | ) | [virtual] |
Reimplemented from repro::Processor.
Definition at line 136 of file ProcessorChain.cxx.
| EncodeStream& operator<< | ( | EncodeStream & | os, |
| const repro::ProcessorChain & | pc | ||
| ) | [friend] |
Chain repro::ProcessorChain::mChain [private] |
Definition at line 29 of file ProcessorChain.hxx.
1.7.5.1