【问题标题】:tao_idl -Gstl doesn't map std::stringtao_idl -Gstl 不映射 std::string
【发布时间】:2018-10-01 16:14:26
【问题描述】:

我正在使用 opendds 和 tao/ace 从 idl 文件生成代码。

我的 idl 文件:

struct SSave
{
    string strr;
};

我这样生成代码:

opendds_idl Class.idl 
tao_idl -Gstl -I/usr/include/ Class.idl 
tao_idl -Gstl -I/usr/include/ ClassTypeSupport.idl
#-Gstl Generate the alternate C++ mapping for IDL strings and sequences

这是我在文件 ClassC.h 中得到的内容,例如:

#include <vector>    
#include <string> //inclusion of string
{...}
struct  SSave
{

    // TAO_IDL - Generated from
    // /build/opendds-3.13/ACE_TAO/TAO/TAO_IDL/be/be_type.cpp:304
    typedef SSave_var _var_type;
    typedef SSave_out _out_type;

    static void _tao_any_destructor (void *); 

    ::TAO::String_Manager strr; //NOT std::string
};
{...}

那么有没有办法告诉 TAO 映射 std::string 而不是 ::TAO::String_Manager?

注意:我使用的是 tao_idl 2.5.1 版本。

提前致谢。

【问题讨论】:

    标签: c++ opendds


    【解决方案1】:

    OpenDDS 遵循 IDL 到 C++ 语言的映射,将 IDL 字符串映射到它自己的特定类型(如 tao_idl 生成的那样)。作为AXCIOMA 的一部分,我们为DDS 实现了IDL to C++11 语言映射,它将在下一个主要版本中支持OpenDDS。

    顺便说一句,你已经在 OpenDDS 邮件列表上询问了this 并在那里得到了回复。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-25
      • 2014-06-25
      相关资源
      最近更新 更多