3 //=============================================================================
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
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 #include "Account_i.h"
25 #include "ace/Hash_Map_Manager.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
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
44 class AccountManager_i
: public POA_Bank::AccountManager
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
);
74 TAO_ORB_Manager
*orb_manager_
;
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
,
86 ACE_Null_Mutex
> MAP_MANAGER_TYPE
;
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 */