Revert "Use a variable on the stack to not have a temporary in the call"
[ACE_TAO.git] / TAO / examples / Simple / bank / AccountManager_i.h
bloba948759e161580bf8731a9141e38472630f426ff
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file AccountManager_i.h
7 * This class implements the Bank::AccountManager IDL interface.
9 * @author Vishal Kachroo <vishal@cs.wustl.edu>
11 //=============================================================================
14 #ifndef ACCOUNTMANAGER_I_H
15 #define ACCOUNTMANAGER_I_H
17 #include "BankS.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 # pragma once
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "Account_i.h"
25 #include "ace/Hash_Map_Manager.h"
26 #include "ace/ACE.h"
27 #include "ace/SString.h"
28 #include "ace/Null_Mutex.h"
29 #include "tao/Intrusive_Ref_Count_Handle_T.h"
31 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
32 class TAO_ORB_Manager;
33 TAO_END_VERSIONED_NAMESPACE_DECL
35 /**
36 * @class AccountManager_i
38 * @brief Account Manager object implementation.
40 * Implementation of a simple object that has two methods, one
41 * that returns an Account Interface and the other that shuts
42 * down the server.
44 class AccountManager_i : public POA_Bank::AccountManager
46 public:
47 /// Constructor.
48 AccountManager_i ();
50 /// Destructor.
51 virtual ~AccountManager_i ();
53 /// Return the Account interface with the given name from the server.
54 /// Put the initial balance specified in the new account.
55 virtual Bank::Account_ptr open (const char *name,
56 CORBA::Float initial_balance);
58 /// Close the given account.
59 virtual void close (Bank::Account_ptr);
61 /// Shutdown the server.
62 virtual void shutdown ();
64 /// Set the ORB pointer.
65 void orb (CORBA::ORB_ptr o);
67 /// Set the POA pointer.
68 void poa (PortableServer::POA_ptr poa);
70 /// Set the ORB Manager.
71 void set_orb_manager (TAO_ORB_Manager *orb_manager);
73 /// The ORB manager.
74 TAO_ORB_Manager *orb_manager_;
76 private:
77 /// ORB pointer.
78 CORBA::ORB_var orb_;
80 /// POA pointer.
81 PortableServer::POA_var poa_;
83 typedef TAO_Intrusive_Ref_Count_Handle<Account_i> Account_i_var;
84 typedef ACE_Hash_Map_Manager<ACE_CString,
85 Account_i_var,
86 ACE_Null_Mutex> MAP_MANAGER_TYPE;
88 /**
89 * Calls to <open> will create a new instance of <Account_i> and
90 * bind into the hash map manager if <name> is unique, else it will
91 * return a previously bound entry.
93 MAP_MANAGER_TYPE hash_map_;
95 void operator= (const AccountManager_i &);
98 #endif /* ACCOUNTMANAGER_I_H */