reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
TupleMarkManager.hxx
Go to the documentation of this file.
1#ifndef TUPLE_MARK_MANAGER
2#define TUPLE_MARK_MANAGER
3
5#include "rutil/Mutex.hxx"
6#include <set>
7#include <map>
8
9namespace resip
10{
11
12class MarkListener;
13
15{
16 public:
19
20 typedef enum
21 {
24 BLACK
25 }
27
28 MarkType getMarkType(const Tuple& tuple);
29
30 void mark(const Tuple& tuple,uint64_t expiry,MarkType mark);
31 void unmark(const Tuple& tuple, MarkType markFilter);
34
35 private:
36
37 class ListEntry
38 {
39 public:
40 ListEntry(const Tuple& tuple, uint64_t expiry);
41 ListEntry(const ListEntry& orig);
42 ~ListEntry();
43 bool operator<(const ListEntry& rhs) const;
44 bool operator>(const ListEntry& rhs) const;
45 bool operator==(const ListEntry& rhs) const;
46
47 Tuple mTuple;
48 uint64_t mExpiry;
49 private:
50 ListEntry();
51 };
52
53 typedef std::map<ListEntry,MarkType> TupleList;
54 TupleList mList;
55
56 typedef std::set<MarkListener*> Listeners;
57 Listeners mListeners;
58
59 void removeMark(const Tuple& tuple, TupleList::iterator i);
60 void notifyListeners(const resip::Tuple& tuple, uint64_t& expiry, MarkType& mark);
61};
62
63}
64
65#endif
66
67/* ====================================================================
68 * The Vovida Software License, Version 1.0
69 *
70 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
71 *
72 * Redistribution and use in source and binary forms, with or without
73 * modification, are permitted provided that the following conditions
74 * are met:
75 *
76 * 1. Redistributions of source code must retain the above copyright
77 * notice, this list of conditions and the following disclaimer.
78 *
79 * 2. Redistributions in binary form must reproduce the above copyright
80 * notice, this list of conditions and the following disclaimer in
81 * the documentation and/or other materials provided with the
82 * distribution.
83 *
84 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
85 * and "Vovida Open Communication Application Library (VOCAL)" must
86 * not be used to endorse or promote products derived from this
87 * software without prior written permission. For written
88 * permission, please contact vocal@vovida.org.
89 *
90 * 4. Products derived from this software may not be called "VOCAL", nor
91 * may "VOCAL" appear in their name, without prior written
92 * permission of Vovida Networks, Inc.
93 *
94 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
95 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
96 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
97 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
98 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
99 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
100 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
101 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
102 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
103 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
104 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
105 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
106 * DAMAGE.
107 *
108 * ====================================================================
109 *
110 * This software consists of voluntary contributions made by Vovida
111 * Networks, Inc. and many individuals on behalf of Vovida Networks,
112 * Inc. For more information on Vovida Networks, Inc., please see
113 * <http://www.vovida.org/>.
114 *
115 */
void registerMarkListener(MarkListener *)
void mark(const Tuple &tuple, uint64_t expiry, MarkType mark)
void unregisterMarkListener(MarkListener *)
MarkType getMarkType(const Tuple &tuple)
void unmark(const Tuple &tuple, MarkType markFilter)
Represents a network address.
Definition Tuple.hxx:59
dcm! – add UnusedChecking(_enum) below;
unsigned long long uint64_t
Definition Stun.hxx:39
bool operator<(const Data &lhs, const Data &rhs)
Definition Data.cxx:778
bool operator>(const Data &lhs, const Data &rhs)
Definition Data.hxx:1188
bool operator==(const char *lhs, const Data &rhs)
Definition Data.hxx:1197
unsigned __int64 uint64_t
Definition stdint.h:95