|
reSIProcate/stack
9694
|
00001 #if !defined(RESIP_QVALUEPARAMETER_HXX) 00002 #define RESIP_QVALUEPARAMETER_HXX 00003 00004 #include "rutil/resipfaststreams.hxx" 00005 00006 #include "resip/stack/Parameter.hxx" 00007 #include "resip/stack/ParameterTypeEnums.hxx" 00008 #include "resip/stack/QValue.hxx" 00009 #include "rutil/PoolBase.hxx" 00010 #include <iosfwd> 00011 00012 namespace resip 00013 { 00014 00015 class ParseBuffer; 00016 00058 class QValueParameter : public Parameter 00059 { 00060 public: 00061 typedef QValue Type; 00062 00073 QValueParameter(ParameterTypes::Type, ParseBuffer& pb, const std::bitset<256>& terminators); 00079 explicit QValueParameter(ParameterTypes::Type type); 00080 00091 static Parameter* decode(ParameterTypes::Type type, 00092 ParseBuffer& pb, 00093 const std::bitset<256>& terminators, 00094 PoolBase* pool) 00095 { 00096 return new (pool) QValueParameter(type, pb, terminators); 00097 } 00098 00103 virtual Parameter* clone() const; 00104 00110 virtual EncodeStream& encode(EncodeStream& stream) const; 00111 00112 Type& value() {return mValue;} 00113 int qval() const {return mValue.getValue();} 00114 00115 private: 00116 Type mValue; 00117 }; 00118 00127 EncodeStream& operator<<(EncodeStream& stream, const QValue& qvalue); 00128 00129 } 00130 00131 #endif 00132 00133 /* ==================================================================== 00134 * The Vovida Software License, Version 1.0 00135 * 00136 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved. 00137 * 00138 * Redistribution and use in source and binary forms, with or without 00139 * modification, are permitted provided that the following conditions 00140 * are met: 00141 * 00142 * 1. Redistributions of source code must retain the above copyright 00143 * notice, this list of conditions and the following disclaimer. 00144 * 00145 * 2. Redistributions in binary form must reproduce the above copyright 00146 * notice, this list of conditions and the following disclaimer in 00147 * the documentation and/or other materials provided with the 00148 * distribution. 00149 * 00150 * 3. The names "VOCAL", "Vovida Open Communication Application Library", 00151 * and "Vovida Open Communication Application Library (VOCAL)" must 00152 * not be used to endorse or promote products derived from this 00153 * software without prior written permission. For written 00154 * permission, please contact vocal@vovida.org. 00155 * 00156 * 4. Products derived from this software may not be called "VOCAL", nor 00157 * may "VOCAL" appear in their name, without prior written 00158 * permission of Vovida Networks, Inc. 00159 * 00160 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED 00161 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00162 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND 00163 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA 00164 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES 00165 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL, 00166 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00167 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00168 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 00169 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00170 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 00171 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 00172 * DAMAGE. 00173 * 00174 * ==================================================================== 00175 * 00176 * This software consists of voluntary contributions made by Vovida 00177 * Networks, Inc. and many individuals on behalf of Vovida Networks, 00178 * Inc. For more information on Vovida Networks, Inc., please see 00179 * <http://www.vovida.org/>. 00180 * 00181 */
1.7.5.1