summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Table.h
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2000-09-14 00:29:28 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2000-09-14 00:29:28 +0000
commitbc4eba4bbc2f7f3ac1dad112d961d887d030e300 (patch)
tree8475597a4d6722f66b2285b936eda3368ff5a9ad /TAO/tao/ORB_Table.h
parent8f2948de8e32658800fec3a11723f3644499ddee (diff)
downloadATCD-bc4eba4bbc2f7f3ac1dad112d961d887d030e300.tar.gz
ChangeLogTag:Wed Sep 13 17:23:18 2000 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/tao/ORB_Table.h')
-rw-r--r--TAO/tao/ORB_Table.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/TAO/tao/ORB_Table.h b/TAO/tao/ORB_Table.h
new file mode 100644
index 00000000000..d357773ba11
--- /dev/null
+++ b/TAO/tao/ORB_Table.h
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+//
+// $Id$
+
+// ============================================================================
+//
+// = LIBRARY
+// TAO
+//
+// = FILENAME
+// ORB_Table.h
+//
+// = AUTHOR
+// Ossama Othman <ossama@uci.edu>
+// Carlos O'Ryan <coryan@uci.edu>
+//
+// ============================================================================
+
+#ifndef TAO_ORB_TABLE_H
+#define TAO_ORB_TABLE_H
+
+#include "ace/pre.h"
+
+#include "tao/TAO_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "tao/TAO_Singleton.h"
+#include "ace/Synch.h"
+#include "ace/Hash_Map_Manager_T.h"
+#include "ace/Functor.h"
+
+
+// Forward declarations.
+class TAO_ORB_Core;
+
+class TAO_Export TAO_ORB_Table
+{
+ // = TITLE
+ // Keep a table with all the ORBs in the system.
+ //
+ // = DESCRIPTION
+ // CORBA::ORB_init() is supposed to return the same ORB if the
+ // user specifies the same ORBid, either in the ORB_init()
+ // parameter or in the -ORBid option.
+ // This class is used to implement that feature.
+ // It is also useful when trying to determine if an object
+ // reference is collocated or not.
+ //
+public:
+ ~TAO_ORB_Table (void);
+ // destructor
+
+ typedef ACE_Hash_Map_Manager_Ex<const char *, TAO_ORB_Core *, ACE_Hash<const char *>, ACE_Equal_To<const char *>, ACE_Null_Mutex> Table;
+ typedef Table::iterator Iterator;
+
+ Iterator begin (void);
+ Iterator end (void);
+ int bind (const char *orb_id, TAO_ORB_Core *orb_core);
+ TAO_ORB_Core* find (const char *orb_id);
+ int unbind (const char *orb_id);
+ // The canonical ACE_Map methods.
+
+ TAO_ORB_Core *first_orb (void);
+ // Obtain the first ORB for the ORB_Core_instance() implementation
+
+ static TAO_ORB_Table *instance (void);
+ // Return a unique instance
+
+protected:
+ friend class TAO_Singleton<TAO_ORB_Table, ACE_SYNCH_MUTEX>;
+ TAO_ORB_Table (void);
+ // Constructor
+
+private:
+ // Prevent copying
+ ACE_UNIMPLEMENTED_FUNC (TAO_ORB_Table (const TAO_ORB_Table &))
+ ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_ORB_Table &))
+
+private:
+ Table table_;
+ // The implementation.
+
+ TAO_ORB_Core *first_orb_;
+ // The first ORB created by the user
+};
+
+
+#if defined (__ACE_INLINE__)
+# include "tao/ORB_Table.inl"
+#endif /* __ACE_INLINE__ */
+
+#include "ace/post.h"
+
+#endif /* TAO_ORB_TABLE_H */