高级C ++接口 - 跟踪Kinect SKD 2.0代码 [英] Advanced C++ interfaces -- Tracing Kinect SKD 2.0 code
问题描述
我正在尝试熟悉c ++中的Kinect 2.0 SDK,以便创建自己的程序。但是,我很难理解一些代码。首先,当我试图追溯不同的结构声明时,我发现所有的函数都是虚函数,我无法找到它们实际定义的位置。
例如,如果你在visual studio中,点击'IBody'并打开声明,它会带你进入一切都是虚拟的界面。如何确定实际定义的所有内容?
I am trying to get familiar with the Kinect 2.0 SDK in c++ in order to create my own program. However, I am getting stuck with understanding some of the code. First of all, as I tried to trace back different structure declarations, I found that all of the functions are virtual and I cannot find where they are actually defined. For example, If you are in visual studio, and click on 'IBody' and open declaration, it brings you to an interface where everything is virtual. How can I figure out where everything is actually defined?
我尝试追溯其他功能,最终我陷入了GetDefaultKinectSensor。该函数的定义是
I tried tracing back through other functions, and I eventually got stuck on "GetDefaultKinectSensor". The definition for this function is
HRESULT WINAPI GetDefaultKinectSensor(_COM_Outptr_ IKinectSensor** defaultKinectSensor);
这是一个函数声明?任何人都可以向我解释这个吗?
How is this a function declaration? Could anyone explain this to me?
我理解C ++的基础知识,但对我来说这是一个新的领域。
I understand the basics of C++ but this is new territory for me.
谢谢!
推荐答案
这是一个具有以下功能的功能签名:
It is a function that has the following signature:
HRESULT WINAPI GetDefaultKinectSensor(_COM_Outptr_ IKinectSensor** defaultKinectSensor);
//^return type ^calling convention ^name ^annotation ^argument type
命名 - GetDefaultKinectSensor
返回 - HRESULT
调用约定 - WINAPI
参数注释 - _COM_Outptr _
参数类型 - IKinectSensor **
named - GetDefaultKinectSensor
returns - HRESULT
calling convention - WINAPI
argument annotation - _COM_Outptr_
argument type - IKinectSensor**
请注意 _COM_Outptr _
注释具有以下描述:
Note that the _COM_Outptr_
annotation has the following description:
返回的指针具有COM语义,因此带有_On_failure_后置条件,返回的指针为空。
The returned pointer has COM semantics, and therefore carries an _On_failure_ post-condition that the returned pointer is null.
裸函数签名将是
HRESULT GetDefaultKinectSensor(IKinectSensor** defaultKinectSensor);
也许调用约定和参数注释会让你失望。
Perhaps the calling convention and argument annotation are throwing you off a bit.
这篇关于高级C ++接口 - 跟踪Kinect SKD 2.0代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!