Kea 2.7.5
message_initializer.h
Go to the documentation of this file.
1// Copyright (C) 2011-2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef MESSAGEINITIALIZER_H
8#define MESSAGEINITIALIZER_H
9
10#include <boost/noncopyable.hpp>
11#include <boost/shared_ptr.hpp>
12#include <cstdlib>
13#include <list>
14#include <string>
15
16namespace isc {
17namespace log {
18
19// Declare the MessageDictionary class to allow a pointer to it to be defined.
20class MessageDictionary;
21
24//\{
26typedef std::list<const char**> LoggerValuesList;
28typedef boost::shared_ptr<LoggerValuesList> LoggerValuesListPtr;
29
31typedef std::list<std::string> LoggerDuplicatesList;
33typedef boost::shared_ptr<LoggerDuplicatesList> LoggerDuplicatesListPtr;
34//\}
35
71
72class MessageInitializer : public boost::noncopyable {
73public:
74
84 MessageInitializer(const char* values[]);
85
98
106 static size_t getPendingCount();
107
117 static void loadDictionary(bool ignore_duplicates = false);
118
126 static const std::list<std::string>& getDuplicates();
127
131 static void clearDuplicates();
132
133private:
134
136 const char** values_;
137
146 boost::shared_ptr<MessageDictionary> global_dictionary_;
147
155 LoggerValuesListPtr global_logger_values_;
156
164 LoggerDuplicatesListPtr global_logger_duplicates_;
165};
166
167} // namespace log
168} // namespace isc
169
170#endif // MESSAGEINITIALIZER_H
Initialize Message Dictionary.
static void loadDictionary(bool ignore_duplicates=false)
Run-Time Initialization.
static size_t getPendingCount()
Obtain pending load count.
MessageInitializer(const char *values[])
Constructor.
static const std::list< std::string > & getDuplicates()
Return Duplicates.
static void clearDuplicates()
Clear the static duplicates list.
std::list< const char ** > LoggerValuesList
List of pointers to the messages.
boost::shared_ptr< LoggerValuesList > LoggerValuesListPtr
Shared pointer to the list of pointers to the messages.
boost::shared_ptr< LoggerDuplicatesList > LoggerDuplicatesListPtr
Shared pointer to the list of duplicated messages.
std::list< std::string > LoggerDuplicatesList
List of duplicated messages.
Defines the logger used by the top-level component of kea-lfc.