|
reSIProcate/repro
9694
|
00001 #if !defined(RESIP_REQUEST_PROCESSOR_HXX) 00002 #define RESIP_REQUEST_PROCESSOR_HXX 00003 00004 #include <iosfwd> 00005 #include <vector> 00006 #include "rutil/resipfaststreams.hxx" 00007 #include "rutil/Data.hxx" 00008 00009 namespace repro 00010 { 00011 class RequestContext; 00012 00013 class Processor 00014 { 00015 public: 00016 typedef enum 00017 { 00018 NO_TYPE=0, 00019 REQUEST_CHAIN, 00020 RESPONSE_CHAIN, 00021 TARGET_CHAIN 00022 } ChainType; 00023 00024 Processor(const resip::Data& name, ChainType type=NO_TYPE); 00025 virtual ~Processor(); 00026 00027 typedef enum 00028 { 00029 Continue, // move onto the next Processor 00030 WaitingForEvent, // stop Processor chain and wait for async response 00031 SkipThisChain, 00032 SkipAllChains 00033 } 00034 processor_action_t; 00035 00036 virtual processor_action_t process(RequestContext &)=0; 00037 00038 virtual void setChainType(ChainType type); 00039 virtual ChainType getChainType() const; 00040 00041 virtual void setName(const resip::Data& name); 00042 virtual const resip::Data& getName() const; 00043 00044 virtual void pushAddress(const std::vector<short>& address); 00045 virtual void pushAddress(const short address); 00046 00047 virtual const std::vector<short>& getAddress() const; 00048 00049 protected: 00050 std::vector<short> mAddress; 00051 ChainType mType; 00052 resip::Data mName; 00053 }; 00054 00055 EncodeStream &operator<<(EncodeStream &os, const repro::Processor &rp); 00056 } 00057 00058 00059 #endif 00060 00061 /* ==================================================================== 00062 * The Vovida Software License, Version 1.0 00063 * 00064 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. 00065 * 00066 * Redistribution and use in source and binary forms, with or without 00067 * modification, are permitted provided that the following conditions 00068 * are met: 00069 * 00070 * 1. Redistributions of source code must retain the above copyright 00071 * notice, this list of conditions and the following disclaimer. 00072 * 00073 * 2. Redistributions in binary form must reproduce the above copyright 00074 * notice, this list of conditions and the following disclaimer in 00075 * the documentation and/or other materials provided with the 00076 * distribution. 00077 * 00078 * 3. The names "VOCAL", "Vovida Open Communication Application Library", 00079 * and "Vovida Open Communication Application Library (VOCAL)" must 00080 * not be used to endorse or promote products derived from this 00081 * software without prior written permission. For written 00082 * permission, please contact vocal@vovida.org. 00083 * 00084 * 4. Products derived from this software may not be called "VOCAL", nor 00085 * may "VOCAL" appear in their name, without prior written 00086 * permission of Vovida Networks, Inc. 00087 * 00088 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 00089 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00090 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND 00091 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA 00092 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES 00093 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, 00094 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00095 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00096 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 00097 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00098 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00099 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00100 * DAMAGE. 00101 * 00102 * ==================================================================== 00103 * 00104 * This software consists of voluntary contributions made by Vovida 00105 * Networks, Inc. and many individuals on behalf of Vovida Networks, 00106 * Inc. For more information on Vovida Networks, Inc., please see 00107 * <http://www.vovida.org/>. 00108 * 00109 */
1.7.5.1