reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
ProcessorChain.hxx
Go to the documentation of this file.
1#if !defined(RESIP_REQUEST_PROCESSOR_CHAIN_HXX)
2#define RESIP_REQUEST_PROCESSOR_CHAIN_HXX
3
4#include <memory>
5#include <vector>
6#include "repro/Processor.hxx"
8
9namespace repro
10{
12{
13 public:
15 virtual ~ProcessorChain();
16
17 void addProcessor(std::unique_ptr<Processor>);
18 template<class T> void insertProcessor(std::unique_ptr<Processor> rp)
19 {
20 resip_assert(!mChainReady);
21 rp->setChainType(mType);
22 for(Chain::iterator it = mChain.begin();
23 it != mChain.end();
24 it++)
25 {
26 Processor* p = *it;
27 if(dynamic_cast<T*>(p))
28 {
29 mChain.insert(it, rp.release());
30 return;
31 }
32 }
33 mChain.push_back(rp.release());
34 }
35
37
38 typedef std::vector<Processor*> Chain;
39
40 virtual void setChainType(ChainType type);
41
42 virtual void pushAddress(const std::vector<short>& address);
43 virtual void pushAddress(const short address);
44
45 private:
46 Chain mChain;
47
48 bool mChainReady;
49 void onChainComplete();
50
52};
53
55}
56#endif
57
58/* ====================================================================
59 * The Vovida Software License, Version 1.0
60 *
61 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
62 *
63 * Redistribution and use in source and binary forms, with or without
64 * modification, are permitted provided that the following conditions
65 * are met:
66 *
67 * 1. Redistributions of source code must retain the above copyright
68 * notice, this list of conditions and the following disclaimer.
69 *
70 * 2. Redistributions in binary form must reproduce the above copyright
71 * notice, this list of conditions and the following disclaimer in
72 * the documentation and/or other materials provided with the
73 * distribution.
74 *
75 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
76 * and "Vovida Open Communication Application Library (VOCAL)" must
77 * not be used to endorse or promote products derived from this
78 * software without prior written permission. For written
79 * permission, please contact vocal@vovida.org.
80 *
81 * 4. Products derived from this software may not be called "VOCAL", nor
82 * may "VOCAL" appear in their name, without prior written
83 * permission of Vovida Networks, Inc.
84 *
85 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
86 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
87 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
88 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
89 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
90 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
91 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
92 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
93 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
94 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
95 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
96 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
97 * DAMAGE.
98 *
99 * ====================================================================
100 *
101 * This software consists of voluntary contributions made by Vovida
102 * Networks, Inc. and many individuals on behalf of Vovida Networks,
103 * Inc. For more information on Vovida Networks, Inc., please see
104 * <http://www.vovida.org/>.
105 *
106 */
#define resip_assert(x)
This file needs to work for both C and C++ code.
void insertProcessor(std::unique_ptr< Processor > rp)
std::vector< Processor * > Chain
virtual void pushAddress(const std::vector< short > &address)
virtual void setChainType(ChainType type)
friend EncodeStream & operator<<(EncodeStream &os, const repro::ProcessorChain &pc)
void addProcessor(std::unique_ptr< Processor >)
virtual processor_action_t process(RequestContext &)
friend class ProcessorChain
Definition Processor.hxx:55
ChainType mType
Definition Processor.hxx:52
This Class is used to implement a primitive form of RPC using loose XML formatting.
EncodeStream & operator<<(EncodeStream &os, const repro::Processor &rp)
Definition Processor.cxx:69
Replaces STL streams for general encoding purposes.
#define EncodeStream
void list()
Definition userAdmin.cxx:66