Merge pull request #1844 from jrw972/monterey
[ACE_TAO.git] / TAO / examples / Simple / bank / Bank.idl
blobb08174d10e1b2809fb25820f1f648f7d3f3ed763
1 // -*- C++ -*-
2 module Bank
4 // = TITLE
5 // This module has two interfaces. One represents a bank Account and
6 // the other is a factory to create the Account Objects.
8 interface Account
10 // = TITLE
11 // This interface represents an account with operations to check
12 // balance, deposit and withdraw.
14 exception Overdraft
16 // = TITLE
17 // This exception is raised if the client tries to
18 // withdraw more money than the current balance.
20 string reason;
23 readonly attribute float balance;
24 // Attribute to obtain the current <balance>.
26 void deposit (in float amount);
27 // Add <amount> to this account.
29 void withdraw (in float amount) raises (Overdraft);
30 // Withdraw <amount from this account.
32 attribute string name;
33 // The <name> of this account.
36 interface AccountManager
38 // = TITLE
39 // This interface is a factory for the <Account> objects. It has
40 // operations to create <Account>s and to delete them.
42 Account open (in string name,
43 in float initial_balance);
44 // Returns the <Account> associated with <name>. If this is the
45 // first time <name> has been seen, the server will create the
46 // account. Otherwise, the server will return back an object
47 // reference to a previously created account.
49 void close (in Account account_);
50 // Close down the account and release its resources if it's the
51 // last reference to the <account>. Once this call is made it
52 // is no longer valid to access the <account>.
54 void shutdown ();
55 // This operation shuts down the server.