我正在使用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版本。

提前致谢。

最佳答案

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

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

关于c++ - tao_idl -GSTL不映射std::string,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52595054/

10-11 22:23
查看更多