Main Page | Modules | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

CDLFunction Class Reference

#include <CDLInterface.hh>

Inherits CDLNamedEntity, and CDLTypedEntity.

List of all members.


Detailed Description

Parent class for all CDL Functions This class is a parent class to create Functions to be used with the CDL. Note that it is a pure virtual function, so it cannot be instantiated.


Public Member Functions

bool Register ()
bool setArgList (utils::ManagedList< CDLVariable > *args)
bool setParamList (utils::ManagedList< CDLVariable > *params)
CDLVariable * findParam (const char *)
bool removeParam (const char *)
CDLVariable * nextParam ()
int numArgs ()
CDLVariable * nextArg ()
bool nextArg (double &arg)
bool nextArg (char *&arg)
bool nextArgF (double &arg)
bool nextArgF (char *&arg)
ObjectsetupObject (Object *, const char *)
bool addBaseNode (Object *, const char *)
virtual bool preCode ()
virtual bool postCode ()
virtual double Calculate ()

Protected Attributes

int _i
int _pi
utils::ManagedList< CDLVariable > * _args
utils::ListIterator< CDLVariable > * _iter
utils::ManagedList< CDLVariable > * _params
utils::ListIterator< CDLVariable > * _piter


Member Function Documentation

bool CDLFunction::addBaseNode Object ,
const char * 
 

This method implements common functionality for adding objects to world

virtual double CDLFunction::Calculate  )  [inline, virtual]
 

This method is used for numeric functions

bool CDLFunction::nextArg double &  arg  ) 
 

These methods retrieve the next argument for a method. If an argument is not given, they return false.

CDLVariable* CDLFunction::nextArg  ) 
 

Unlike the below methods, this function returns a pointer to a CDLVariable, so the user can ascertain the type themselves, useful for functions with various possible input types. This method will return NULL at the end of the list.

bool CDLFunction::nextArgF double &  arg  ) 
 

These two methods are wrappers for the previous two. The only difference is that if it fails, these print a message and exit.

int CDLFunction::numArgs  )  [inline]
 

Returns the number of arguments given in a function call

virtual bool CDLFunction::preCode  )  [inline, virtual]
 

The following two methods are necessary for simulation functions

bool CDLFunction::Register  ) 
 

This method registers the function with the CDLInterface singleton

bool CDLFunction::setArgList utils::ManagedList< CDLVariable > *  args  )  [inline]
 

This method sets the pointer to the list of arguments, as supplied by the parser, before calling the processing sections

Object* CDLFunction::setupObject Object ,
const char * 
 

This method sets up common params like name and surface


SimLib Reference Documentation