blob: f61d40ad99900afdeb1d0aa1221d3028dae1be9d (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// -*- C++ -*-
//=============================================================================
/**
* @file Log_Flush_Handler.h
*
* $Id$
*
*/
//=============================================================================
#ifndef TAO_TLS_FLUSH_HANDLER_H
#define TAO_TLS_FLUSH_HANDLER_H
#include "orbsvcs/Log/log_serv_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "tao/Versioned_Namespace.h"
#include "ace/Event_Handler.h"
#include "ace/Time_Value.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
class ACE_Reactor;
ACE_END_VERSIONED_NAMESPACE_DECL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
class TAO_Log_i;
/// @class TAO_Log_Flush_Handler
/// @brief Periodically flush log records to persistent store
///
class TAO_Log_Serv_Export TAO_Log_Flush_Handler
: public ACE_Event_Handler
{
public:
/// Constructor.
TAO_Log_Flush_Handler (ACE_Reactor* reactor,
TAO_Log_i* log,
const ACE_Time_Value& interval);
/// Destructor.
~TAO_Log_Flush_Handler ();
/// Schedule Timer.
void schedule ();
/// Cancel Timer.
void cancel ();
virtual int handle_timeout (const ACE_Time_Value &tv, const void *arg);
private:
long timer_id_;
ACE_Reactor* reactor_;
TAO_Log_i* log_;
ACE_Time_Value interval_;
};
TAO_END_VERSIONED_NAMESPACE_DECL
#endif /* TAO_LOG_FLUSH_HANDLER_H */
|