reSIProcate/stack  9694
CallId.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_CALLID_HXX)
00002 #define RESIP_CALLID_HXX 
00003 
00004 #include <iosfwd>
00005 #include "rutil/Data.hxx"
00006 #include "resip/stack/ParserCategory.hxx"
00007 #include "resip/stack/ParserContainer.hxx"
00008 
00009 namespace resip
00010 {
00011 
00012 
00017 class CallID : public ParserCategory
00018 {
00019    public:
00020       enum {commaHandling = NoCommaTokenizing};
00021 
00022       CallID();
00023       CallID(const HeaderFieldValue& hfv, 
00024                Headers::Type type,
00025                PoolBase* pool=0);
00026       CallID(const CallID& orig,
00027                PoolBase* pool=0);
00028       CallID& operator=(const CallID&);
00029       bool operator==(const CallID&) const;
00030       
00031       Data& value();
00032       const Data& value() const;
00033 
00034       virtual void parse(ParseBuffer& pb);
00035       virtual ParserCategory* clone() const;
00036       virtual ParserCategory* clone(void* location) const;
00037       virtual ParserCategory* clone(PoolBase* pool) const;
00038       virtual EncodeStream& encodeParsed(EncodeStream& str) const;
00039 
00040       // Inform the compiler that overloads of these may be found in
00041       // ParserCategory, too.
00042       using ParserCategory::exists;
00043       using ParserCategory::remove;
00044       using ParserCategory::param;
00045 
00046       virtual Parameter* createParam(ParameterTypes::Type type, 
00047                                                                                 ParseBuffer& pb, 
00048                                                                                 const std::bitset<256>& terminators,
00049                                         PoolBase* pool);
00050       bool exists(const Param<CallID>& paramType) const;
00051       void remove(const Param<CallID>& paramType);
00052 
00053 #define defineParam(_enum, _name, _type, _RFC_ref_ignored)                      \
00054       const _enum##_Param::DType& param(const _enum##_Param& paramType) const;  \
00055       _enum##_Param::DType& param(const _enum##_Param& paramType); \
00056       friend class _enum##_Param
00057 
00058 defineParam(fromTag, "from-tag", DataParameter, "RFC 3891 (not in IANA, apparently)");
00059 defineParam(toTag, "to-tag", DataParameter, "RFC 3891 (not in IANA, apparently)");
00060 defineParam(earlyOnly, "early-only", ExistsParameter, "RFC 3891 (not in IANA, apparently)");
00061 
00062 #undef defineParam
00063 
00064    private:
00065       Data mValue;
00066 
00067       static ParameterTypes::Factory ParameterFactories[ParameterTypes::MAX_PARAMETER];
00068 };
00069 typedef ParserContainer<CallID> CallIDs;
00070 typedef CallID CallId; // code convention compatible
00071  
00072 }
00073 
00074 #endif
00075 
00076 /* ====================================================================
00077  * The Vovida Software License, Version 1.0 
00078  * 
00079  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00080  * 
00081  * Redistribution and use in source and binary forms, with or without
00082  * modification, are permitted provided that the following conditions
00083  * are met:
00084  * 
00085  * 1. Redistributions of source code must retain the above copyright
00086  *    notice, this list of conditions and the following disclaimer.
00087  * 
00088  * 2. Redistributions in binary form must reproduce the above copyright
00089  *    notice, this list of conditions and the following disclaimer in
00090  *    the documentation and/or other materials provided with the
00091  *    distribution.
00092  * 
00093  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00094  *    and "Vovida Open Communication Application Library (VOCAL)" must
00095  *    not be used to endorse or promote products derived from this
00096  *    software without prior written permission. For written
00097  *    permission, please contact vocal@vovida.org.
00098  *
00099  * 4. Products derived from this software may not be called "VOCAL", nor
00100  *    may "VOCAL" appear in their name, without prior written
00101  *    permission of Vovida Networks, Inc.
00102  * 
00103  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00104  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00105  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00106  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00107  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00108  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00109  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00110  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00111  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00112  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00113  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00114  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00115  * DAMAGE.
00116  * 
00117  * ====================================================================
00118  * 
00119  * This software consists of voluntary contributions made by Vovida
00120  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00121  * Inc.  For more information on Vovida Networks, Inc., please see
00122  * <http://www.vovida.org/>.
00123  *
00124  */