Make modules and methods non-copyable & non-movable
Modules and methods are never duplicated or moved in a memory. Moving constructors and operators are dead code. Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
@@ -44,8 +44,6 @@ namespace eap
|
||||
///
|
||||
class method_eaphost : public method
|
||||
{
|
||||
WINSTD_NONCOPYABLE(method_eaphost)
|
||||
|
||||
public:
|
||||
///
|
||||
/// Constructs an EAP method
|
||||
@@ -56,22 +54,6 @@ namespace eap
|
||||
///
|
||||
method_eaphost(_In_ module &mod, _In_ config_method_eaphost &cfg, _In_ credentials_eaphost &cred);
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
method_eaphost(_Inout_ method_eaphost &&other) noexcept;
|
||||
|
||||
///
|
||||
/// Moves an EAP method
|
||||
///
|
||||
/// \param[in] other EAP method to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
method_eaphost& operator=(_Inout_ method_eaphost &&other) noexcept;
|
||||
|
||||
/// \name Session management
|
||||
/// @{
|
||||
|
||||
|
@@ -37,28 +37,6 @@ eap::method_eaphost::method_eaphost(_In_ module &mod, _In_ config_method_eaphost
|
||||
}
|
||||
|
||||
|
||||
eap::method_eaphost::method_eaphost(_Inout_ method_eaphost &&other) noexcept :
|
||||
m_cfg ( other.m_cfg ),
|
||||
m_cred ( other.m_cred ),
|
||||
m_session_id(std::move(other.m_session_id)),
|
||||
method (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_eaphost& eap::method_eaphost::operator=(_Inout_ method_eaphost &&other) noexcept
|
||||
{
|
||||
if (this != std::addressof(other)) {
|
||||
assert(std::addressof(m_cfg ) == std::addressof(other.m_cfg )); // Move method within same configuration only!
|
||||
assert(std::addressof(m_cred) == std::addressof(other.m_cred)); // Move method within same credentials only!
|
||||
(method&)*this = std::move(other );
|
||||
m_session_id = std::move(other.m_session_id);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_eaphost::begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
|
Reference in New Issue
Block a user