2 //=============================================================================
4 * @file CC_naming_service.h
6 * This class implements the naming services necessary to test the
9 * @author Torben Worm <tworm@cs.wustl.edu>
11 //=============================================================================
14 #include "orbsvcs/CosConcurrencyControlC.h"
15 #include "orbsvcs/CosNamingC.h"
16 #include "orbsvcs/Naming/Naming_Client.h"
18 #ifndef _CC_NAMING_SERVICE_H_
19 #define _CC_NAMING_SERVICE_H_
22 * @class CC_naming_service
24 * @brief Defines a class that encapsulates the necessary naming service
25 * functions for the concurrency service.
27 * This class declares an interface to the naming service for the
28 * concurrency service tests.
30 class CC_naming_service
33 /// Default constructor
37 CC_naming_service (CORBA::ORB_var orb_
);
39 /// Default destructor.
40 ~CC_naming_service ();
42 /// Initialization method must be called after first call of Instance()
43 /// in order to initialize the object correctly
44 void Init (CORBA::ORB_var orb_
);
46 /// Lookup a name in the naming service (context, name)
47 CORBA::Object_var
get_obj_from_name (const char *c_name
,
50 /// Bind a name in the concurrency context.
51 void bind_name (const char *n
,
52 CORBA::Object_ptr obj
);
54 /// Gets the cc lock set factory which is common for all tests.
55 CosConcurrencyControl::LockSetFactory_var
get_lock_set_factory ();
57 /// The naming service object is a singleton
58 static CC_naming_service
*Instance();
61 /// Function to initialize the naming service.
62 int init_naming_service ();
64 /// Key of factory obj ref.
65 char *cc_factory_key_
;
70 /// Name service wrapper class
71 TAO_Naming_Client my_name_client_
;
73 /// factory pointer for the lock set.
74 CosConcurrencyControl::LockSetFactory_var factory_
;
76 /// The instance of the naming service object
77 static CC_naming_service
*instance_
;
79 #endif /* !defined (_CC_NAMING_SERVICE_H_) */