我正在尝试使用以下IDL发布视频帧:
typedef sequence<octet> Pixels;
module message {
@topic
struct Image {
int width;
int height;
int bytesPerPixel;
Pixels data;
};我也想发送2个图像数据序列(例如,原始和过滤)。可以通过声明为数组来排序容器,而不是声明"Pixels data2“吗?typedef sequence<octet> Pixels[2]显示错误。
发布于 2020-10-07 07:58:41
好的,我把这个IDL给了opendds_idl
typedef sequence<octet> Pixels[2];
module message {
@topic
struct Image {
unsigned short width;
unsigned short height;
unsigned short bytesPerPixel;
Pixels data;
};
};它接受了它:
opendds_idl --syntax-only test.idl
processing test.idl然而,我决定尝试用它来构建一个库,以防生成的代码出错,这似乎是真的。
testTypeSupportImpl.cpp: In function ‘bool OpenDDS::DCPS::gen_skip_over(OpenDDS::DCPS::Serializer&, Pixels_forany*)’:
testTypeSupportImpl.cpp:83:41: error: ‘sequence’ does not name a type; did you mean ‘servent’?
if (!gen_skip_over(ser, static_cast<sequence*>(0))) return false;其他错误随之而来。似乎我们不支持同时为数组和序列定义类型。用两个作品替换typedef:
typedef sequence<octet> PixelSeq;
typedef PixelSeq Pixels[2];https://stackoverflow.com/questions/64233975
复制相似问题