enum_in_struct.idl

来自「这是广泛使用的通信开源项目,对于大容量,高并发的通讯要求完全能够胜任,他广泛可用」· IDL 代码 · 共 85 行

IDL
85
字号
// enum_in_struct.idl,v 1.3 2004/01/10 00:04:15 bala Exp

// ============================================================================
//
// = LIBRARY
//    TAO/tests/IDL_Test
//
// = FILENAME
//    enum_in_struct.idl
//
// = DESCRIPTION
//    This file contains examples of IDL code that has 
//    caused problems in the past for the TAO IDL
//    compiler. This test is to make sure the problems
//    stay fixed.
//
// = AUTHORS
//    Jeff Parsons <parsons@cs.wustl.edu> and TAO users.
//
// ============================================================================

// Tests for correct parsing and code generation for
// both named and anonymous enums in a struct.

enum UnNamed
  {
    UNNAMED_FIRST,
    UNNAMED_SECOND,
    UNNAMED_THIRD
  };

struct HoldsEnum
{
  enum Named 
    { 
      NAMED_FIRST, 
      NAMED_SECOND, 
      NAMED_THIRD 
    } named_enum;

  UnNamed unnamed_enum;
};

// Test for anonymous arrays of member declarations

struct decl_heavy_struct
{
  enum str_en 
  {
    a, 
    b, 
    c
  } m_en[10];

  struct st 
  {
    long a; 
    char b;
  } m_st[10];

  union un switch (long) 
  {
    case 1: long a; 
    case 2: char b;
  } m_un[10];
};

// Similar case for exception included here - no sense
// in making a separte file for exceptions, which are
// almost the same as structs.

exception ErrorException
{
  enum ReasonCode
  {
    RESOURCE,
    COMMUNICATION,
    ASSERTION,
    STATE,
    ALREADY,
    OTHER
  } reason;
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?