|
reSIProcate/repro
9694
|
00001 #include "repro/Target.hxx" 00002 00003 #include "resip/stack/Uri.hxx" 00004 #include "resip/stack/NameAddr.hxx" 00005 #include "rutil/Data.hxx" 00006 #include "resip/stack/Via.hxx" 00007 #include "repro/Proxy.hxx" 00008 #include "rutil/WinLeakCheck.hxx" 00009 00010 namespace repro 00011 { 00012 00013 Target::Target() 00014 :mPriorityMetric(0), 00015 mShouldAutoProcess(true), 00016 mStatus(Candidate), 00017 mKeyValueStore(*Proxy::getTargetKeyValueStoreKeyAllocator()) 00018 {} 00019 00020 Target::Target(const resip::Uri& uri) 00021 :mPriorityMetric(0), 00022 mShouldAutoProcess(true), 00023 mStatus(Candidate), 00024 mKeyValueStore(*Proxy::getTargetKeyValueStoreKeyAllocator()) 00025 { 00026 mRec.mContact.uri()=uri; 00027 } 00028 00029 Target::Target(const resip::NameAddr& target) 00030 :mPriorityMetric(0), 00031 mShouldAutoProcess(true), 00032 mStatus(Candidate), 00033 mKeyValueStore(*Proxy::getTargetKeyValueStoreKeyAllocator()) 00034 { 00035 mRec.mContact=target; 00036 } 00037 00038 Target::Target(const resip::ContactInstanceRecord& rec) 00039 :mPriorityMetric(0), 00040 mShouldAutoProcess(true), 00041 mStatus(Candidate), 00042 mRec(rec) 00043 { 00044 } 00045 00046 Target::~Target() 00047 { 00048 } 00049 00050 const resip::Data& 00051 Target::tid() const 00052 { 00053 return mVia.param(resip::p_branch).getTransactionId(); 00054 } 00055 00056 Target::Status& 00057 Target::status() 00058 { 00059 return mStatus; 00060 } 00061 00062 const Target::Status& 00063 Target::status() const 00064 { 00065 return mStatus; 00066 } 00067 00068 const resip::Via& 00069 Target::setVia(const resip::Via& via) 00070 { 00071 return mVia=via; 00072 } 00073 00074 const resip::Via& 00075 Target::via() const 00076 { 00077 return mVia; 00078 } 00079 00080 const resip::ContactInstanceRecord& 00081 Target::rec() const 00082 { 00083 return mRec; 00084 } 00085 00086 resip::ContactInstanceRecord& 00087 Target::rec() 00088 { 00089 return mRec; 00090 } 00091 00092 void 00093 Target::setRec(const resip::ContactInstanceRecord& rec) 00094 { 00095 mRec=rec; 00096 } 00097 00098 Target* 00099 Target::clone() const 00100 { 00101 return new Target(*this); 00102 } 00103 00104 int 00105 Target::getPriority() const 00106 { 00107 return mPriorityMetric; 00108 } 00109 00110 bool 00111 Target::shouldAutoProcess() const 00112 { 00113 return mShouldAutoProcess; 00114 } 00115 00116 EncodeStream& 00117 operator<<(EncodeStream& strm, const repro::Target& t) 00118 { 00119 strm << "Target: " << t.uri() << " status=" << t.status(); 00120 return strm; 00121 } 00122 00123 } // namespace repro 00124 00125 /* ==================================================================== 00126 * The Vovida Software License, Version 1.0 00127 * 00128 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. 00129 * 00130 * Redistribution and use in source and binary forms, with or without 00131 * modification, are permitted provided that the following conditions 00132 * are met: 00133 * 00134 * 1. Redistributions of source code must retain the above copyright 00135 * notice, this list of conditions and the following disclaimer. 00136 * 00137 * 2. Redistributions in binary form must reproduce the above copyright 00138 * notice, this list of conditions and the following disclaimer in 00139 * the documentation and/or other materials provided with the 00140 * distribution. 00141 * 00142 * 3. The names "VOCAL", "Vovida Open Communication Application Library", 00143 * and "Vovida Open Communication Application Library (VOCAL)" must 00144 * not be used to endorse or promote products derived from this 00145 * software without prior written permission. For written 00146 * permission, please contact vocal@vovida.org. 00147 * 00148 * 4. Products derived from this software may not be called "VOCAL", nor 00149 * may "VOCAL" appear in their name, without prior written 00150 * permission of Vovida Networks, Inc. 00151 * 00152 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 00153 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00154 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND 00155 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA 00156 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES 00157 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, 00158 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00159 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00160 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 00161 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00162 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00163 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00164 * DAMAGE. 00165 * 00166 * ==================================================================== 00167 * 00168 * This software consists of voluntary contributions made by Vovida 00169 * Networks, Inc. and many individuals on behalf of Vovida Networks, 00170 * Inc. For more information on Vovida Networks, Inc., please see 00171 * <http://www.vovida.org/>. 00172 * 00173 */
1.7.5.1