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:
Constructors & DestructorYou can construct and destruct objects of this class.
![]() |
public:
virtual ~IStringGeneratorMemberFn()
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
![]() |
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.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
Miscellaneous Members![]() |
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.
| Windows | OS/2 | AIX |
| Yes | Yes | Yes |
virtual ~IStringGeneratorFn()
IStringGeneratorFn()
virtual IString stringFor(const T& object) const = 0
void addRef()
unsigned long count() const
void removeRef()
virtual ~IMRefCounted()
IMRefCounted()
IMRefCounted(const IMRefCounted&)
IMRefCounted& operator =(const IMRefCounted&)