IStringGeneratorMemberFn

The IStringGeneratorMemberFn template class is an IStringGeneratorFn-derived class. It dispatches C++ member functions against an object to generate an IString. These objects represent member functions of class T, where T is the template argument. Objects of this class apply the stored member function against class T objects in the stringFor member function, where object is a reference to a class T object.

The constructor for these objects requires a pointer to a class T member function; this member function returns an IString and accepts no arguments. Subclass this class to support member functions with additional parameters.

The following example creates an IStringGeneratorMemberFn object:

      class MyClass {
      public:
        IString myString()
        {
         // Code to generate a string
        }
       // ......
      };
      //...
      MyClass myObj;
      IStringGeneratorMemberFn * genFunction =  new
         IStringGeneratorMemberFn( MyClass::myString );


Note: Objects of the IStringGeneratorMemeberFn class require the object passed on the stringFor member function not be a pointer. IStringGeneratorRefMemberFn objects generate strings from pointers to objects.


IStringGeneratorMemberFn - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IStringGeneratorMemberFn
public:
virtual ~IStringGeneratorMemberFn()

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


[view class]
IStringGeneratorMemberFn
public:
IStringGeneratorMemberFn(IString ( T::* member ) ( ))

Create from a pointer to a member function of class T, where T is the template argument. The member function must return an IString and accept no arguments; also, it is not a const function.

member
A pointer to the member function.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


Miscellaneous Members


[view class]
stringFor
public:
virtual IString stringFor(const T& object) const

Calls the appropriate member function on the object reference parameter. The called member function is initialized from the parameter on the IStringGeneratorMemberFn constructor.

object
Reference to the object against which it dispatches the member function.
Note: The object parameter must be an object of type T (where T is the template class argument) and not a pointer.

Supported Platforms

Windows OS/2 AIX
Yes Yes Yes


IStringGeneratorMemberFn - Inherited Member Functions and Data

Inherited Public Functions

IStringGeneratorFn
IMRefCounted

Inherited Public Data

Inherited Protected Functions

IMRefCounted

Inherited Protected Data