1 // -*- C++ -*-
2 // Module:  Log4CPLUS
3 // File:    loggerfactory.h
4 // Created: 6/2001
5 // Author:  Tad E. Smith
6 //
7 //
8 // Copyright 2001-2010 Tad E. Smith
9 //
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
13 //
14 //     http://www.apache.org/licenses/LICENSE-2.0
15 //
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 
22 /** @file */
23 
24 #ifndef DCMTK_LOG4CPLUS_SPI_LOGGER_FACTORY_HEADER
25 #define DCMTK_LOG4CPLUS_SPI_LOGGER_FACTORY_HEADER
26 
27 #include "dcmtk/oflog/config.h"
28 
29 #if defined (DCMTK_LOG4CPLUS_HAVE_PRAGMA_ONCE)
30 #pragma once
31 #endif
32 
33 #include "dcmtk/oflog/tstring.h"
34 
35 
36 namespace dcmtk {
37 namespace log4cplus {
38     // Forward Declarations
39     class Logger;
40     class Hierarchy;
41 
42     namespace spi {
43         /**
44          * Implement this interface to create new instances of Logger or
45          * a sub-class of Logger.
46          */
47         class DCMTK_LOG4CPLUS_EXPORT LoggerFactory {
48         public:
49             /**
50              * Creates a new <code>Logger</code> object.
51              */
52             virtual Logger makeNewLoggerInstance(const log4cplus::tstring& name,
53                                                  Hierarchy& h) = 0;
54             virtual ~LoggerFactory() = 0;
55         };
56 
57     } // end namespace spi
58 } // end namespace log4cplus
59 } // end namespace dcmtk
60 
61 #endif // DCMTK_LOG4CPLUS_SPI_LOGGER_FACTORY_HEADER
62 
63