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

NArgs Class Reference

#include <NArgs.h>

Inherited by AbsFunction::Impl< T > [private], IntFunction::Impl [private], LRSecToMinFunction::LRSecToMinFunctionImpl [private], MinOrMaxFunction< minOrMax >::Impl< T > [private], PadFunction::Impl [private], RandFunction::DoubleRandFunction [private], RandFunction::Int32RandFunction [private], RandFunction::Int64RandFunction [private], RandFunction::SingleRandFunction [private], and StrLenFunction::Impl [private].

List of all members.


Detailed Description

A sequence of arguments, each of type ptr<Expression>.


Public Member Functions

 NArgs (ptr< Expression > a=ptr< Expression >(), ptr< Expression > b=ptr< Expression >(), ptr< Expression > c=ptr< Expression >())
 Constructor.
 NArgs (const vector< ptr< Expression > > &args)
 Constructs an NArgs, setting the argument list to the contents of the vector provided.
void requireNumArgs (int args_required) const throw (ExprException)
 Throws an ExprException if the number of arguments is not equal to args_required.
void requireNumArgs (int minargs, int maxargs) const throw (ExprException)
 Throws an ExprException if the number of arguments is not between minargs and maxargs, inclusive.
void requireArgType (unsigned int index, DataType type1, DataType type2=DataType(), DataType type3=DataType(), DataType type4=DataType()) const throw ( ExprException )
 Requires that the index'th argument (zero-relative) is of one of the provided types.
const ptr< Expression > & arg (unsigned int idx) const
 Returns the idx'th argument (zero-relative).
unsigned int numArgs () const
 Returns the number of arguments.
const ptr< Expression > & operator[] (unsigned int idx) const
 Returns the idx'th argument (zero-relative).
unsigned int size () const
 Returns the number of arguments.
bool empty () const
 Returns true iff there are zero arguments.

Static Public Attributes

const int VARARGS = -1
 Indicates that an arbitrary number of arguments are allowed.

Protected Attributes

vector< ptr< Expression > > _args


Constructor & Destructor Documentation

NArgs::NArgs ptr< Expression a = ptr< Expression >(),
ptr< Expression b = ptr< Expression >(),
ptr< Expression c = ptr< Expression >()
 

Constructor.

Each non-null argument is added to the argument list.

NArgs::NArgs const vector< ptr< Expression > > &  args  ) 
 

Constructs an NArgs, setting the argument list to the contents of the vector provided.


Member Function Documentation

const ptr< Expression > & NArgs::arg unsigned int  idx  )  const
 

Returns the idx'th argument (zero-relative).

Undefined behavior if the argument list is too short.

bool NArgs::empty  )  const
 

Returns true iff there are zero arguments.

unsigned int NArgs::numArgs  )  const
 

Returns the number of arguments.

const ptr< Expression > & NArgs::operator[] unsigned int  idx  )  const
 

Returns the idx'th argument (zero-relative).

Undefined behavior if the argument list is too short.

void NArgs::requireArgType unsigned int  index,
DataType  type1,
DataType  type2 = DataType(),
DataType  type3 = DataType(),
DataType  type4 = DataType()
const throw ( ExprException )
 

Requires that the index'th argument (zero-relative) is of one of the provided types.

void NArgs::requireNumArgs int  minargs,
int  maxargs
const throw (ExprException)
 

Throws an ExprException if the number of arguments is not between minargs and maxargs, inclusive.

(If maxargs is VARARGS, then there is no upper limit to the number of arguments allowed.)

void NArgs::requireNumArgs int  args_required  )  const throw (ExprException)
 

Throws an ExprException if the number of arguments is not equal to args_required.

unsigned int NArgs::size  )  const
 

Returns the number of arguments.


Member Data Documentation

vector<ptr<Expression> > NArgs::_args [protected]
 

const int NArgs::VARARGS = -1 [static]
 

Indicates that an arbitrary number of arguments are allowed.


The documentation for this class was generated from the following files:
Generated on Fri Nov 12 15:15:23 2004 for Borealis by doxygen 1.3.8