1

在尝试将数组或序列添加到 idl 文件中定义的函数时,例如

  // BackupDaemon.idl

  interface BackupDaemon;

  #ifndef BackupDaemon_idl
  #define BackupDaemon_idl

 typedef sequence<BackupDaemon> BackupDaemonList;

 #include "BackupExceptions.idl"


 interface BackupDaemon {



     boolean startBackup(in sequence<string> backupPathes ,in string backupDaemonMacAddress);

 };

 #endif 

我收到以下错误:-

Expected one of `float' `double' `long' `short' `un
signed' `char' `wchar' `boolean' `octet' `any' `string' `wstring' `<identifier>'
 `::' `ValueBase'; encountered `sequence'.
     boolean startBackup(in sequence<string> backupPathes ,in string backupDaemo
nMacAddress);

那么如何将数组或序列传递给 idl 文件中定义的函数呢?提前致谢。^

4

1 回答 1

2

序列不能直接用于 CORBA 操作。你首先需要typedef他们:

typedef sequence<string> BackupPathesStrings;

interface BackupDaemon {
     boolean startBackup(in BackupPathesStrings backupPathes, in string backupDaemonMacAddress);
 };

请参阅:序列和数组

于 2012-11-25T18:23:24.177 回答