esi_Argv(3)

esi::Argv(3) 'Classic' CCA c++ binding (ccaffeine-only) esi::Argv(3)

NAME

esi::Argv -

Simplest string container interface, ala C's argv.

SYNOPSIS

#include <ArgvInterface.h>

Public Member Functions


virtual ~Argv ()
Default destructor. virtual const char * get (int index) CLASSIC_CCA_PURE
virtual int getArgCount () CLASSIC_CCA_PURE
virtual void appendArg (const char *arg) CLASSIC_CCA_PURE
Copy the arg given into the next slot in the argv.

Detailed Description

Simplest string container interface, ala C's argv.

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.

{}

Member Function Documentation

virtual const char* esi::Argv::get (intindex) [virtual] Returns:

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

virtual int esi::Argv::getArgCount () [virtual] Returns:

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

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

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

Author

Generated automatically by Doxygen for 'Classic' CCA c++ binding (ccaffeine-only) from the source code.

Tue Nov 12 2013 Version 0.5.7