Kea  1.9.9-git
message_initializer.h
Go to the documentation of this file.
1 // Copyright (C) 2011-2015,2017 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 
16 namespace isc {
17 namespace log {
18 
19 // Declare the MessageDictionary class to allow a pointer to it to be defined.
20 class MessageDictionary;
21 
24 //\{
26 typedef std::list<const char**> LoggerValuesList;
28 typedef boost::shared_ptr<LoggerValuesList> LoggerValuesListPtr;
29 
31 typedef std::list<std::string> LoggerDuplicatesList;
33 typedef boost::shared_ptr<LoggerDuplicatesList> LoggerDuplicatesListPtr;
34 //\}
35 
71 
72 class MessageInitializer : public boost::noncopyable {
73 public:
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 
133 private:
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
std::list< const char ** > LoggerValuesList
List of pointers to the messages.
Initialize Message Dictionary.
static void loadDictionary(bool ignore_duplicates=false)
Run-Time Initialization.
static const std::list< std::string > & getDuplicates()
Return Duplicates.
static void clearDuplicates()
Clear the static duplicates list.
std::list< std::string > LoggerDuplicatesList
List of duplicated messages.
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< LoggerDuplicatesList > LoggerDuplicatesListPtr
Shared pointer to the list of duplicated messages.
boost::shared_ptr< LoggerValuesList > LoggerValuesListPtr
Shared pointer to the list of pointers to the messages.
static size_t getPendingCount()
Obtain pending load count.
MessageInitializer(const char *values[])
Constructor.