// -*- C++ -*-
// $Id: test.idl 74151 2006-08-21 18:13:24Z parsons $

#ifndef INTERFACEREPO_IDL3_TEST
#define INTERFACEREPO_IDL3_TEST

// This module is here to contain the base valuetype for
// h_key below. This base class is required when a valuetype
// is used as a primary key. This module replaces the original
// #include of Components.idl, and breaks the resulting
// dependency of this test on CIAO. Note that this workaround
// is sufficient for the IFR loader, which is the only thing
// that processes this IDL file in the test. If the IDL
// compiler is executed on this file, there will be
// lookup errors, since it needs to find more things from
// Components.idl.
module Components
{
  typeprefix Components "omg.org";

  abstract valuetype PrimaryKeyBase {};
};

module help
{
  exception doh {};
  exception whups {};
};

module help
{
  interface c_supp1 {};
  interface c_supp2 {};
  component c_base supports c_supp1, c_supp2 {};
  valuetype v_base_base {};
  valuetype v_base : v_base_base {};
  interface v_supp1 {};
  abstract interface v_supp2 {};

  valuetype h_key : Components::PrimaryKeyBase
  {
    public long id_key;
  };

  interface h_supp1 {};
  interface h_supp2 {};
  home h_base supports h_supp1, h_supp2 manages c_base {};
};

module help
{
  interface c_provides1 {};
  interface c_uses1 {};
  interface c_uses2 {};
  eventtype c_emits1 {};
  eventtype c_publishes1 {};
  eventtype c_consumes1 {};
};

module mod
{
  component test_component : help::c_base
  {
    attribute long c_attr1
      getraises (help::doh)
      setraises (help::whups, help::doh);

    provides help::c_provides1 test_provides1;

    uses help::c_uses1 test_uses1;

    uses multiple help::c_uses2 test_uses2;

    emits help::c_emits1 test_emits1;

    publishes help::c_publishes1 test_publishes1;

    consumes help::c_consumes1 test_consumes1;
  };

  valuetype test_valuetype
    : help::v_base supports help::v_supp1, help::v_supp2
  {
    attribute long c_attr1
      getraises (help::doh)
      setraises (help::whups, help::doh);

    string v_op (inout string inoutarg,
                 in help::v_supp1 inarg,
                 out long outarg)
      raises (help::doh, help::whups);

    public string test_mem1;
    private short test_mem2;

    factory default_factory (in string set_tm1);
    factory create_tv (in string set_tm1a,
                       in short set_tm2)
      raises (help::whups, help::doh);
  };

  home test_home : help::h_base
    manages test_component primarykey help::h_key
  {
    factory create_tc (in string set_uid)
      raises (help::doh);

    finder find_tc (in long id_number,
                    in string id_string,
                    in help::h_key pkey)
      raises (help::whups);
  };

  eventtype test_eventtype
    : help::v_base supports help::v_supp1, help::v_supp2
  {
    attribute long c_attr1
      getraises (help::doh)
      setraises (help::whups, help::doh);

    string v_op (inout string inoutarg,
                 in help::v_supp1 inarg,
                 out long outarg)
      raises (help::doh, help::whups);

    public string test_mem1;
    private short test_mem2;

    factory default_factory (in string set_tm1);
    factory create_tv (in string set_tm1a,
                       in short set_tm2)
      raises (help::whups, help::doh);
  };
};

#endif /* INTERFACEREPO_IDL3_TEST */

