00001 /** @file 00002 00003 A brief file description 00004 00005 @section license License 00006 00007 Licensed to the Apache Software Foundation (ASF) under one 00008 or more contributor license agreements. See the NOTICE file 00009 distributed with this work for additional information 00010 regarding copyright ownership. The ASF licenses this file 00011 to you under the Apache License, Version 2.0 (the 00012 "License"); you may not use this file except in compliance 00013 with the License. You may obtain a copy of the License at 00014 00015 http://www.apache.org/licenses/LICENSE-2.0 00016 00017 Unless required by applicable law or agreed to in writing, software 00018 distributed under the License is distributed on an "AS IS" BASIS, 00019 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00020 See the License for the specific language governing permissions and 00021 limitations under the License. 00022 */ 00023 00024 #ifndef LOG_BUFFER_SINK 00025 #define LOG_BUFFER_SINK 00026 00027 #include "LogBuffer.h" 00028 00029 /********************************************************************** 00030 The LogBufferSink class in an abstract class that provides an interface 00031 for classes that take a LogBuffer and write it to disk or send it over 00032 the network 00033 **********************************************************************/ 00034 00035 class LogBufferSink 00036 { 00037 public: 00038 // 00039 // The preproc_and_try_delete() function should be responsible for 00040 // freeing memory pointed to by _buffer_ parameter. 00041 // 00042 // Of course, this function may not free memory directly, it 00043 // can delegate another function to do it. 00044 // 00045 // return 0 if success, -1 on error. 00046 // 00047 virtual int preproc_and_try_delete(LogBuffer * buffer) = 0; 00048 virtual ~ LogBufferSink() 00049 { 00050 }; 00051 }; 00052 00053 #endif