reSIProcate/DialogUsageManager  9680
AppDialogSet.cxx
Go to the documentation of this file.
00001 #include "resip/dum/AppDialogSet.hxx"
00002 #include "resip/dum/AppDialog.hxx"
00003 #include "resip/dum/DialogUsageManager.hxx"
00004 #include "resip/dum/MasterProfile.hxx"
00005 #include "rutil/WinLeakCheck.hxx"
00006 
00007 using namespace resip;
00008 
00009 AppDialogSet::AppDialogSet(DialogUsageManager& dum) : 
00010    Handled(dum),
00011    mDum(dum),
00012    mDialogSet(0),
00013    mIsReUsed(false)
00014 {}
00015 
00016 AppDialogSet::~AppDialogSet()
00017 {}
00018 
00019 AppDialogSetHandle 
00020 AppDialogSet::getHandle()
00021 {
00022    return AppDialogSetHandle(mHam, mId);
00023 }
00024 
00025 void
00026 AppDialogSet::destroy()
00027 {
00028    delete this;
00029 }
00030 
00031 void 
00032 AppDialogSet::end()
00033 {
00034    if (mDialogSet)
00035    {
00036       mDialogSet->end();
00037    }
00038 }
00039 
00040 void
00041 AppDialogSet::endCommand()
00042 {
00043    AppDialogSetHandle handle = getHandle();
00044    mDum.post(new AppDialogSetEndCommand(handle));
00045 }
00046 
00047 SharedPtr<UserProfile>  
00048 AppDialogSet::selectUASUserProfile(const SipMessage&)
00049 {
00050    // Default is Master Profile - override this method to select a different userProfile for UAS DialogSets
00051    return mDum.getMasterUserProfile();
00052 }
00053 
00054 SharedPtr<UserProfile> 
00055 AppDialogSet::getUserProfile()
00056 {
00057    if(mDialogSet)
00058    {
00059       return mDialogSet->getUserProfile();
00060    }
00061    else
00062    {
00063       return SharedPtr<UserProfile>();
00064    }
00065 }
00066 
00067 AppDialog* 
00068 AppDialogSet::createAppDialog(const SipMessage&)
00069 {
00070    return new AppDialog(mDum);
00071 }
00072 
00073 DialogSetId 
00074 AppDialogSet::getDialogSetId()
00075 {
00076    if (mDialogSet)
00077    {
00078        return mDialogSet->getId();
00079    }
00080    else
00081    {
00082        return DialogSetId(Data::Empty, Data::Empty);
00083    }
00084 }
00085 
00086 AppDialogSet*
00087 AppDialogSet::reuse()
00088 {
00089    assert(mDialogSet);
00090    mDialogSet->appDissociate();
00091    mDialogSet = 0;
00092    
00093    mIsReUsed = true;
00094    return this;
00095 }
00096 
00097 bool
00098 AppDialogSet::isReUsed() const
00099 {
00100    return mIsReUsed;
00101 }
00102 
00103 const Data 
00104 AppDialogSet::getClassName()
00105 {
00106    return "AppDialogSet";
00107 }
00108 
00109 EncodeStream& 
00110 AppDialogSet::dump(EncodeStream& strm) const
00111 {
00112    strm << "AppDialogSet " << mId;
00113    return strm;
00114 }
00115 
00116 /* ====================================================================
00117  * The Vovida Software License, Version 1.0 
00118  * 
00119  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00120  * 
00121  * Redistribution and use in source and binary forms, with or without
00122  * modification, are permitted provided that the following conditions
00123  * are met:
00124  * 
00125  * 1. Redistributions of source code must retain the above copyright
00126  *    notice, this list of conditions and the following disclaimer.
00127  * 
00128  * 2. Redistributions in binary form must reproduce the above copyright
00129  *    notice, this list of conditions and the following disclaimer in
00130  *    the documentation and/or other materials provided with the
00131  *    distribution.
00132  * 
00133  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00134  *    and "Vovida Open Communication Application Library (VOCAL)" must
00135  *    not be used to endorse or promote products derived from this
00136  *    software without prior written permission. For written
00137  *    permission, please contact vocal@vovida.org.
00138  *
00139  * 4. Products derived from this software may not be called "VOCAL", nor
00140  *    may "VOCAL" appear in their name, without prior written
00141  *    permission of Vovida Networks, Inc.
00142  * 
00143  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00144  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00145  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00146  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00147  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00148  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00149  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00150  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00151  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00152  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00153  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00154  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00155  * DAMAGE.
00156  * 
00157  * ====================================================================
00158  * 
00159  * This software consists of voluntary contributions made by Vovida
00160  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00161  * Inc.  For more information on Vovida Networks, Inc., please see
00162  * <http://www.vovida.org/>.
00163  *
00164  */