Parameter passing conventions

The convention used for passing objects on Foundation Classes method calls is if the object is mandatory, pass by reference; if it is optional pass by pointer.

For example, consider method start of class IccStartRequestQ, which has the following signature:
const IccRequestId& start( const IccTransId& transId,
                           const IccTime* time=0,
                           const IccRequestId* reqId=0 );
Using the preceding convention, we see that an IccTransId object is mandatory, while an IccTime and an IccRequestId object are both optional. This enables an application to use this method in any of the following ways:
  IccTransId      trn("ABCD");
  IccTimeInterval int(0,0,5);
  IccRequestId    req("MYREQ");
  IccStartRequestQ* startQ = startRequestQ();
  startQ->start( trn );
  startQ->start( trn, &int );
  startQ->start( trn, &int, &req );
  startQ->start( trn, 0, &req );


dfhal1s.html | Timestamp icon Last updated: Thursday, 27 June 2019