Overview | Creates a CORBA::NVList object. |
Original class | CORBA::ORB |
Exceptions | CORBA::SystemException |
Intended Usage
This method is 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: 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.
Syntax
CORBA::Status create_list (CORBA::Long count, CORBA::NVList_ptr& nvlist);
Input parameters
Return values
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; }