티스토리 뷰

System.SysUtils.Supports

Delphi

function Supports(const Instance: IInterface; const IID: TGUID; out Intf): Boolean;

function Supports(const Instance: TObject; const IID: TGUID; out Intf): Boolean;

function Supports(const Instance: IInterface; const IID: TGUID): Boolean;

function Supports(const Instance: TObject; const IID: TGUID): Boolean;

function Supports(const AClass: TClass; const IID: TGUID): Boolean;

C++

extern PACKAGE bool __fastcall Supports(const System::_di_IInterface Instance, const GUID &IID, /* out */ void *Intf)/* overload */;

Properties

Type

Visibility

Source

Unit

Parent

function

public

System.SysUtils.pas

System.SysUtils.hpp

System.SysUtils

System.SysUtils

Description

Indicates whether a given object or interface supports a specified interface.

Call Supports to determine whether the object or interface specified by Instance, or the class specified by AClass, supports the interface identified by the IID parameter.

If Instance supports the interface, Supports returns the interface as the Intf parameter and returns True.

If AClass supports the interface, Supports does not return an interface, but still returns True.

If the interface specified by IID is not supported, Supports returns False.


주어진 객체 또는 인터페이스가 지정된 인터페이스를 지원하는지 여부를 나타냅니다.

Supports 를 호출하여 Instance에 의해 지정된 객체나 인터페이스 또는 AClass에 의해 지정된 클래스가 IID 매개변수로 식별되는 인터페이스를 지원하는지 여부를 알아냅니다.

Instance가 인터페이스를 지원하면, Supports 인터페이스를 Intf 매개변수로 반환하고 True를 반환합니다.

AClass가 인터페이스를 지원하면, Supports는 인터페이스를 반환하지 않지만, 여전히 True를 반환합니다.

IID에 의해 지정된 인터페이스가 지원되지 않으면, SupportsFalse를 반환합니다.

 

On the Win32 platform, to determine whether the interface specified by IID is supported, Supports calls the QueryInterface method of the supplied interface (or the interface of the supplied object).

However, unlike calling QueryInterface directly, Supports lets you pass a nil (Delphi) or NULL (C++) value as the instance.

On the .NET platform, Supports uses the typecasting facilities of the .NET framework.


Win32 플랫폼에서 IID로 지정된 인터페이스가 지원되는지 여부를 알아내기 위해 Supports 제공된 인터페이스 (또는 제공된 개체의 인터페이스)QueryInterface 메서드를 호출합니다.

그러나 QueryInterface를 직접 호출하는 것과 달리 Supports에서는 instance nil (Delphi) 또는 NULL (C ++) 값을 전달할 수 있습니다.

.NET 플랫폼에서 Supports .NET Framework typecasting 기능을 사용합니다.

 

Warning

With the exception of the overload that checks whether a TClass implements an interface, all the other versions of Supports will extract an interface reference either from an object or from another interface reference, causing the reference count of the underlying object to be incremented, and then will release the interface upon exit (decrementing the reference count).

For objects that have a reference count of zero, this will result in the object destruction.


TClass 가 인터페이스를 구현하는지 여부를 검사하는 오버로드를 제외하고, Supports 의 다른 모든 버전은 객체 또는 다른 인터페이스 참조에서 인터페이스 참조를 추출하여, 기본 객체의 참조 카운트를 증가시킨 다음, 종료 시 인터페이스를 해제합니다 (참조 카운트를 감소시킵니다).

참조 카운트가 0 인 객체의 경우 객체가 파손됩니다.

 

Example

var

  Obj: TInterfacedObject;

begin

  Obj := TInterfacedObject.Create;

  if Supports(Obj, IInterface) then { ... at this point Obj will be freed }

end;

 

determine 미국식 [dɪ|t3:rmɪn]   영국식 [dɪ|t3:mɪn]   중요

1. 알아내다, 밝히다
2. (
무엇의 방식유형을) 결정하다
3. (
공식적으로) 확정하다

facilities 영국식   

1. (화학공학) 설비(設備)
2.
시설(施設)

facility (facilities) 미국·영국 [fə|sɪləti]   중요

1. (생활의 편의를 위한) 시설
2. (
기계서비스 등의 특수) 기능
3. (
특정 목적활동용 장소나 건물을 가리키는) 시설

underlying 미국식 [|ʌndər|laɪɪŋ]   영국식 [|ʌndə|laɪɪŋ]   중요

1. (겉으로 잘 드러나지는 않지만) 근본적인
2. (
다른 것의) 밑에 있는

 

출처: http://docwiki.embarcadero.com/Libraries/XE2/en/System.SysUtils.Supports

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함