Kea  2.1.7-git
user_context.cc
Go to the documentation of this file.
1 // Copyright (C) 2017-2020 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 #include <config.h>
8 #include <cc/user_context.h>
9 
10 
11 namespace isc {
12 namespace data {
13 
14 void
16  // Set user-context extracting comment
17  ConstElementPtr context = getContext();
18  if (context) {
19  map->set("user-context", context);
20  }
21 }
22 
25  ElementPtr result = isc::data::copy(map);
26  return (result);
27 }
28 
29 }; // end of isc::dhcp namespace
30 }; // end of isc namespace
data::ConstElementPtr getContext() const
Returns const pointer to the user context.
Definition: user_context.h:24
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
ElementPtr copy(ConstElementPtr from, int level)
Copy the data up to a nesting level.
Definition: data.cc:1152
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy an Element map.
Definition: user_context.cc:24
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.
Definition: user_context.cc:15
Defines the logger used by the top-level component of kea-lfc.