summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Naming/Storable_Naming_Context_Factory.h
blob: 233e3043d506c39c2281994e6966583261af68b9 (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
// -*- C++ -*-

//=============================================================================
/**
 *  @file   Storable_Naming_Context_Factory.h
 *
 *  $Id$
 *
 *  @author Kevin Stanley stanleyk@ociweb.com>
 */
//=============================================================================


#ifndef TAO_STORABLE_NAMING_CONTEXT_FACTORY_H
#define TAO_STORABLE_NAMING_CONTEXT_FACTORY_H
#include /**/ "ace/pre.h"

#include "tao/ORB.h"
#include "orbsvcs/Naming/nsconf.h"
#include "orbsvcs/Naming/naming_serv_export.h"
#include "orbsvcs/Naming/Hash_Naming_Context.h"
#include "orbsvcs/Naming/Storable_Naming_Context.h"


class TAO_Persistent_Naming_Context;

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

/**
 * @class TAO_Naming_Context_Factory
 *
 * @brief
 */
class TAO_Naming_Serv_Export TAO_Storable_Naming_Context_Factory
{
public:

  /// Data structure used by TAO_Persistent_Context_Index - typedef for ease of use.
  typedef TAO_Storable_Naming_Context::HASH_MAP HASH_MAP;

  // = Initialization and termination methods.

  /// Constructor.
  TAO_Storable_Naming_Context_Factory (size_t hash_table_size = ACE_DEFAULT_MAP_SIZE);

  /// Destructor.  Does not deallocate the hash map: if an instance of
  /// this class goes out of scope, its hash_map remains in persistent storage.
  virtual ~TAO_Storable_Naming_Context_Factory (void);

  /// Factory method for creating an implementation object for naming contexts.
  /// If an existing naming context implementation is being rebuilt, the map and counter parameters
  /// should be provided to the underlying HASH_MAP implementation
  virtual TAO_Storable_Naming_Context* create_naming_context_impl (CORBA::ORB_ptr orb,
                                                                   PortableServer::POA_ptr poa,
                                                                   const char *poa_id,
                                                                   TAO_Naming_Service_Persistence_Factory *factory,
                                                                   const ACE_TCHAR *persistence_directory);

protected:
  /// The size for persisted naming context objects in hash map
  size_t context_size_;
};

TAO_END_VERSIONED_NAMESPACE_DECL

#include /**/ "ace/post.h"
#endif /* TAO_STORABLE_NAMING_CONTEXT_FACTORY_H */