/[resiprocate]/branches/b-identity-0505/dum/Handle.hxx
ViewVC logotype

Diff of /branches/b-identity-0505/dum/Handle.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3267 by jason, Tue Aug 17 23:50:49 2004 UTC revision 4010 by jason, Sat Mar 19 03:54:17 2005 UTC
# Line 1  Line 1 
1  #if !defined(RESIP_HANDLE_HXX)  #if !defined(RESIP_HANDLE_HXX)
2  #define RESIP_HANDLE_HXX  #define RESIP_HANDLE_HXX
3    
4    #include <iosfwd>
5  #include "resiprocate/dum/Handled.hxx"  #include "resiprocate/dum/Handled.hxx"
6  #include "resiprocate/dum/HandleManager.hxx"  #include "resiprocate/dum/HandleManager.hxx"
7  #include "resiprocate/dum/HandleException.hxx"  #include "resiprocate/dum/HandleException.hxx"
# Line 43  Line 44 
44           return static_cast<T*>(mHam->getHandled(mId));           return static_cast<T*>(mHam->getHandled(mId));
45        }        }
46                
47          const T* get() const
48          {
49             if (!mHam)
50             {
51                //assert(0);
52                throw HandleException("Reference to unitialized handle.", __FILE__, __LINE__);
53             }
54             return static_cast<T*>(mHam->getHandled(mId));
55          }
56          
57        T* operator->()        T* operator->()
58        {        {
59           return get();           return get();
60        }        }
61    
62          const T* operator->() const
63          {
64             return get();
65          }
66    
67          T& operator*()
68          {
69             return *get();
70          }
71    
72          const T& operator*() const
73          {
74             return *get();
75          }
76          
77    
78        Handled::Id getId() const        Handled::Id getId() const
79        {        {
80           return mId;           return mId;
# Line 84  Line 111 
111  }  }
112    
113  #endif  #endif
114    
115    /* ====================================================================
116     * The Vovida Software License, Version 1.0
117     *
118     * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
119     *
120     * Redistribution and use in source and binary forms, with or without
121     * modification, are permitted provided that the following conditions
122     * are met:
123     *
124     * 1. Redistributions of source code must retain the above copyright
125     *    notice, this list of conditions and the following disclaimer.
126     *
127     * 2. Redistributions in binary form must reproduce the above copyright
128     *    notice, this list of conditions and the following disclaimer in
129     *    the documentation and/or other materials provided with the
130     *    distribution.
131     *
132     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
133     *    and "Vovida Open Communication Application Library (VOCAL)" must
134     *    not be used to endorse or promote products derived from this
135     *    software without prior written permission. For written
136     *    permission, please contact vocal@vovida.org.
137     *
138     * 4. Products derived from this software may not be called "VOCAL", nor
139     *    may "VOCAL" appear in their name, without prior written
140     *    permission of Vovida Networks, Inc.
141     *
142     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
143     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
144     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
145     * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
146     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
147     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
148     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
149     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
150     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
151     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
152     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
153     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
154     * DAMAGE.
155     *
156     * ====================================================================
157     *
158     * This software consists of voluntary contributions made by Vovida
159     * Networks, Inc. and many individuals on behalf of Vovida Networks,
160     * Inc.  For more information on Vovida Networks, Inc., please see
161     * <http://www.vovida.org/>.
162     *
163     */

Legend:
Removed from v.3267  
changed lines
  Added in v.4010

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27