好的,所以我把这个 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];