~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to cs/test/Ice/defaultValue/Test.ice

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// **********************************************************************
 
2
//
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
 
4
//
 
5
// This copy of Ice is licensed to you under the terms described in the
 
6
// ICE_LICENSE file included in this distribution.
 
7
//
 
8
// **********************************************************************
 
9
 
 
10
#ifndef TEST_ICE
 
11
#define TEST_ICE
 
12
 
 
13
module Test
 
14
{
 
15
 
 
16
enum Color { red, green, blue };
 
17
 
 
18
//
 
19
// Struct1 maps to a C# class because it contains string members.
 
20
//
 
21
struct Struct1
 
22
{
 
23
    bool boolFalse = false;
 
24
    bool boolTrue = true;
 
25
    byte b = 254;
 
26
    short s = 16000;
 
27
    int i = 3;
 
28
    long l = 4;
 
29
    float f = 5.0;
 
30
    double d = 6.0;
 
31
    string str = "foo bar";
 
32
    Color c = red;
 
33
    string noDefault;
 
34
};
 
35
 
 
36
//
 
37
// Struct2 would normally map to a C# struct because we have omitted
 
38
// the string members, but we use metadata to force it to be mapped
 
39
// to a class.
 
40
//
 
41
["clr:class"]
 
42
struct Struct2
 
43
{
 
44
    bool boolFalse = false;
 
45
    bool boolTrue = true;
 
46
    byte b = 1;
 
47
    short s = 2;
 
48
    int i = 3;
 
49
    long l = 4;
 
50
    float f = 5.0;
 
51
    double d = 6.0;
 
52
    //string str = "foo bar";
 
53
    Color c = blue;
 
54
    //string noDefault;
 
55
};
 
56
 
 
57
class Base
 
58
{
 
59
    bool boolFalse = false;
 
60
    bool boolTrue = true;
 
61
    byte b = 1;
 
62
    short s = 2;
 
63
    int i = 3;
 
64
    long l = 4;
 
65
    float f = 5.0;
 
66
    double d = 6.0;
 
67
    string str = "foo bar";
 
68
    string noDefault;
 
69
};
 
70
 
 
71
class Derived extends Base
 
72
{
 
73
    Color c = green;
 
74
};
 
75
 
 
76
exception BaseEx
 
77
{
 
78
    bool boolFalse = false;
 
79
    bool boolTrue = true;
 
80
    byte b = 1;
 
81
    short s = 2;
 
82
    int i = 3;
 
83
    long l = 4;
 
84
    float f = 5.0;
 
85
    double d = 6.0;
 
86
    string str = "foo bar";
 
87
    string noDefault;
 
88
};
 
89
 
 
90
exception DerivedEx extends BaseEx
 
91
{
 
92
    Color c = green;
 
93
};
 
94
 
 
95
};
 
96
 
 
97
#endif