summaryrefslogtreecommitdiff
path: root/TAO/examples/Simple/bank/Account_i.h
blob: 777097e97e82670d390850a7e699931955084ec3 (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
65
66
67
68
69
70
71
72
73
// -*- C++ -*-

//=============================================================================
/**
 *  @file    Account_i.h
 *
 *  $Id$
 *
 *  This class implements the Bank IDL interface.
 *
 *
 *  @author Vishal Kachroo <vishal@cs.wustl.edu>
 */
//=============================================================================


#ifndef ACCOUNT_I_H
#define ACCOUNT_I_H

#include "BankS.h"

/**
 * @class Account_i
 *
 * @brief Bank object implementation.
 *
 * Implementation of a simple object that has two methods, one
 * that return the current balance on the server and the other
 * that shuts down the server.
 */
class Account_i : public POA_Bank::Account
{
public:
  // = Initialization and termination methods.
  /// Constructor.
  Account_i (void);

  /// Constructor.
  Account_i (const char *, CORBA::Float);

  /// Destructor.
  virtual ~Account_i (void);

  /// Get the current balance in the account.
  virtual CORBA::Float balance (void);

  /// Get the name of the <Account> holder.
  virtual char *name (void);

  /// Set the name of the <Account> holder.
  virtual void name (const char *name);

  /// Deposit money in the account.
  virtual void deposit (CORBA::Float);

  /// Withdraw money in the account.
  virtual void withdraw (CORBA::Float);

  /// Set the ORB pointer.
  void orb (CORBA::ORB_ptr o);

private:
  /// ORB pointer.
  CORBA::ORB_var orb_;

  /// balance for this account
  CORBA::Float balance_;

  /// Name of the <Account> holder.
  CORBA::String_var name_;
};

#endif /* ACCOUNT_I_H */