summaryrefslogtreecommitdiff
path: root/tao/FoxResource/FoxResource_Factory.cpp
blob: 14a126aa1698f86d6f5ecba4da971e1848c964b8 (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
//$Id$

#include "tao/FoxResource/FoxResource_Factory.h"
#include "tao/debug.h"
#include "ace/FoxReactor/FoxReactor.h"

ACE_RCSID( TAO_FoxResource,
           FoxResource_Factory,
           "$Id$");


TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO
{

  FoxResource_Factory::FoxResource_Factory (FXApp *app)
    : reactor_impl_ (0)
    , fxapp_ (app)
  {
  }

  ACE_Reactor_Impl *
  FoxResource_Factory::reactor_impl (void)
  {
    if (this->fxapp_ == 0)
      return 0;

    // synchronized by external locks
    if (!this->reactor_impl_)
    {
      ACE_NEW_RETURN (this->reactor_impl_,
                      ACE_FoxReactor (),
                      0);

      if (TAO_debug_level > 0)
        ACE_DEBUG ((LM_DEBUG,
                    "TAO (%P|%t) - ACE_FoxReactor created\n"));
    }

    return this->reactor_impl_;
  }
}

TAO_END_VERSIONED_NAMESPACE_DECL