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:
@@ -41,8 +41,6 @@ namespace eap
|
||||
///
|
||||
class method_pap_diameter : public method
|
||||
{
|
||||
WINSTD_NONCOPYABLE(method_pap_diameter)
|
||||
|
||||
public:
|
||||
///
|
||||
/// Constructs a PAP method
|
||||
@@ -53,22 +51,6 @@ namespace eap
|
||||
///
|
||||
method_pap_diameter(_In_ module &mod, _In_ config_method_pap &cfg, _In_ credentials_pass &cred);
|
||||
|
||||
///
|
||||
/// Moves a PAP method
|
||||
///
|
||||
/// \param[in] other PAP method to move from
|
||||
///
|
||||
method_pap_diameter(_Inout_ method_pap_diameter &&other) noexcept;
|
||||
|
||||
///
|
||||
/// Moves a PAP method
|
||||
///
|
||||
/// \param[in] other PAP method to move from
|
||||
///
|
||||
/// \returns Reference to this object
|
||||
///
|
||||
method_pap_diameter& operator=(_Inout_ method_pap_diameter &&other) noexcept;
|
||||
|
||||
/// \name Session management
|
||||
/// @{
|
||||
|
||||
|
@@ -37,30 +37,6 @@ eap::method_pap_diameter::method_pap_diameter(_In_ module &mod, _In_ config_meth
|
||||
}
|
||||
|
||||
|
||||
eap::method_pap_diameter::method_pap_diameter(_Inout_ method_pap_diameter &&other) noexcept :
|
||||
m_cfg ( other.m_cfg ),
|
||||
m_cred ( other.m_cred ),
|
||||
m_phase (std::move(other.m_phase )),
|
||||
m_packet_res(std::move(other.m_packet_res)),
|
||||
method (std::move(other ))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
eap::method_pap_diameter& eap::method_pap_diameter::operator=(_Inout_ method_pap_diameter &&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_phase = std::move(other.m_phase );
|
||||
m_packet_res = std::move(other.m_packet_res);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
void eap::method_pap_diameter::begin_session(
|
||||
_In_ DWORD dwFlags,
|
||||
_In_ const EapAttributes *pAttributeArray,
|
||||
|
Reference in New Issue
Block a user