summaryrefslogtreecommitdiff
path: root/TAO/tao/XtResource/XtResource_Factory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/XtResource/XtResource_Factory.cpp')
-rw-r--r--TAO/tao/XtResource/XtResource_Factory.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/TAO/tao/XtResource/XtResource_Factory.cpp b/TAO/tao/XtResource/XtResource_Factory.cpp
new file mode 100644
index 00000000000..3a3ad30376e
--- /dev/null
+++ b/TAO/tao/XtResource/XtResource_Factory.cpp
@@ -0,0 +1,45 @@
+//$Id$
+
+#include "tao/XtResource/XtResource_Factory.h"
+#include "tao/debug.h"
+#include "ace/XtReactor/XtReactor.h"
+
+ACE_RCSID( TAO_XtResource,
+ XtResource_Factory,
+ "$Id$");
+
+namespace TAO
+{
+
+ XtResource_Factory::XtResource_Factory (XtAppContext p_context):
+ reactor_impl_( 0 ),
+ context_( p_context )
+ {
+ }
+
+ ACE_Reactor_Impl *
+ XtResource_Factory::reactor_impl (void)
+ {
+ // synchronized by external locks
+ if (this->context_ == 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT("TAO (%P|%t) - XtAppContext is undefined.")
+ ACE_TEXT(" Cannot create ACE_XtReactor \n")));
+ return 0;
+ }
+
+ if (!this->reactor_impl_)
+ {
+ ACE_NEW_RETURN (this->reactor_impl_,
+ ACE_XtReactor (this->context_),
+ 0);
+
+ if (TAO_debug_level > 0)
+ ACE_DEBUG ((LM_DEBUG,
+ "TAO (%P|%t) - ACE_XtReactor created \n"));
+ }
+
+ return this->reactor_impl_;
+ }
+}