 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Andrea Raimondi Guest
|
Posted: Mon Dec 27, 2004 11:58 am Post subject: Interfaces again: GetItem differs from declaration in interf |
|
|
Hey Peers,
It seems I'm missing something trivial here.
The IList implementation compiles fine, but IAttributeList one isn't
willing to work whatever I'm doing.
This is my IList implementation interface(compiles fine):
TConcreteList = class( TInterfacedObject, IList )
private
FIntfList : TInterfaceList;
protected
procedure AddItem(AnItem: IListItem);overload;virtual;
procedure AddItem( AStream : TStream );overload;virtual;abstract;
procedure AddItem( AString : String );overload;virtual;abstract;
function GetAsString: String;virtual;abstract;
function GetCount: Integer;
function GetIListItem(Index: Integer): IListItem;
// Method resolution for IList
function IList.GetItem = GetIListItem;
public
procedure AfterConstruction;override;
destructor Destroy;override;
end;
The basic idea is that I'll manage my interface list with TInterfaceList
class.
Now, I have this class which implements an attribute list:
TAttributeList = class( TConcreteList, IList, IAttributeList )
protected
procedure AddItem(AnItem: IAttribute);overload;
procedure AddItem( AStream : TStream );overload;override;
procedure AddItem( AString : String );overload;override;
function GetAsString: String;override;
function GetItem(Index: Integer): IAttribute;
end;
Compiler complains about the error message in subject. I think I'm
missing something very very basic but I've no clue what.
Any help?
TIA,
Andrew
--
Online thoughts blog
http://araimondi.blogspot.com
|
|
| Back to top |
|
 |
Joanna Carter (TeamB) Guest
|
Posted: Mon Dec 27, 2004 12:06 pm Post subject: Re: Interfaces again: GetItem differs from declaration in in |
|
|
"Andrea Raimondi" <rainaple (AT) tin (DOT) it> a écrit dans le message de news:
41cff78b$1 (AT) newsgroups (DOT) borland.com...
| Quote: | TAttributeList = class( TConcreteList, IList, IAttributeList )
protected
procedure AddItem(AnItem: IAttribute);overload;
procedure AddItem( AStream : TStream );overload;override;
procedure AddItem( AString : String );overload;override;
function GetAsString: String;override;
function GetItem(Index: Integer): IAttribute;
end;
Compiler complains about the error message in subject. I think I'm
missing something very very basic but I've no clue what.
|
Yes, don't include IList in the declaration of TAttributeList and also you
may have to mark both the base and derived GetItem methods as overload.
Joanna
--
Joanna Carter (TeamB)
Consultant Software Engineer
TeamBUG support for UK-BUG
TeamMM support for ModelMaker
|
|
| Back to top |
|
 |
Andrea Raimondi Guest
|
Posted: Mon Dec 27, 2004 1:55 pm Post subject: Re: Interfaces again: GetItem differs from declaration in in |
|
|
Joanna Carter (TeamB) wrote:
| Quote: | Yes, don't include IList in the declaration of TAttributeList and also you
may have to mark both the base and derived GetItem methods as overload.
|
This is the new declaration:
TAttributeList = class( TConcreteList, IAttributeList )
private
function GetItem(Index: Integer): IAttribute;
protected
procedure AddItem(AnItem: IAttribute);overload;
procedure AddItem( AStream : TStream );overload;override;
procedure AddItem( AString : String );overload;override;
function GetAsString: String;override;
function GetAttributeItem(Index: Integer): IAttribute;
function IAttributeList.GetItem = GetAttributeItem;
end;
It only shows the same error, but it seems correct to me.
Anything I may be doing wrong?
Cheers,
Andrew
--
Online thoughts blog
http://araimondi.blogspot.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|