VirtualBox

Changeset 11028

Show
Ignore:
Timestamp:
07/31/08 16:06:39 (4 months ago)
Author:
vboxsync
Message:

Runtime: autores doc clarification and queries and example template specialisation

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/autores.h

    r11015 r11028  
    3232 * Inherit from this class in order to prevent automatic generation 
    3333 * of the copy constructor and assignment operator in your class. 
     34 * @note r=michael This is a rather generic class which is useful in a lot of 
     35 *                 situations - does it belong here? 
    3436 */ 
    3537class RTCNonCopyable 
     
    4951 * 
    5052 * @warning This template *must* be specialised for the types it is to work with. 
     53 * @note r=michael This could also be used in other contexts to get the value 
     54 *                 of the nil handle for a type. 
    5155 */ 
    5256template <class T> 
     
    5761} 
    5862 
     63/** Specialisation of RTAutoResNil for RTFILE */ 
     64template <> 
     65inline RTFILE RTAutoResNil(void) 
     66{ 
     67    return NIL_RTFILE; 
     68} 
    5969 
    6070/** 
     
    6979    NOREF(aHandle); 
    7080} 
    71  
    7281 
    7382/** 
     
    8998 * @param   T           The type of the resource. 
    9099 * @param   Destruct    The function to be used to free the resource. 
    91  *                      This is *not* optional, the default is there for 
    92  *                      working around compiler issues (?). 
     100 *                      This parameter must be supplied if there is no 
     101 *                      specialisation of RTAutoDestruct available for @a T.  
    93102 * @param   NilRes      The function returning the NIL value for T. Required. 
    94  *                      This is *not* optional, the default is there for 
    95  *                      working around compiler issues (?). 
     103 *                      This parameter must be supplied if there is no 
     104 *                      specialisation of RTAutoResNil available for @a T.  
    96105 * 
    97106 * @note    The class can not be initialised directly using assignment, due 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy