log4cplus
2.0.6
include
log4cplus
spi
objectregistry.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
// Module: Log4CPLUS
3
// File: objectregistry.h
4
// Created: 3/2003
5
// Author: Tad E. Smith
6
//
7
//
8
// Copyright 2003-2017 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
24
#ifndef LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
25
#define LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
26
27
#include <
log4cplus/config.hxx
>
28
29
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
30
#pragma once
31
#endif
32
33
#include <
log4cplus/tstring.h
>
34
#include <
log4cplus/thread/syncprims.h
>
35
#include <map>
36
#include <memory>
37
#include <vector>
38
39
40
namespace
log4cplus
{
41
namespace
spi {
42
47
class
LOG4CPLUS_EXPORT
ObjectRegistryBase
{
48
public
:
49
// public methods
54
bool
exists(
const
log4cplus::tstring
& name)
const
;
55
59
std::vector<log4cplus::tstring> getAllNames()
const
;
60
64
void
_enableLocking (
bool
);
65
66
protected
:
67
// Ctor and Dtor
68
ObjectRegistryBase
();
69
virtual
~
ObjectRegistryBase
();
70
71
// protected methods
76
bool
putVal(
const
log4cplus::tstring
& name,
void
*
object
);
77
82
void
* getVal(
const
log4cplus::tstring
& name)
const
;
83
87
virtual
void
deleteObject(
void
*
object
)
const
= 0;
88
92
virtual
void
clear();
93
94
// Types
95
typedef
std::map<log4cplus::tstring, void*>
ObjectMap
;
96
97
// Data
98
thread::Mutex
mutex
;
99
ObjectMap
data
;
100
101
private
:
102
ObjectRegistryBase
(
ObjectRegistryBase
const
&);
103
ObjectRegistryBase
& operator = (
ObjectRegistryBase
const
&);
104
105
bool
volatile
locking;
106
};
107
108
}
109
}
110
111
112
#endif // LOG4CPLUS_SPI_OBJECT_REGISTRY_HEADER_
113
tstring.h
log4cplus
Definition:
appender.h:46
log4cplus::tstring
std::basic_string< tchar > tstring
Definition:
tstring.h:39
log4cplus::spi::ObjectRegistryBase::data
ObjectMap data
Definition:
objectregistry.h:99
config.hxx
log4cplus::spi::ObjectRegistryBase::mutex
thread::Mutex mutex
Definition:
objectregistry.h:98
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition:
win32.h:141
log4cplus::spi::ObjectRegistryBase::ObjectMap
std::map< log4cplus::tstring, void * > ObjectMap
Definition:
objectregistry.h:95
log4cplus::thread::Mutex
Definition:
syncprims.h:63
syncprims.h
log4cplus::spi::ObjectRegistryBase
This is the base class used to implement the functionality required by the ObjectRegistry template cl...
Definition:
objectregistry.h:47
Generated on Fri Jun 18 2021 08:46:20 for log4cplus by
1.8.17