我使用PosithPython来处理C++和Python之间的互操作性。我在c++中有enum和structure,在c++中有可以将这些结构作为参数的函数。我可以通过使用boostpython在python中访问这个函数,但是我不知道如何在python中将结构作为参数发送。Set是c++中的函数,它可以将结构参数.so在python中,如何将此结构作为参数发送。我可以在python中获得这个函数,但不能将send结构作为参数发送。谢谢你的帮助。在
c++的结构如下:
enum days
{
friday,
saturday
};
struct example
{
days m_day;
std: string m_value;
};
Class Base
{
public:
void Set(example& Result) = 0;
}
class Derived
{
public:
void Set(example& Result)
{
Result.m_day = friday;
}
您必须公开这样的结构示例,然后在python中创建此结构的变量,并将此变量作为参数发送。在
希望这会有帮助。。在
相关问题 更多 >
编程相关推荐