Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
99705e8b
Commit
99705e8b
authored
Mar 03, 2017
by
Francis Dupont
Browse files
[master] Merged trac1205a (unparse design)
parents
c43220c5
f0c87775
Changes
4
Hide whitespace changes
Inline
Side-by-side
configure.ac
View file @
99705e8b
...
...
@@ -187,6 +187,20 @@ for retry in "none" "--std=c++11" "--std=c++0x" "--std=c++1x" "fail"; do
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(variadic template support)
feature="variadic template"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[template<typename ... Args>
struct A {
void foo(Args... myargs) { return; };
};],
[A<> a;
a.foo();])],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
continue])
AC_MSG_CHECKING(lambda support)
feature="lambda"
AC_COMPILE_IFELSE(
...
...
src/lib/cc/Makefile.am
View file @
99705e8b
...
...
@@ -6,7 +6,7 @@ AM_CXXFLAGS = $(KEA_CXXFLAGS)
lib_LTLIBRARIES
=
libkea-cc.la
libkea_cc_la_SOURCES
=
data.cc data.h
libkea_cc_la_SOURCES
+=
dhcp_config_error.h
libkea_cc_la_SOURCES
+=
cfg_to_element.h
dhcp_config_error.h
libkea_cc_la_SOURCES
+=
command_interpreter.cc command_interpreter.h
libkea_cc_la_SOURCES
+=
simple_parser.cc simple_parser.h
...
...
@@ -18,7 +18,7 @@ libkea_cc_la_LDFLAGS = -no-undefined -version-info 1:0:0
# Since data.h is now used in the hooks interface, it needs to be
# installed on target system.
libkea_cc_includedir
=
$(pkgincludedir)
/cc
libkea_cc_include_HEADERS
=
data.h dhcp_config_error.h
libkea_cc_include_HEADERS
=
cfg_to_element.h
data.h dhcp_config_error.h
EXTRA_DIST
=
cc.dox
...
...
src/lib/cc/cfg_to_element.h
0 → 100644
View file @
99705e8b
// Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
#ifndef CFG_TO_ELEMENT_H
#define CFG_TO_ELEMENT_H
#include
<exceptions/exceptions.h>
#include
<cc/data.h>
namespace
isc
{
/// @brief Cannot unparse error
///
/// This exception is expected to be thrown when toElement fails
/// and to skip flawed elements is not wanted.
class
ToElementError
:
public
isc
::
Exception
{
public:
ToElementError
(
const
char
*
file
,
size_t
line
,
const
char
*
what
)
:
isc
::
Exception
(
file
,
line
,
what
)
{
};
};
namespace
data
{
/// @brief Abstract class for configuration Cfg_* classes
///
struct
CfgToElement
{
/// Destructor
virtual
~
CfgToElement
()
{
}
/// @brief Unparse a configuration objet
///
/// Returns an element which must parse into the same objet, i.e.
/// @code
/// for all valid config C parse(parse(C)->toElement()) == parse(C)
/// @endcode
///
/// @return a pointer to a configuration which can be parsed into
/// the initial configuration object
virtual
isc
::
data
::
ElementPtr
toElement
()
const
=
0
;
};
};
// namespace isc::dhcp
};
// namespace isc
#endif // CFG_TO_ELEMENT_H
src/lib/dhcpsrv/libdhcpsrv.dox
View file @
99705e8b
// Copyright (C) 2012-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
7
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -79,6 +79,15 @@ configuration. For example: the value of 1 identifies an immediate
predecessor of the current configuration, the value of 2 identifies the
one that occurred before it etc.
All configuration classes are derived from the abstract base class
\ref isc::data::CfgToElement and define the toElement virtual method
which returns a \ref isc::data::ConstElementPtr which must be
parsed into the same object, i.e. fullfil this property:
@code
for all valid C: parse(parse(C)->toElement()) == parse(C)
@endcode
@section hostmgr Host Manager
Host Manager implemented by the \ref isc::dhcp::HostMgr is a singleton object
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment