3 //=============================================================================
7 * $Id: Log_Msg_IPC.h 80826 2008-03-04 14:51:23Z wotte $
9 * @author Carlos O'Ryan <coryan@uci.edu>
11 //=============================================================================
13 #ifndef ACE_LOG_MSG_LOGGER_H
14 #define ACE_LOG_MSG_LOGGER_H
15 #include /**/ "ace/pre.h"
17 #include "ace/Log_Msg_Backend.h"
19 #if !defined (ACE_LACKS_PRAGMA_ONCE)
21 #endif /* ACE_LACKS_PRAGMA_ONCE */
23 // IPC conduit between sender and client daemon. This should be
24 // included in the ACE_Log_Msg class, but due to "order of include"
25 // problems it can't be...
26 #if defined (ACE_HAS_STREAM_PIPES)
27 # include "ace/SPIPE_Connector.h"
28 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
29 typedef ACE_SPIPE_Stream ACE_LOG_MSG_IPC_STREAM
;
30 typedef ACE_SPIPE_Connector ACE_LOG_MSG_IPC_CONNECTOR
;
31 typedef ACE_SPIPE_Addr ACE_LOG_MSG_IPC_ADDR
;
32 ACE_END_VERSIONED_NAMESPACE_DECL
34 # include "ace/SOCK_Connector.h"
35 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
36 typedef ACE_SOCK_Stream ACE_LOG_MSG_IPC_STREAM
;
37 typedef ACE_SOCK_Connector ACE_LOG_MSG_IPC_CONNECTOR
;
38 typedef ACE_INET_Addr ACE_LOG_MSG_IPC_ADDR
;
39 ACE_END_VERSIONED_NAMESPACE_DECL
40 #endif /* ACE_HAS_STREAM_PIPES */
42 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
44 /// Defines the interfaces for ACE_Log_Msg backend.
46 * Implement an ACE_Log_Msg_Backend that logs to a remote logging
49 class ACE_Export ACE_Log_Msg_IPC
: public ACE_Log_Msg_Backend
53 ACE_Log_Msg_IPC (void);
56 virtual ~ACE_Log_Msg_IPC (void);
58 /// Open a new connection
59 virtual int open (const ACE_TCHAR
*logger_key
);
62 * Reset the backend. When changing the logging destination the
63 * backend may need to properly disconnect from the remote logging
64 * daemon and reclaim some local resources. But we try to reduce
65 * the number of local allocations/deallocations.
67 virtual int reset (void);
69 virtual int close (void);
70 virtual ssize_t
log (ACE_Log_Record
&log_record
);
73 ACE_LOG_MSG_IPC_STREAM message_queue_
;
76 ACE_END_VERSIONED_NAMESPACE_DECL
78 #include /**/ "ace/post.h"
79 #endif /* ACE_LOG_MSG_H */