summaryrefslogtreecommitdiff
path: root/examples/Simple/bank/Bank_Client_i.h
blob: 5b20c895646ed4e4107484baaf737ab3ef1a95a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Bank_Client_i.h
 *
 *  $Id$
 *
 *  This class implements the  interface calls for RMI.
 *
 *
 *  @author Balachandran Natarajan <bala@cs.wustl.edu>
 */
//=============================================================================


#ifndef BANK_CLIENT_I_H
#define BANK_CLIENT_I_H

#include "../Simple_util.h"
#include "BankC.h"

/**
 * @class Bank_Client_i
 *
 * @brief Grid_Client interface subclass.
 *
 * This class implements the interface between the interface
 * objects and the client .
 */
class Bank_Client_i
{
public:
  // = Initialization and termination methods.
  /// Constructor
  Bank_Client_i (void);

  /// Destructor
  ~Bank_Client_i (void);

  /// Execute the methods.
  int run (const char *, int, ACE_TCHAR *[]);

private:
  /// Method that calls all the test functions
  int check_accounts (void);

  /// Tests if accounts opened with different names return a different account
  /// reference.
  void test_for_different_name (void);

  /// Tests if accounts opened with the same name return the same
  /// object reference.
  void test_for_same_name (void);

  /// Tests for the Overdraft Exception when the client tries to
  /// withdraw more money than the current balance.
  void test_for_overdraft (void);

  /// Instantiate the client object.
  Client<Bank::AccountManager> client_;
};

#endif /* TIME_CLIENT_I_H */