summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbala <balanatarajan@users.noreply.github.com>2005-01-15 00:21:24 +0000
committerbala <balanatarajan@users.noreply.github.com>2005-01-15 00:21:24 +0000
commitf834d003ce759ab6cd17e0c412d90e06c467f21c (patch)
tree6664e4ca66cf3594d2bf4e2cf316b706267806f1
parent6bd82d12a12ef5083bb897bd203c216cf17d242d (diff)
downloadATCD-f834d003ce759ab6cd17e0c412d90e06c467f21c.tar.gz
*** empty log message ***
-rw-r--r--TAO/tao/GUI_Resource_Factory.h51
-rw-r--r--TAO/tao/Qt_Resource_Factory.cpp42
-rw-r--r--TAO/tao/Qt_Resource_Factory.h58
-rw-r--r--TAO/tao/Qt_Resources_Export.h58
4 files changed, 209 insertions, 0 deletions
diff --git a/TAO/tao/GUI_Resource_Factory.h b/TAO/tao/GUI_Resource_Factory.h
new file mode 100644
index 00000000000..cd7be159075
--- /dev/null
+++ b/TAO/tao/GUI_Resource_Factory.h
@@ -0,0 +1,51 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file GUI_Resource_Factory.h
+ *
+ * $Id$
+ *
+ * @author Hamish Friedlander <ullexco@wave.co.nz>
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_GUI_RESOURCE_FACTORY_H
+#define TAO_GUI_RESOURCE_FACTORY_H
+#include /**/ "ace/pre.h"
+
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+namepace TAO
+{
+ /**
+ * @class GUI_Resource_Factory
+ *
+ * @brief Abstract Base Class for the GUI resource factory, which
+ * will be held by the ORB Core
+ *
+ */
+ class TAO_Export GUI_Resource_Factory
+ {
+ public:
+ /// Create a reactor instance.
+ /**
+ * Please note that this call is NOT synchronized. Left to the
+ * higher level versions to synchronize access.
+ */
+ virtual ACE_Reactor_Impl *create (void) const = 0;
+
+ protected:
+ ACE_Reactor_Impl *impl_;
+
+ private:
+ ACE_UNIMPLEMENTED_FUNC (GUI_Resource_Factory (void))
+ };
+}
+
+#include /**/ "ace/post.h"
+#endif /*TAO_GUI_RESOURCE_FACTORY_H*/
diff --git a/TAO/tao/Qt_Resource_Factory.cpp b/TAO/tao/Qt_Resource_Factory.cpp
new file mode 100644
index 00000000000..6dbc0aca380
--- /dev/null
+++ b/TAO/tao/Qt_Resource_Factory.cpp
@@ -0,0 +1,42 @@
+//$Id$
+#include "tao/Qt_Resource_Factory.h"
+#include "tao/debug.h"
+
+namespace TAO
+{
+ QApplication *TAO_QtResource_Factory::qapp_ = 0 ;
+
+ ACE_Reactor_Impl *
+ QtResource_Factory::create (void) const
+ {
+ if (this->qapp_ == 0)
+ return 0;
+
+ if (!this->reactor_impl_ )
+ {
+ ACE_NEW_RETURN (this->reactor_impl_,
+ ACE_QtReactor (qapp_),
+ 0);
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - ACE_QtReactor created \n"));
+ }
+
+ return this->reactor_impl_;
+ }
+
+ void
+ QtResource_Factory::set_context (QApplication *qapp)
+ {
+ TAO_QtResource_Factory::qapp_ = qapp;
+ }
+
+ACE_STATIC_SVC_DEFINE (QtResource_Factory,
+ ACE_TEXT ("QtResource_Factory"),
+ ACE_SVC_OBJ_T,
+ &ACE_SVC_NAME (QtResource_Factory),
+ ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ,
+ 0)
+
+ACE_FACTORY_DEFINE (TAO_QtReactor, TAO_QtResource_Factory)
+ }
diff --git a/TAO/tao/Qt_Resource_Factory.h b/TAO/tao/Qt_Resource_Factory.h
new file mode 100644
index 00000000000..e111f714bf6
--- /dev/null
+++ b/TAO/tao/Qt_Resource_Factory.h
@@ -0,0 +1,58 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Qt_Resource_Factory.h
+ *
+ * $Id$
+ *
+ * @author Hamish Friedlander <ullexco@wave.co.nz>
+ * @author Balachandran Natarajan <bala@cs.wustl.edu>
+ */
+//=============================================================================
+
+#ifndef TAO_QT_RESOURCE_FACTORY_H
+#define TAO_QT_RESOURCE_FACTORY_H
+#include /**/ "ace/pre.h"
+
+#include "tao/Qt_Resources_Export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/QtReactor.h"
+
+namespace TAO
+{
+ /**
+ * @class QtResource_Factory
+ *
+ * @brief TAO's default resource factory
+ *
+ * This factory is intended for creating QtReactor for ORB.
+ */
+ class TAO_QtResources_Export QtResource_Factory : public GUI_Resource_Factory
+ {
+ public:
+ QtResource_Factory (void);
+
+ /// Set the context used to create the QtReactor
+ static void set_context (QApplication *qapp) ;
+
+ /// Obtain the reactor implementation
+ virtual ACE_Reactor_Impl *create (void) const;
+
+ private:
+ static QApplication *qapp_ ;
+ };
+
+
+ ACE_STATIC_SVC_DECLARE_EXPORT (TAO_QtReactor, QtResource_Factory)
+ ACE_FACTORY_DECLARE (TAO_QtReactor, QtResource_Factory)
+}
+
+
+
+#include /**/ "ace/post.h"
+#endif /* QTRESOURCE_H */
diff --git a/TAO/tao/Qt_Resources_Export.h b/TAO/tao/Qt_Resources_Export.h
new file mode 100644
index 00000000000..c636a8b3205
--- /dev/null
+++ b/TAO/tao/Qt_Resources_Export.h
@@ -0,0 +1,58 @@
+
+// -*- C++ -*-
+// $Id$
+// Definition for Win32 Export directives.
+// This file is generated automatically by generate_export_file.pl -s TAO_QtResources
+// ------------------------------
+#ifndef TAO_QTREACTOR_EXPORT_H
+#define TAO_QTREACTOR_EXPORT_H
+
+#include "ace/config-all.h"
+
+#if defined (ACE_AS_STATIC_LIBS) && !defined (TAO_QTREACTOR_HAS_DLL)
+# define TAO_QTREACTOR_HAS_DLL 0
+#endif /* ACE_AS_STATIC_LIBS && TAO_QTREACTOR_HAS_DLL */
+
+#if !defined (TAO_QTREACTOR_HAS_DLL)
+# define TAO_QTREACTOR_HAS_DLL 1
+#endif /* ! TAO_QTREACTOR_HAS_DLL */
+
+#if defined (TAO_QTREACTOR_HAS_DLL) && (TAO_QTREACTOR_HAS_DLL == 1)
+# if defined (TAO_QTREACTOR_BUILD_DLL)
+# define TAO_QtResources_Export ACE_Proper_Export_Flag
+# define TAO_QTREACTOR_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T)
+# define TAO_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# else /* TAO_QTREACTOR_BUILD_DLL */
+# define TAO_QtResources_Export ACE_Proper_Import_Flag
+# define TAO_QTREACTOR_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T)
+# define TAO_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+# endif /* TAO_QTREACTOR_BUILD_DLL */
+#else /* TAO_QTREACTOR_HAS_DLL == 1 */
+# define TAO_QtResources_Export
+# define TAO_QTREACTOR_SINGLETON_DECLARATION(T)
+# define TAO_QTREACTOR_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK)
+#endif /* TAO_QTREACTOR_HAS_DLL == 1 */
+
+// Set TAO_QTREACTOR_NTRACE = 0 to turn on library specific tracing even if
+// tracing is turned off for ACE.
+#if !defined (TAO_QTREACTOR_NTRACE)
+# if (ACE_NTRACE == 1)
+# define TAO_QTREACTOR_NTRACE 1
+# else /* (ACE_NTRACE == 1) */
+# define TAO_QTREACTOR_NTRACE 0
+# endif /* (ACE_NTRACE == 1) */
+#endif /* !TAO_QTREACTOR_NTRACE */
+
+#if (TAO_QTREACTOR_NTRACE == 1)
+# define TAO_QTREACTOR_TRACE(X)
+#else /* (TAO_QTREACTOR_NTRACE == 1) */
+# if !defined (ACE_HAS_TRACE)
+# define ACE_HAS_TRACE
+# endif /* ACE_HAS_TRACE */
+# define TAO_QTREACTOR_TRACE(X) ACE_TRACE_IMPL(X)
+# include "ace/Trace.h"
+#endif /* (TAO_QTREACTOR_NTRACE == 1) */
+
+#endif /* TAO_QTREACTOR_EXPORT_H */
+
+// End of auto generated file.