-// Copyright (C) 2014-2019 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2020 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
: data::StampedElement(), option_(OptionPtr()), persistent_(persist),
formatted_value_(), space_name_() {};
- /// @brief Constructor.
+ /// @brief Copy constructor.
///
/// @param desc option descriptor to be copied.
OptionDescriptor(const OptionDescriptor& desc)
setContext(desc.getContext());
};
+ /// @brief Assignment operator.
+ ///
+ /// @param other option descriptor to be assigned from.
+ OptionDescriptor& operator=(const OptionDescriptor& other) {
+ if (this != &other) {
+ // Not self-assignment.
+ data::StampedElement(other);
+ option_ = other.option_;
+ persistent_ = other.persistent_;
+ formatted_value_ = other.formatted_value_;
+ space_name_ = other.space_name_;
+ setContext(other.getContext());
+ }
+ return (*this);
+ }
+
/// @brief Factory function creating an instance of the @c OptionDescriptor.
///
/// @param opt option instance.
/// \note No validation is done on the given data upon construction;
/// use with care.
///
- /// \param ls The LabelSequence to construct a LabelSequence from
+ /// \param other The LabelSequence to assign a LabelSequence from
LabelSequence& operator=(const LabelSequence& other) {
if (this != &other) {
// Not self-assignment.