1 /** @file
2 
3   A brief file description
4 
5   @section license License
6 
7   Licensed to the Apache Software Foundation (ASF) under one
8   or more contributor license agreements.  See the NOTICE file
9   distributed with this work for additional information
10   regarding copyright ownership.  The ASF licenses this file
11   to you under the Apache License, Version 2.0 (the
12   "License"); you may not use this file except in compliance
13   with the License.  You may obtain a copy of the License at
14 
15       http://www.apache.org/licenses/LICENSE-2.0
16 
17   Unless required by applicable law or agreed to in writing, software
18   distributed under the License is distributed on an "AS IS" BASIS,
19   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20   See the License for the specific language governing permissions and
21   limitations under the License.
22  */
23 
24 #pragma once
25 
26 #include "LogBuffer.h"
27 
28 /**********************************************************************
29 The LogBufferSink class in an abstract class that provides an interface
30 for classes that take a LogBuffer and write it to disk or send it over
31 the network
32 **********************************************************************/
33 
34 class LogBufferSink
35 {
36 public:
37   //
38   // The preproc_and_try_delete() function should be responsible for
39   // freeing memory pointed to by _buffer_ parameter.
40   //
41   // Of course, this function may not free memory directly, it
42   // can delegate another function to do it.
43   //
44   // return 0 if success, -1 on error.
45   //
46   virtual int preproc_and_try_delete(LogBuffer *buffer) = 0;
~LogBufferSink()47   virtual ~LogBufferSink(){};
48 };
49