Refactor
Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
e2a279f30f
commit
49542a5f64
@ -32,8 +32,7 @@ namespace winstd
|
|||||||
/// \param[in] msg Error message
|
/// \param[in] msg Error message
|
||||||
///
|
///
|
||||||
com_runtime_error(_In_ error_type num, _In_ const std::string& msg) : num_runtime_error<HRESULT>(num, msg)
|
com_runtime_error(_In_ error_type num, _In_ const std::string& msg) : num_runtime_error<HRESULT>(num, msg)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructs an exception
|
/// Constructs an exception
|
||||||
@ -42,8 +41,7 @@ namespace winstd
|
|||||||
/// \param[in] msg Error message
|
/// \param[in] msg Error message
|
||||||
///
|
///
|
||||||
com_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error<HRESULT>(num, msg)
|
com_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) : num_runtime_error<HRESULT>(num, msg)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
@ -1033,8 +1033,7 @@ namespace winstd
|
|||||||
/// Initializes a new class instance with the object handle set to INVAL.
|
/// Initializes a new class instance with the object handle set to INVAL.
|
||||||
///
|
///
|
||||||
handle() noexcept : m_h(invalid)
|
handle() noexcept : m_h(invalid)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initializes a new class instance with an already available object handle.
|
/// Initializes a new class instance with an already available object handle.
|
||||||
@ -1042,8 +1041,7 @@ namespace winstd
|
|||||||
/// \param[in] h Initial object handle value
|
/// \param[in] h Initial object handle value
|
||||||
///
|
///
|
||||||
handle(_In_opt_ handle_type h) noexcept : m_h(h)
|
handle(_In_opt_ handle_type h) noexcept : m_h(h)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Move constructor
|
/// Move constructor
|
||||||
@ -1288,8 +1286,7 @@ namespace winstd
|
|||||||
/// Initializes a new class instance with the object handle set to INVAL.
|
/// Initializes a new class instance with the object handle set to INVAL.
|
||||||
///
|
///
|
||||||
dplhandle() noexcept
|
dplhandle() noexcept
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initializes a new class instance with an already available object handle.
|
/// Initializes a new class instance with an already available object handle.
|
||||||
@ -1297,8 +1294,7 @@ namespace winstd
|
|||||||
/// \param[in] h Initial object handle value
|
/// \param[in] h Initial object handle value
|
||||||
///
|
///
|
||||||
dplhandle(_In_opt_ handle_type h) noexcept : handle<handle_type, INVAL>(h)
|
dplhandle(_In_opt_ handle_type h) noexcept : handle<handle_type, INVAL>(h)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
@ -1306,8 +1302,7 @@ namespace winstd
|
|||||||
/// \param[inout] h A reference of another object
|
/// \param[inout] h A reference of another object
|
||||||
///
|
///
|
||||||
dplhandle<handle_type, INVAL>(_In_ const dplhandle<handle_type, INVAL> &h) : handle<handle_type, INVAL>(duplicate_internal(h.m_h))
|
dplhandle<handle_type, INVAL>(_In_ const dplhandle<handle_type, INVAL> &h) : handle<handle_type, INVAL>(duplicate_internal(h.m_h))
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Move constructor
|
/// Move constructor
|
||||||
@ -1315,8 +1310,7 @@ namespace winstd
|
|||||||
/// \param[inout] h A rvalue reference of another object
|
/// \param[inout] h A rvalue reference of another object
|
||||||
///
|
///
|
||||||
dplhandle<handle_type, INVAL>(_Inout_ dplhandle<handle_type, INVAL> &&h) noexcept : handle<handle_type, INVAL>(std::move(h))
|
dplhandle<handle_type, INVAL>(_Inout_ dplhandle<handle_type, INVAL> &&h) noexcept : handle<handle_type, INVAL>(std::move(h))
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Attaches already available object handle.
|
/// Attaches already available object handle.
|
||||||
@ -1494,8 +1488,7 @@ namespace winstd
|
|||||||
num_runtime_error(_In_ error_type num, _In_ const std::string& msg) :
|
num_runtime_error(_In_ error_type num, _In_ const std::string& msg) :
|
||||||
m_num(num),
|
m_num(num),
|
||||||
runtime_error(msg)
|
runtime_error(msg)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructs an exception
|
/// Constructs an exception
|
||||||
@ -1506,8 +1499,7 @@ namespace winstd
|
|||||||
num_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) :
|
num_runtime_error(_In_ error_type num, _In_opt_z_ const char *msg = nullptr) :
|
||||||
m_num(num),
|
m_num(num),
|
||||||
runtime_error(msg)
|
runtime_error(msg)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns the error number
|
/// Returns the error number
|
||||||
@ -1858,8 +1850,7 @@ namespace winstd
|
|||||||
///
|
///
|
||||||
string_guid(_In_ const GUID &guid) :
|
string_guid(_In_ const GUID &guid) :
|
||||||
basic_string_guid<char, std::char_traits<char>, std::allocator<char> >(guid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}")
|
basic_string_guid<char, std::char_traits<char>, std::allocator<char> >(guid, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}")
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
};
|
};
|
||||||
@ -1880,8 +1871,7 @@ namespace winstd
|
|||||||
///
|
///
|
||||||
wstring_guid(_In_ const GUID &guid) :
|
wstring_guid(_In_ const GUID &guid) :
|
||||||
basic_string_guid<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >(guid, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}")
|
basic_string_guid<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >(guid, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}")
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
};
|
};
|
||||||
@ -1930,23 +1920,20 @@ namespace winstd
|
|||||||
/// Construct default allocator
|
/// Construct default allocator
|
||||||
///
|
///
|
||||||
sanitizing_allocator() noexcept : _Mybase()
|
sanitizing_allocator() noexcept : _Mybase()
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Construct by copying
|
/// Construct by copying
|
||||||
///
|
///
|
||||||
sanitizing_allocator(_In_ const sanitizing_allocator<_Ty> &_Othr) : _Mybase(_Othr)
|
sanitizing_allocator(_In_ const sanitizing_allocator<_Ty> &_Othr) : _Mybase(_Othr)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Construct from a related allocator
|
/// Construct from a related allocator
|
||||||
///
|
///
|
||||||
template<class _Other>
|
template<class _Other>
|
||||||
sanitizing_allocator(_In_ const sanitizing_allocator<_Other> &_Othr) noexcept : _Mybase(_Othr)
|
sanitizing_allocator(_In_ const sanitizing_allocator<_Other> &_Othr) noexcept : _Mybase(_Othr)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Deallocate object at _Ptr sanitizing its content first
|
/// Deallocate object at _Ptr sanitizing its content first
|
||||||
|
@ -590,8 +590,7 @@ namespace winstd
|
|||||||
m_repair_desc (err.pRepairString ),
|
m_repair_desc (err.pRepairString ),
|
||||||
m_help_link_id (err.helpLinkGuid ),
|
m_help_link_id (err.helpLinkGuid ),
|
||||||
win_runtime_error(err.dwWinError, msg.c_str())
|
win_runtime_error(err.dwWinError, msg.c_str())
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructs an exception
|
/// Constructs an exception
|
||||||
@ -607,8 +606,7 @@ namespace winstd
|
|||||||
m_repair_desc (err.pRepairString ),
|
m_repair_desc (err.pRepairString ),
|
||||||
m_help_link_id (err.helpLinkGuid ),
|
m_help_link_id (err.helpLinkGuid ),
|
||||||
win_runtime_error(err.dwWinError )
|
win_runtime_error(err.dwWinError )
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructs an exception
|
/// Constructs an exception
|
||||||
@ -625,8 +623,7 @@ namespace winstd
|
|||||||
m_repair_desc (err.pRepairString ),
|
m_repair_desc (err.pRepairString ),
|
||||||
m_help_link_id (err.helpLinkGuid ),
|
m_help_link_id (err.helpLinkGuid ),
|
||||||
win_runtime_error(err.dwWinError, msg )
|
win_runtime_error(err.dwWinError, msg )
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Returns EAP method type
|
/// Returns EAP method type
|
||||||
|
@ -727,8 +727,7 @@ namespace winstd
|
|||||||
/// Initializes a new empty session.
|
/// Initializes a new empty session.
|
||||||
///
|
///
|
||||||
event_session()
|
event_session()
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initializes a new session with an already available object handle.
|
/// Initializes a new session with an already available object handle.
|
||||||
@ -751,8 +750,7 @@ namespace winstd
|
|||||||
event_session(_Inout_ event_session &&other) noexcept :
|
event_session(_Inout_ event_session &&other) noexcept :
|
||||||
m_prop(std::move(other.m_prop)),
|
m_prop(std::move(other.m_prop)),
|
||||||
handle(std::move(other))
|
handle(std::move(other))
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Closes the session.
|
/// Closes the session.
|
||||||
@ -1073,8 +1071,7 @@ namespace winstd
|
|||||||
m_ep(other.m_ep),
|
m_ep(other.m_ep),
|
||||||
m_event_dest(other.m_event_dest),
|
m_event_dest(other.m_event_dest),
|
||||||
m_fn_name(other.m_fn_name)
|
m_fn_name(other.m_fn_name)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Moves the object
|
/// Moves the object
|
||||||
|
@ -193,8 +193,7 @@ namespace winstd
|
|||||||
dc_selector(_In_ HDC hdc, _In_ HGDIOBJ h) noexcept :
|
dc_selector(_In_ HDC hdc, _In_ HGDIOBJ h) noexcept :
|
||||||
m_hdc(hdc),
|
m_hdc(hdc),
|
||||||
m_orig(SelectObject(hdc, h))
|
m_orig(SelectObject(hdc, h))
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Restores original object.
|
/// Restores original object.
|
||||||
|
@ -1343,8 +1343,7 @@ namespace winstd
|
|||||||
/// \param[in] heap Handle to existing heap
|
/// \param[in] heap Handle to existing heap
|
||||||
///
|
///
|
||||||
heap_allocator(_In_ HANDLE heap) : m_heap(heap)
|
heap_allocator(_In_ HANDLE heap) : m_heap(heap)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Constructs allocator from another type
|
/// Constructs allocator from another type
|
||||||
@ -1353,8 +1352,7 @@ namespace winstd
|
|||||||
///
|
///
|
||||||
template <class _Other>
|
template <class _Other>
|
||||||
heap_allocator(_In_ const heap_allocator<_Other> &other) : m_heap(other.m_heap)
|
heap_allocator(_In_ const heap_allocator<_Other> &other) : m_heap(other.m_heap)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Allocates a new memory block
|
/// Allocates a new memory block
|
||||||
@ -1651,8 +1649,7 @@ namespace winstd
|
|||||||
/// Initializes a new class instance with the memory handle set to INVAL.
|
/// Initializes a new class instance with the memory handle set to INVAL.
|
||||||
///
|
///
|
||||||
vmemory() noexcept : m_proc(NULL)
|
vmemory() noexcept : m_proc(NULL)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Initializes a new class instance with an already available object handle.
|
/// Initializes a new class instance with an already available object handle.
|
||||||
@ -1663,8 +1660,7 @@ namespace winstd
|
|||||||
vmemory(_In_ handle_type h, _In_ HANDLE proc) noexcept :
|
vmemory(_In_ handle_type h, _In_ HANDLE proc) noexcept :
|
||||||
m_proc(proc),
|
m_proc(proc),
|
||||||
handle<LPVOID, NULL>(h)
|
handle<LPVOID, NULL>(h)
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Move constructor
|
/// Move constructor
|
||||||
@ -1674,8 +1670,7 @@ namespace winstd
|
|||||||
vmemory(_Inout_ vmemory &&h) noexcept :
|
vmemory(_Inout_ vmemory &&h) noexcept :
|
||||||
m_proc(std::move(h.m_proc)),
|
m_proc(std::move(h.m_proc)),
|
||||||
handle<LPVOID, NULL>(std::move(h))
|
handle<LPVOID, NULL>(std::move(h))
|
||||||
{
|
{}
|
||||||
}
|
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Frees the memory.
|
/// Frees the memory.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user