Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image OpenDDS IDL序列类型_Image_Sequence_Idl_Opendds - Fatal编程技术网

Image OpenDDS 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字节/像素; 像素数据; }; 我还想

我正在尝试使用以下IDL发布视频帧:

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];