getNumCConverters            package:base            R Documentation

_M_a_n_a_g_e_m_e_n_t _o_f ._C _a_r_g_u_m_e_n_t _c_o_n_v_e_r_s_i_o_n _l_i_s_t

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

     These functions provide facilities to manage the extensible list
     of converters used to translate R objects to C pointers for use in
     '.C' calls. The number and a description of each element in the
     list  can be retrieved. One can also query and set the activity
     status of individual elements, temporarily ignoring them. And one
     can remove individual elements.

_U_s_a_g_e:

     getNumCConverters()
     getCConverterDescriptions()
     getCConverterStatus()
     setCConverterStatus(id, status)
     removeCConverter(id)

_A_r_g_u_m_e_n_t_s:

      id: either a number or a string identifying the element of
          interest in the converter list. A string is matched against
          the description strings for each element to identify the
          element. Integers are specified starting at 1 (rather than
          0).

  status: a logical value specifying whether the element is to be
          considered active ('TRUE') or not ('FALSE').

_D_e_t_a_i_l_s:

     The internal list of converters is potentially used when
     converting individual arguments in a '.C' call.  If an argument
     has a non-trivial class attribute, we iterate over the list of
     converters looking for the first that "matches".  If we find a
     matching converter, we have it create the C-level pointer
     corresponding to the R object.  When the call to the C routine is
     complete, we use the same converter for that argument to reverse
     the conversion and create an R object from the current value in
     the C pointer. This is done separately for all the arguments.

     The functions documented here provide R user-level capabilities
     for investigating and managing the list of converters. There is
     currently no mechanism for adding an element to the converter list
     within the R language. This must be done in C code using the
     routine 'R_addToCConverter()'.

_V_a_l_u_e:

     'getNumCConverters' returns an integer giving the number of
     elements in the list, both active and inactive.

     'getCConverterDescriptions' returns a character vector containing
     the description string of each element of the converter list.

     'getCConverterStatus' returns a logical vector with a value for
     each element in the converter list. Each value indicates whether
     that converter is active ('TRUE') or inactive ('FALSE'). The names
     of the elements are the description strings returned by
     'getCConverterDescriptions'.

     'setCConverterStatus' returns the logical value indicating the
     activity status of the specified element before the call to change
     it took effect.  This is 'TRUE' for active and 'FALSE' for
     inactive.

     'removeCConverter' returns 'TRUE' if an element in the converter
     list was identified and removed. In the case that no such element
     was found, an error occurs.

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

     Duncan Temple Lang

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

     <URL: http://developer.R-project.org/CObjectConversion.pdf>

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

     '.C'

_E_x_a_m_p_l_e_s:

      getNumCConverters()
      getCConverterDescriptions()
      getCConverterStatus()
     ## Not run: 
       old <- setCConverterStatus(1,FALSE)

       setCConverterStatus(1,old)
     ## End(Not run)
     ## Not run: 
       removeCConverter(1)
       removeCConverter(getCConverterDescriptions()[1])
     ## End(Not run)

