.. oe:namespace:: OEDataFlow


.. meta::
   :keywords: OEMakeMatchField OERecord datarecord


.. oe:function:: OEMakeMatchField

   .. oe:language:: c++

      .. oe:api::

         template<typename T> OEField<T> OEMakeMatchField(const std::string& name,
                                                          const OEFieldType<T>& t,
                                                          OEFieldMeta meta = OEFieldMeta(),
                                                          bool readonly = false,
                                                          bool nullable = false)

         template<type T>OEMakeMatchField(const std::string& name,
                                          const OEVectorFieldType<T>& t,
                                          OEFieldMeta meta = OEFieldMeta(),
                                          bool readonly = false,
                                          bool nullable = false)
   .. oe:language:: python

      .. oe:api::

         OEMakeMatchField(name: str, t: OEFieldTypeHandler,
                          meta = OEFieldMeta = None, readonly: bool = false,
                          ol nullable = false) -> OEMatchField

   Creates an :ref:`OEMatchField <OEDataFlow_OEMatchField>` object to be
   used for adding data to, or retrieving data from, an 
   :ref:`OERecord <OEDataFlow_OERecord>` object. Match fields are used
   mainly to retrieve data from a record when you don't know the name
   of a field but know its type and associated metadata.

   name
     The name the field will be given.

   t
     This specifies the type of match field to be created. This will usually
     come from the :oe:constns:`OEDataFlow::Types` namespace.

   meta
     If this field is provided, the returned 
     :ref:`OEMatchField <OEDataFlow_OEMatchField>` object will only retrieve
     data from fields that match this metadata.

   readonly
     If true, the returned match field can only be used to read data to a
     record, not write it.

   nullable
     If true, the returned field match field will allow setting of null 
     values on a record.

   .. seealso::

      * :ref:`OEMatchField <OEDataFlow_OEMatchField>`
      * :ref:`OERecord <OEDataFlow_OERecord>`
      * :ref:`OEFieldMeta <OEDataFlow_OEFieldMeta>`


