Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Log_Msg_Backend.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    Log_Msg_Backend.h
00006  *
00007  *  $Id: Log_Msg_Backend.h,v 1.1.1.2 2003/02/21 18:36:32 chad Exp $
00008  *
00009  *  @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
00010  */
00011 //=============================================================================
00012 
00013 
00014 #ifndef ACE_LOG_MSG_BACKEND_H
00015 #define ACE_LOG_MSG_BACKEND_H
00016 #include "ace/pre.h"
00017 
00018 #include "ace/ACE_export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 class ACE_Log_Record;
00025 
00026 /**
00027  * @class ACE_Log_Msg_Backend
00028  *
00029  * @brief Define the interface for ACE_Log_Msg backend strategies.
00030  *
00031  * The ACE_Log_Msg class can log to multiple backend strategies, for
00032  * example, some send messages to a remote logger, others dump to a
00033  * file, or simply to stderr.  In the future we could define
00034  * interfaces that log to the syslog daemon (on UNIX), the Event log
00035  * (on NT) a temporary ring buffer, etc.
00036  */
00037 class ACE_Export ACE_Log_Msg_Backend
00038 {
00039 public:
00040   /// No-op virtual destructor.
00041   virtual ~ACE_Log_Msg_Backend (void);
00042 
00043   /// Open a new connection
00044   virtual int open (const ACE_TCHAR *logger_key) = 0;
00045 
00046   /*
00047    * Reset the backend.  When changing the logging destination the
00048    * backend may need to properly disconnect from the remote logging
00049    * daemon and reclaim some local resources.  But we try to reduce
00050    * the number of local allocations/deallocations.
00051    */
00052   virtual int reset (void) = 0;
00053 
00054   /// Close the backend completely.
00055   virtual int close (void) = 0;
00056 
00057   /// Backend routine.  This is called when we want to log a message.
00058   /// Since this routine is pure virtual, it must be overwritten by the
00059   /// subclass.
00060   virtual int log (ACE_Log_Record &log_record) = 0;
00061 };
00062 
00063 #include "ace/post.h"
00064 #endif /* ACE_LOG_MSG_BACKEND_H */

Generated on Mon Jun 16 11:20:00 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002