Image OpenDDS IDL序列类型
我正在尝试使用以下IDL发布视频帧:Image OpenDDS IDL序列类型,image,sequence,idl,opendds,Image,Sequence,Idl,Opendds,我正在尝试使用以下IDL发布视频帧: typedef sequence<octet> Pixels; module message { @topic struct Image { int width; int height; int bytesPerPixel; Pixels data; }; typedef序列像素; 模块消息{ @话题 结构映像{ 整数宽度; 内部高度; int字节/像素; 像素数据; }; 我还想
typedef sequence<octet> Pixels;
module message {
@topic
struct Image {
int width;
int height;
int bytesPerPixel;
Pixels data;
};
typedef序列像素;
模块消息{
@话题
结构映像{
整数宽度;
内部高度;
int字节/像素;
像素数据;
};
我还想发送2个图像数据序列(例如,原始和过滤)。不是声明“Pixels data2”,容器是否可以通过声明为数组来进行序列?typedef sequence Pixels[2]给出了错误。好的,所以我将此IDL提供给了
opendds\u IDL
:
typedef sequence<octet> Pixels[2];
module message {
@topic
struct Image {
unsigned short width;
unsigned short height;
unsigned short bytesPerPixel;
Pixels data;
};
};
然而,我决定尝试用它构建一个库,以防生成的代码出错,这似乎是正确的
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;
testTypeSupportImpl.cpp:bool OpenDDS::DCPS::gen_skip_over(OpenDDS::DCPS::Serializer&,Pixels_for any*)函数中:
testTypeSupportImpl.cpp:83:41:错误:“sequence”没有命名类型;您是说“servent”吗?
如果(!gen_skip_over(ser,static_cast(0)))返回false;
以下是其他错误。似乎我们不支持尝试同时定义数组和序列。将typedef替换为两个工作:
typedef sequence<octet> PixelSeq;
typedef PixelSeq Pixels[2];
typedef序列PixelSeq;
typedef PixelSeq像素[2];
int
不是有效的IDL类型。整数类型为short
(16位)、long
(32位)、long
(64位),以及这三个版本的unsigned
版本。在将int
s转换为unsigned short
s并添加一个缺少的大括号后,IDL被IDL编译器接受。您得到了什么样的错误?报告了这一上游,请确切地看到,这就是我在构建库时得到的错误。谢谢,它现在可以工作了!
typedef sequence<octet> PixelSeq;
typedef PixelSeq Pixels[2];