[Enterprise Extensions only]

ORB::create_list

Overview Creates a CORBA::NVList object.
Original class CORBA::ORB
Exceptions CORBA::SystemException


Intended Usage

This method is intended to be used to create a CORBA::NVList object, when using the Dynamic Invocation Interface (DII), to be passed to the CORBA::Object::create_request method. The caller specifies the length of the NVLIst to be created; upon return, the new NVList contains the specified number of (uninitialized) items. The caller must initialize the items in the NVList (or add new items) prior to passing it to the CORBA::Object::create_request method. Note, however, that since there is no mechanism for updating the flags of a NamedValue already contained by an NVList, it is advisable to create the list initially empty (that is, pass zero as the count), and then initialize the list by adding (initialized) CORBA::NamedValue objects to it, using the method s on CORBA::NVList.

See also ORB::create_operation_list and Object::_request.

IDL Syntax

  CORBA::Status create_list (CORBA::Long count,
                             CORBA::NVList_ptr& nvlist);

Input parameters

count
The number of elements in the CORBA::NVList to be created. A zero value is valid.
nvlist
A pointer for a CORBA::NVList, passed by reference, to be initialized by the CORBA::ORB::create_list method. The caller assumes ownership of the NVList object, but if the same object is passed to the CORBA::Object::create_request method, the Request object assumes ownership of the NVList.

Return values

CORBA::Status
A zero return value indicates success.

Example

  /* The following program creates a CORBA::create_list object and
     generates a system exception if appropriate
   */
  #include "corba.h"
  #include   CORBA::Long NUMITEMS = 3;
  int main(int argc, char* argv[])
  {
    int rc = 0;
    CORBA::NVList_ptr NVLptr = CORBA::NVList::_nil();
    /* assume orb initialized */
    extern CORBA::ORB_ptr orb;
 
    try
    {
      CORBA::Status st = orb->create_list(NUMITEMS, NVLptr);
    }
    catch (CORBA::SystemException &se)
    {
      cout << "exception: " << se.id() << endl; rc="1;"
    }
    return rc;
  }