Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Method Class Reference

Base class for dynamic method invocation Methods are dynamically invokable and can support querying for argument types querying is done throught the getArgumentType() method and will only work if the argTypes_ string has bee set appropriately. More...

#include <vcf/FoundationKit/Method.h>

List of all members.

Public Member Functions

 Method ()
virtual ~Method ()
virtual VariantData invoke (VariantData **arguments, Object *source=NULL)=0
 invoke the method on the source object We don't need the number of elements in the arguments[] because argCount_ should be set and we can use these.
String getName ()
 returns the name of the method
void setName (const String &name)
 sets the name of the method
uint32 getArgCount ()
 returns the numbers of arguments required to invoke the method.
bool hasReturnValue ()
 specifies whether or not the method has a return value
virtual ObjectgetSource ()=0
 returns the bound source of the method - may return NULL if no source has been set
virtual void setSource (Object *source)=0
 sets the source of the object
virtual void setSource (const Object *source)=0
PropertyDescriptorType getArgumentType (const uint32 &argumentIndex)
 returns the argument type for the specified argument
virtual Methodclone ()=0

Protected Attributes

String argTypes_
uint32 argCount_
bool hasReturnValue_
String name_


Detailed Description

Base class for dynamic method invocation Methods are dynamically invokable and can support querying for argument types querying is done throught the getArgumentType() method and will only work if the argTypes_ string has bee set appropriately.

This string consists of a series of characters each of which are interpreted as a special code for the primitive type. The code table is as follows:

      code  |   primitive type
    ----------------------------
      "i"   |       integer
      "l"   |       long
      "h"   |       short
      "+l"  |       unsigned long
      "f"   |       float
      "c"   |       char
      "d"   |       double
      "o"   |       Object*
      "b"   |       bool
      "s"   |       String or String&
      "e"   |       Enum*

To create an instance of a Method object use one of the template based classes described below.


Constructor & Destructor Documentation

VCF::Method::Method  )  [inline]
 

virtual VCF::Method::~Method  )  [inline, virtual]
 


Member Function Documentation

virtual Method* VCF::Method::clone  )  [pure virtual]
 

uint32 VCF::Method::getArgCount  )  [inline]
 

returns the numbers of arguments required to invoke the method.

PropertyDescriptorType VCF::Method::getArgumentType const uint32 argumentIndex  )  [inline]
 

returns the argument type for the specified argument

Parameters:
uint32 a zero based index representing a particular argument. For a method declared like this void someMethod( bool, int ) then an index of 0 would represent the frist argument (bool), and index 1 would represnt the second argument(int).
Returns:
PropertyDescriptorType the argument type

String VCF::Method::getName  )  [inline]
 

returns the name of the method

virtual Object* VCF::Method::getSource  )  [pure virtual]
 

returns the bound source of the method - may return NULL if no source has been set

bool VCF::Method::hasReturnValue  )  [inline]
 

specifies whether or not the method has a return value

Returns:
bool true if the method has a return value otherwise false

virtual VariantData VCF::Method::invoke VariantData **  arguments,
Object source = NULL
[pure virtual]
 

invoke the method on the source object We don't need the number of elements in the arguments[] because argCount_ should be set and we can use these.

If this is not the case then the programmer has screwed up somewhere ! the source argument may be NULL, in this case the implementing code should Assumes setSource() has already been called this would have gotten set when the class or interface the method belonged to was retreived from the Object in question

void VCF::Method::setName const String name  )  [inline]
 

sets the name of the method

virtual void VCF::Method::setSource const Object source  )  [pure virtual]
 

virtual void VCF::Method::setSource Object source  )  [pure virtual]
 

sets the source of the object


Member Data Documentation

uint32 VCF::Method::argCount_ [protected]
 

String VCF::Method::argTypes_ [protected]
 

bool VCF::Method::hasReturnValue_ [protected]
 

String VCF::Method::name_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information