Kea  1.5.0
user_context.h
Go to the documentation of this file.
1 // Copyright (C) 2017-2018 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 
40  void contextToElement(data::ElementPtr map) const;
41 
47 
48 protected:
49 
52 };
53 
54 } // end of isc::dhcp namespace
55 } // end of isc namespace
56 
57 
58 #endif // USER_CONTEXT_H
void setContext(const data::ConstElementPtr &ctx)
Sets user context.
Definition: user_context.h:30
data::ConstElementPtr getContext() const
Returns const pointer to the user context.
Definition: user_context.h:24
Base class for user context.
Definition: user_context.h:22
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy extracting comments an Element map.
Definition: user_context.cc:34
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-dhcp-ddns.
data::ConstElementPtr user_context_
Pointer to the user context (may be NULL)
Definition: user_context.h:51