SourceForge has been redesigned. Learn more.
Close

#53 Delphi Interfaces aren't translated correctly

open
nobody
5
2006-01-17
2006-01-17
No

Given the following constructs:

{* Implement this interface so that an object can read/write
its own settings.
Register the @ref TMgSettingsSelfStoringObjectHandler to
handle objects
that implement this interface.
}
IMgSettingsSelfStoringObject = interface
['{6C9661CD-9AC4-47C2-ABC0-ABFF65A72964}']
{ Read settings using the given cursor.
}
procedure ReadSettings( aCursor: TMgSettingsCursor );
{ Write settings using the given cursor.
}
procedure WriteSettings( aCursor: TMgSettingsCursor );
{ Called before reading settings; use for clearing lists
or other sub-objects.
}
procedure InitializeSettings;
{ Unique name under which the settings are stored.
}
function HandlerIdForSettings: string;
end {IMgSettingsSelfStoringObject};

{* Use this base class to make an object work with the
@ref TMgSettingsSelfStoringObjectHandler. Implements some
of the
@ref IMgSettingsObjectHandler methods. @ref ReadSettings
and
@ref WriteSettings must be implemented by the object
itself.

Note: This object descends from TPersistent so that it
can be automatically
created by Delphi when CreateObject is used to read it
from file. Therefore,
it needs to copy the implementation of the basic
interface methods from
TMgInterfacedObjectNRC.
}
TMgSettingsSelfStoringObject = class( TPersistent, IUnknown,
IMgSettingsSelfStoringObject )
public
function QueryInterface(const IID: TGUID; out Obj):
HResult; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;
public
procedure ReadSettings( aCursor: TMgSettingsCursor );
virtual; abstract;
procedure WriteSettings( aCursor: TMgSettingsCursor );
virtual; abstract;
procedure InitializeSettings; virtual;
function HandlerIdForSettings: string; virtual;
end {TMgSettingsSelfStoringObject};

It should process the interfaces as something reasonable ... I'
m just not sure what the source format for Doxygen is. If it's
C++, there are no interfaces, so you'd have to generate an
abstract class with the interface definition and allow Doxygen
to view uses of interfaces as multiple inheritance. If the
source format can include Java, then the interface can be
translated directly. Regardless, the GUID under the class
name, though optional, must be processed and discarded.

Discussion


Log in to post a comment.