Class ComInterface

java.lang.Object
net.codecrete.windowsapi.metadata.Type
net.codecrete.windowsapi.metadata.ComInterface

public final class ComInterface extends Type
COM interface type.

A COM interface is a mostly opaque object-oriented data structures. It can only be accessed and manipulated through functions.

At the start of the data structure, there is a pointer to an array of function pointers, often called "vtable" after the similar C++ construct. Thees function pointers are the function to access and manipulate the COM object instance.

This class defines the method/function signatures, the COM interface ID and the implemented super interface type.

  • Constructor Details

    • ComInterface

      public ComInterface(String name, Namespace namespace, int typeDefIndex, UUID iid)
      Creates a new instance.
      Parameters:
      name - the COM interface name
      namespace - the COM interface's namespace
      typeDefIndex - the TypeDef index
      iid - the COM interface ID
  • Method Details

    • getIid

      public UUID getIid()
      Gets the COM interface ID (IID).
      Returns:
      the IID
    • implementedInterface

      public ComInterface implementedInterface()
      Gets the implemented super interface.

      All COM interfaces implement the IUnknown interface, either directly or indirectly by implementing a super COM interface that does. The only exception is IUnknown itself.

      Returns:
      the super interface, or null if no super interface is implemented.
    • setImplementedInterfaces

      public void setImplementedInterfaces(List<ComInterface> implementedInterfaces)
      Sets the implemented COM interfaces.

      Even though this method accepts a list, it assumes that at most one interface is implemented.

      Parameters:
      implementedInterfaces - list of COM interface types.
    • methods

      public List<Method> methods()
      Gets the methods that make up the interface of this COM interface.

      The list of methods does not include the methods inherited from implemented super interfaces.

      Returns:
      the methods
    • setMethods

      public void setMethods(List<Method> methods)
      Sets the methods that make up the interface of this COM interface.

      The list of methods may not include the methods inherited from implemented super interfaces.

      Parameters:
      methods - the methods
    • referencedTypes

      public Stream<Type> referencedTypes()
      Description copied from class: Type
      Returns the types directly references by this type.
      Overrides:
      referencedTypes in class Type
      Returns:
      Stream of types