reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RouteStore.hxx
Go to the documentation of this file.
1#if !defined(REPRO_ROUTESTORE_HXX)
2#define REPRO_ROUTESTORE_HXX
3
4#include <regex>
5
6#include <set>
7
8#include "rutil/Data.hxx"
9#include "rutil/RWMutex.hxx"
10#include "resip/stack/Uri.hxx"
11
12#include "repro/AbstractDb.hxx"
13
14
15namespace repro
16{
17//class AbstractDb;
18
20{
21 public:
22 typedef std::vector<resip::Uri> UriList;
24
27
28 bool addRoute(const resip::Data& method,
29 const resip::Data& event,
32 const short order );
33
34 void eraseRoute(const resip::Data& method,
35 const resip::Data& event,
37 const short order);
38 void eraseRoute( const resip::Data& key );
39
41 const resip::Data& method,
42 const resip::Data& event,
45 const short order );
46
48
49 Key getFirstKey();// return empty if no more
50 Key getNextKey(Key& key); // return empty if no more
51
53 const resip::Data& method,
54 const resip::Data& event );
55
56 private:
57 bool findKey(const Key& key); // move cursor to key
58
59 Key buildKey(const resip::Data& method,
60 const resip::Data& event,
62 const short order) const;
63
64 AbstractDb& mDb;
65
66 class RouteOp
67 {
68 public:
69 Key key;
70 std::regex *preq;
71 AbstractDb::RouteRecord routeRecord;
72 bool operator<(const RouteOp&) const;
73 };
74
75 resip::RWMutex mMutex;
76 typedef std::multiset<RouteOp> RouteOpList;
77 RouteOpList mRouteOperators;
78 RouteOpList::iterator mCursor;
79};
80
81 }
82#endif
83
84/* ====================================================================
85 * The Vovida Software License, Version 1.0
86 *
87 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
88 *
89 * Redistribution and use in source and binary forms, with or without
90 * modification, are permitted provided that the following conditions
91 * are met:
92 *
93 * 1. Redistributions of source code must retain the above copyright
94 * notice, this list of conditions and the following disclaimer.
95 *
96 * 2. Redistributions in binary form must reproduce the above copyright
97 * notice, this list of conditions and the following disclaimer in
98 * the documentation and/or other materials provided with the
99 * distribution.
100 *
101 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
102 * and "Vovida Open Communication Application Library (VOCAL)" must
103 * not be used to endorse or promote products derived from this
104 * software without prior written permission. For written
105 * permission, please contact vocal@vovida.org.
106 *
107 * 4. Products derived from this software may not be called "VOCAL", nor
108 * may "VOCAL" appear in their name, without prior written
109 * permission of Vovida Networks, Inc.
110 *
111 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
112 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
113 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
114 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
115 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
116 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
117 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
118 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
119 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
120 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
121 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
122 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
123 * DAMAGE.
124 *
125 * ====================================================================
126 */
std::vector< resip::Uri > UriList
UriList process(const resip::Uri &ruri, const resip::Data &method, const resip::Data &event)
bool addRoute(const resip::Data &method, const resip::Data &event, const resip::Data &matchingPattern, const resip::Data &rewriteExpression, const short order)
AbstractDb::RouteRecord getRouteRecord(const resip::Data &key)
resip::Data Key
Key getNextKey(Key &key)
void eraseRoute(const resip::Data &method, const resip::Data &event, const resip::Data &matchingPattern, const short order)
bool updateRoute(const resip::Data &originalKey, const resip::Data &method, const resip::Data &event, const resip::Data &matchingPattern, const resip::Data &rewriteExpression, const short order)
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Wraps the readers/writers mutex implementation on your platform.
Definition RWMutex.hxx:29
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
This Class is used to implement a primitive form of RPC using loose XML formatting.
void list()
Definition userAdmin.cxx:66