COMTypedList-class        package:RDCOMClient        R Documentation

_C_l_a_s_s_e_s _f_o_r _r_e_p_r_e_s_e_n_t_i_n_g _D_C_O_M _o_b_j_e_c_t_s _t_h_a_t _h_a_v_e _l_i_s_t-_l_i_k_e _f_a_c_i_l_i_t_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These classes extend the basic 'COMList'. They are used to
     represent DCOM types that have methods that support a list-like
     interface.  In Office applications, this means that they have
     methods  named 'Item' and 'Count' which correspond to index
     accessors ('[[') and 'length' in R. We can therefore make these
     objects feel more  like R lists using methods defined for these
     classes.

     Like 'COMList-class', these classes are not intended to be used
     directly, but  are to be used in creating derived or sub-classes.

     These particular classes provide additional functionality for the
     'COMList-class' by specifying the type of the elements.
     'COMTypedList' knows that its elements have a type/class name
     given by the singular of its own class.  For example, if we had a
     class named 'Workbooks' that extended 'COMTypedList', then
     elements returned via its 'Item' method would be coerced to class
     'Workbook' the singular of 'Workbooks'.

     The class 'COMTypedNamedList' does essentially the same thing, but
     does not rely on the class name of its elements being the singular
     form of its own class name. Instead, the class name is stored with
     the 'COMTypedNamedList' object and is used to coerce an element
     returned from the 'Item' method to the appropriate R class. (If we
     had class slots in the S4 system, we would  use that rather than
     putting the name into each instance of a class. However, the
     overhead is small.) This is used, for example, in the case of our
     'Workbooks' illustration above. In Excel, the 'Workbooks' type
     behaves like a list but returns elements which are of class
     '_Workbook'. In this case, the 'name' field in the derived class
     'Workbooks' would be  '_Workbook' and elements would be coerced to
     that R type.

     These classes form part of the run-time infrastructure for
     "compiled" or pre-processed classes to DCOM interfaces that  are
     generated from the type library describing a collection of COM
     interfaces. See the 'SWinTypeLibs' package and the
     'generateInterface' function.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created from these classes manually using the
     familiar 'new' function. However, when used in the "compiled" DCOM
     interfaces, they are automatically created as return values or
     arguments in methods where appropriate.

_S_l_o_t_s:


     '_r_e_f': Object of class '"externalptr"', inherited

     '_n_a_m_e': character string (i.e. vector of length 1). This is the
          field in the 'COMTypedNamedList' that specifies the name of
          the class for an element of the list.

_E_x_t_e_n_d_s:

     Class '"COMList"', directly. Class '"COMIDispatch"', by class
     '"COMList"'. Class '"IUnknown"', by class '"COMList"'.

_M_e_t_h_o_d_s:


     [[ 'signature(x = "COMTypedList", i = "ANY")': get the i-th
          element of the DCOM list and coerce the result to the
          appropriate type specified by the type of elements associated
          with the class.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang (duncan@wald.ucdavis.edu)

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/RDCOMClient> <URL:
     http://www.omegahat.org/RDCOMServer> <URL:
     http://www.omegahat.org/SWinTypeLibs> <URL:
     http://www.omegahat.org/SWinRegistry>

_S_e_e _A_l_s_o:

     'COMList-class' '.COM'

