Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

esi::Argv Class Reference

A little iterator interface interface around arrays of strings, whereever tbey may be fetched from an ESI interface. More...

#include <ArgvInterface.h>

List of all members.

Public Methods

virtual ~Argv ()
 Default destructor. More...

virtual const char * get (int index)=0
virtual int getArgCount ()=0
virtual void appendArg (const char *arg)=0
 Copy the arg given into the next slot in the argv. More...


Detailed Description

A little iterator interface interface around arrays of strings, whereever tbey may be fetched from an ESI interface.

In particular: Exists because we want a simple, abstract alternative to the STL. Implementors are free to use the STL underneath this interface if they so choose.

    An example of its use:
    SomeConcreteArgvImpl argvimpl;
        // perhaps the argv class from the reference implementation.
    esi::Argv *argvi = dynamic_cast<esi::Argv *>(&argvimpl);
    esi_int err;
    err = object->getRunTimeModels(argvi, char *msg);
    if (!err) {
                const char *arg;
                      for (i = 0; (arg = argvi->get(i)) != 0; i++) {
                                      do.something(arg);
                                            }
                        delete argvi;
     }
     argvi = 0;

     And inside the getRunTimeModels call, a set of calls on
        argvi->appendArg(rtmodelName[i]);
     occurs, filling in the answers.
   
This pattern keeps creation/management of all the memory associated with the Argv in the scope of the caller or internal to the Argv itself.


Constructor & Destructor Documentation

virtual esi::Argv::~Argv   [inline, virtual]
 

Default destructor.

00041 {}


Member Function Documentation

virtual const char* esi::Argv::get int    index [pure virtual]
 

Returns:
the ith element of argv (not to be modified) if exists. returns 0 otherwise.

virtual int esi::Argv::getArgCount   [pure virtual]
 

Returns:
the current number of strings. This number obviously changes when appendArg

virtual void esi::Argv::appendArg const char *    arg [pure virtual]
 

Copy the arg given into the next slot in the argv.


The documentation for this class was generated from the following file:
Generated on Tue Aug 20 14:30:31 2002 for CCA Specification/Proposals by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002