// Copyright(c) 2006 to 2022 ZettaScale Technology and others
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
// v. 1.0 which is available at
// http://www.eclipse.org/org/documents/edl-v10.php.
//
// SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause

module XSpaceMustUnderstand {

  // type 1: mutable type
  @mutable
  struct rd1
  {
    long f1;
  };

  // not assignable (non-optional m-u field not in rd type)
  @mutable
  struct wr1_1
  {
    long f1;
    @must_understand long f2;
  };

  // assignable
  // read sample { 1 }
  @mutable
  struct wr1_2
  {
    @must_understand long f1;
  };

  // assignable
  // read sample { 1, NULL }
  // drop sample { 1, 1 }
  @mutable
  struct wr1_3
  {
    long f1;
    @optional @must_understand long f2;
  };

  // assignable (optional attribute matching rd type not required for mutable types)
  // read sample { NULL }
  // read sample { 1 }
  @mutable
  struct wr1_4
  {
    @optional @must_understand long f1;
  };



  // type 2: nested mutable type
  @nested @mutable
  struct n2
  {
    long f1;
  };

  @nested @mutable
  struct n2_mu
  {
    long f1;
    @optional @must_understand long f2;
  };

  @final
  struct rd2
  {
    n2 f1;
  };

  // assignable
  // read sample { { 1, NULL } }
  // drop sample { { 1, 1 } }
  @final
  struct wr2_1
  {
    n2_mu f1;
  };

};
