summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/orbsvcs/Notify/Save_Persist_Worker_T.cpp
blob: 1be68b66c3342bd90216cca08281598e8e806f48 (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
//=============================================================================
/**
*  @file    Save_Persist_Worker_T.cpp
*
*  $Id$
*
*  @author Jonathan Pollack <pollack_j@ociweb.com>
*/
//=============================================================================

#ifndef SAVE_PERSIST_WORKER_CPP
#define SAVE_PERSIST_WORKER_CPP

#include "orbsvcs/ESF/ESF_Worker.h"

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

TAO_BEGIN_VERSIONED_NAMESPACE_DECL

namespace TAO_Notify
{
  template<class TOPOOBJ>
  Save_Persist_Worker<TOPOOBJ>::Save_Persist_Worker(Topology_Saver& saver,
                                                    bool want_all_children)
    : saver_ (saver)
    , want_all_children_ (want_all_children)
  {
  }

  template<class TOPOOBJ>
  void
  Save_Persist_Worker<TOPOOBJ>::work (TOPOOBJ* o ACE_ENV_ARG_DECL)
  {
    ACE_ASSERT(o != 0);
    if (this->want_all_children_ || o->is_changed ())
    {
      o->save_persistent (saver_ ACE_ENV_ARG_PARAMETER);
      ACE_CHECK;
    }
  }
} // namespace TAO_Notify

TAO_END_VERSIONED_NAMESPACE_DECL

#endif /* SAVE_PERSIST_WORKER_CPP */