Kea  1.9.9-git
user_context.h
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 #ifndef USER_CONTEXT_H
8 #define USER_CONTEXT_H
9 
10 #include <cc/data.h>
11 #include <boost/shared_ptr.hpp>
12 
13 namespace isc {
14 namespace data {
15 
22 struct UserContext {
25  return (user_context_);
26  }
27 
30  void setContext(const data::ConstElementPtr& ctx) {
31  user_context_ = ctx;
32  }
33 
39  void contextToElement(data::ElementPtr map) const;
40 
48 
49 protected:
50 
53 };
54 
55 } // end of isc::dhcp namespace
56 } // end of isc namespace
57 
58 
59 #endif // USER_CONTEXT_H
void setContext(const data::ConstElementPtr &ctx)
Sets user context.
Definition: user_context.h:30
Base class for user context.
Definition: user_context.h:22
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.
Definition: user_context.cc:15
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy an Element map.
Definition: user_context.cc:24
data::ConstElementPtr getContext() const
Returns const pointer to the user context.
Definition: user_context.h:24
Defines the logger used by the top-level component of kea-dhcp-ddns.
data::ConstElementPtr user_context_
Pointer to the user context (may be NULL)
Definition: user_context.h:52