summaryrefslogtreecommitdiff
path: root/TAO/tests/Simple/bank/AccountManager_i.cpp
blob: 51938bb0fe1ed50c2b7ca4d11128d97b0c4b0455 (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
// $Id$

#include "AccountManager_i.h"
#include "Bank_i.h"

ACE_RCSID(AccountManager, AccountManager_i, "$Id$")

// Constructor

AccountManager_i::AccountManager_i (void)
{
  // no-op
}

// Destructor

AccountManager_i::~AccountManager_i (void)
{
  // no-op
}

// Set the ORB pointer.

void
AccountManager_i::orb (CORBA::ORB_ptr o)
{
  this->orb_ = CORBA::ORB::_duplicate (o);
}

// Open an account for the given name

Bank::Account_ptr
AccountManager_i::open (const char * name,CORBA::Environment &env)
{
  ACE_DEBUG ((LM_DEBUG,
              "%s %s\n",
              "Opening an Account for",name));
  Bank_i* bank;
  ACE_NEW_RETURN (bank, Bank_i, Bank::Account::_nil ());
  return bank->_this (env);
}

// Shutdown.

void AccountManager_i::shutdown (CORBA::Environment &)
{
  ACE_DEBUG ((LM_DEBUG,
              "%s\n",
              "AccountManager_i is shutting down"));

  // Instruct the ORB to shutdown.
  this->orb_->shutdown ();
}