summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/PortableGroup/PG_Object_Group_Map.h
blob: 53043af9fab83fcf7d8fdf2450a849d54044307f (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// -*- C++ -*-

//=============================================================================
/**
 * @file PG_Object_Group_Map.h
 *
 * $Id$
 *
 *  Container for TAO::PG_Object_Groups indexed by ObjectGroupId
 *  Note this was developed as part of FT CORBA
 *  @@ For now its but one of several parallel containers for object group information
 *  @@ TODO: Combine these parallel containers into a single one that consolidates everything
 *  @@ known about object groups.
 *  @author Dale Wilson <wilson_d@ociweb.com>
 */
//=============================================================================


#ifndef TAO_PG_OBJECT_GROUP_MAP_H
#define TAO_PG_OBJECT_GROUP_MAP_H

#include /**/ "ace/pre.h"
#include "orbsvcs/PortableGroupS.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
#pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

////////////////////////////////////////////////////
// Forward reference to class(es) defined in this header
namespace TAO
{
  class PG_Object_Group_Map;
} // namespace TAO

//#include "PG_Object_Group.h"
namespace TAO
{
  class PG_Object_Group;
} // namespace TAO

namespace TAO
{
  /**
   * class TAO::PG_Object_Group_Map
   *  A container of Object_Groups indexed by ObjectGroupId
   */
  class TAO_PortableGroup_Export PG_Object_Group_Map
    : public ACE_Hash_Map_Manager_Ex<
        PortableGroup::ObjectGroupId,
        ::TAO::PG_Object_Group *,
        ACE_Hash<ACE_UINT64>,
        ACE_Equal_To<ACE_UINT64>,
         TAO_SYNCH_MUTEX>
  {
  public:
    typedef ACE_Hash_Map_Entry <PortableGroup::ObjectGroupId, ::TAO::PG_Object_Group *> Entry;
    typedef ACE_Hash_Map_Iterator_Ex <
      PortableGroup::ObjectGroupId,
      ::TAO::PG_Object_Group *,
      ACE_Hash<ACE_UINT64>,
      ACE_Equal_To<ACE_UINT64>,
       TAO_SYNCH_MUTEX> Iterator;

    /// Constructor.
    PG_Object_Group_Map ();

    /// Destructor.
    virtual ~PG_Object_Group_Map ();

    /// insert existing group.  Take ownership
    /// note: uses group id extracted from group object
    /// @return bool true if insertion successful
    int insert_group ( ::TAO::PG_Object_Group * group);

    /// insert group.  Take ownership
    /// @return bool true if insertion successful
    int insert_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group * group);

    /// find group
    /// @return bool true if found
    int find_group (PortableGroup::ObjectGroupId group_id, ::TAO::PG_Object_Group *& group) const;

    /// find group
    /// note: uses group id extracted from object_group
    /// @return bool true if found
    int find_group (PortableGroup::ObjectGroup_ptr object_group, ::TAO::PG_Object_Group *& group) const;

    /// remove group from map and delete it.
    /// @return bool true if found
    int destroy_group (PortableGroup::ObjectGroupId object_group_id);

    /// remove group from map and delete it.
    /// note: uses group id extracted from object_group
    /// @return bool true if found
    int destroy_group (PortableGroup::ObjectGroup_ptr object_group);

    ////////////////////////////
    // Implementation methods
   private:

    ///////
    // Data
   private:
  };
} // namespace TAO

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

#endif  /* TAO_PG_OBJECT_GROUP_MAP_H */