reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Target.hxx
Go to the documentation of this file.
1#ifndef TARGET_HXX
2#define TARGET_HXX 1
3
4#include <list>
5#include <vector>
6
7#include "resip/stack/Uri.hxx"
9#include "rutil/Data.hxx"
10#include "resip/stack/Via.hxx"
13
14namespace repro
15{
16
17class Target
18{
19 public:
20
21 typedef enum
22 {
23 Candidate, //Transaction has not started
24 Started, //Transaction has started, no final responses
25 Cancelled, //Transaction has been cancelled, but no final response yet
26 Terminated, //Transaction has received a final response
27 NonExistent //The state of transactions that do not exist
29
30 Target();
31 Target(const resip::Uri& uri);
32 Target(const resip::NameAddr& target);
34
35 virtual ~Target();
36
37 virtual const resip::Data& tid() const;
38
39 virtual Status& status();
40 virtual const Status& status() const;
41
42 virtual const resip::Via& setVia(const resip::Via& via);
43 virtual const resip::Via& via() const;
44
45 virtual const resip::Uri& uri() const {return mRec.mContact.uri();}
46
47 virtual const resip::ContactInstanceRecord& rec() const;
49 virtual void setRec(const resip::ContactInstanceRecord& rec);
50
51 virtual Target* clone() const;
52
53 //In case you need const accessors to keep things happy.
54 virtual int getPriority() const;
55 virtual bool shouldAutoProcess() const;
56
57 // Accessor for per-target extensible state storage for monkeys
59
60 static bool priorityMetricCompare(const Target* lhs, const Target* rhs)
61 {
62 return lhs->mPriorityMetric > rhs->mPriorityMetric;
63 }
64
70
71 protected:
76};// class Target
77
78#ifdef __SUNPRO_CC
79typedef std::vector<Target*> TargetPtrList;
80#else
81typedef std::list<Target*> TargetPtrList;
82#endif
83
86
87}// namespace repro
88
89#endif
90
91/* ====================================================================
92 * The Vovida Software License, Version 1.0
93 *
94 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
95 *
96 * Redistribution and use in source and binary forms, with or without
97 * modification, are permitted provided that the following conditions
98 * are met:
99 *
100 * 1. Redistributions of source code must retain the above copyright
101 * notice, this list of conditions and the following disclaimer.
102 *
103 * 2. Redistributions in binary form must reproduce the above copyright
104 * notice, this list of conditions and the following disclaimer in
105 * the documentation and/or other materials provided with the
106 * distribution.
107 *
108 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
109 * and "Vovida Open Communication Application Library (VOCAL)" must
110 * not be used to endorse or promote products derived from this
111 * software without prior written permission. For written
112 * permission, please contact vocal@vovida.org.
113 *
114 * 4. Products derived from this software may not be called "VOCAL", nor
115 * may "VOCAL" appear in their name, without prior written
116 * permission of Vovida Networks, Inc.
117 *
118 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
119 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
120 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
121 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
122 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
123 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
124 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
125 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
126 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
127 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
128 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
129 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
130 * DAMAGE.
131 *
132 * ====================================================================
133 *
134 * This software consists of voluntary contributions made by Vovida
135 * Networks, Inc. and many individuals on behalf of Vovida Networks,
136 * Inc. For more information on Vovida Networks, Inc., please see
137 * <http://www.vovida.org/>.
138 *
139 */
static bool priorityMetricCompare(const Target *lhs, const Target *rhs)
Definition Target.hxx:60
resip::ContactInstanceRecord mRec
Definition Target.hxx:74
resip::KeyValueStore & getKeyValueStore()
Definition Target.hxx:58
virtual const resip::Uri & uri() const
Definition Target.hxx:45
virtual void setRec(const resip::ContactInstanceRecord &rec)
Definition Target.cxx:93
resip::KeyValueStore mKeyValueStore
Definition Target.hxx:75
virtual bool shouldAutoProcess() const
Definition Target.cxx:111
virtual const resip::Via & setVia(const resip::Via &via)
Definition Target.cxx:69
int mPriorityMetric
Higher value denotes higher priority.
Definition Target.hxx:68
virtual Status & status()
Definition Target.cxx:57
resip::Via mVia
Definition Target.hxx:73
virtual Target * clone() const
Definition Target.cxx:99
virtual const resip::Data & tid() const
Definition Target.cxx:51
Status mStatus
Definition Target.hxx:72
virtual const resip::Via & via() const
Definition Target.cxx:75
virtual int getPriority() const
Definition Target.cxx:105
virtual const resip::ContactInstanceRecord & rec() const
Definition Target.cxx:81
virtual ~Target()
Definition Target.cxx:46
bool mShouldAutoProcess
Definition Target.hxx:69
A single contact record, bound to an Aor during registration.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
Represents the "via-parm" element in the RFC 3261 grammar.
Definition Via.hxx:18
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
std::list< Target * > TargetPtrList
Definition Target.hxx:81
#define EncodeStream
void list()
Definition userAdmin.cxx:66