зеркало из https://github.com/microsoft/IPC.git
[native] Rename NullTimeoutFactory to InfiniteTimeoutFactory (#35)
This commit is contained in:
Родитель
bc155cee28
Коммит
08abfade38
|
@ -1,25 +1,25 @@
|
|||
#pragma once
|
||||
|
||||
#include "IPC/detail/Callback.h"
|
||||
#include <chrono>
|
||||
|
||||
|
||||
namespace IPC
|
||||
{
|
||||
namespace Policies
|
||||
{
|
||||
/// Provides infinite timeout behavior. The provided handler is not preserved.
|
||||
class NullTimeoutFactory
|
||||
{
|
||||
public:
|
||||
NullTimeoutFactory(const std::chrono::milliseconds& /*defaultTimeout*/ = {})
|
||||
{}
|
||||
|
||||
auto operator()(const detail::Callback<void()>& /*handler*/) const
|
||||
{
|
||||
return [](auto&&...) {};
|
||||
}
|
||||
};
|
||||
|
||||
} // Policies
|
||||
} // IPC
|
||||
#pragma once
|
||||
|
||||
#include "IPC/detail/Callback.h"
|
||||
#include <chrono>
|
||||
|
||||
|
||||
namespace IPC
|
||||
{
|
||||
namespace Policies
|
||||
{
|
||||
/// Provides infinite timeout behavior. The provided handler is not preserved.
|
||||
class InfiniteTimeoutFactory
|
||||
{
|
||||
public:
|
||||
InfiniteTimeoutFactory(const std::chrono::milliseconds& /*defaultTimeout*/ = {})
|
||||
{}
|
||||
|
||||
auto operator()(const detail::Callback<void()>& /*handler*/) const
|
||||
{
|
||||
return [](auto&&...) {};
|
||||
}
|
||||
};
|
||||
|
||||
} // Policies
|
||||
} // IPC
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "TransactionManagerFwd.h"
|
||||
#include "NullTimeoutFactory.h"
|
||||
#include "InfiniteTimeoutFactory.h"
|
||||
#include "IPC/detail/LockFree/IndexedObjectPool.h"
|
||||
#include <chrono>
|
||||
#include <cassert>
|
||||
|
|
|
@ -5,9 +5,9 @@ namespace IPC
|
|||
{
|
||||
namespace Policies
|
||||
{
|
||||
class NullTimeoutFactory;
|
||||
class InfiniteTimeoutFactory;
|
||||
|
||||
template <typename Context, typename TimeoutFactory = NullTimeoutFactory>
|
||||
template <typename Context, typename TimeoutFactory = InfiniteTimeoutFactory>
|
||||
class TransactionManager;
|
||||
|
||||
} // Policies
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
<ClInclude Include="..\..\Inc\IPC\Policies\AsyncReceiverFactory.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\ErrorHandler.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\InlineReceiverFactory.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\NullTimeoutFactory.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\InfiniteTimeoutFactory.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\ReceiverFactory.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\ReceiverFactoryFwd.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\ThreadPool.h" />
|
||||
|
|
|
@ -191,9 +191,6 @@
|
|||
<ClInclude Include="..\..\Inc\IPC\detail\LockFree\IndexedObjectPool.h">
|
||||
<Filter>detail\LockFree</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\NullTimeoutFactory.h">
|
||||
<Filter>Policies</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\ReceiverFactoryFwd.h">
|
||||
<Filter>Policies</Filter>
|
||||
</ClInclude>
|
||||
|
@ -207,6 +204,9 @@
|
|||
</ClInclude>
|
||||
<ClInclude Include="..\..\Inc\IPC\Version.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Transport.h" />
|
||||
<ClInclude Include="..\..\Inc\IPC\Policies\InfiniteTimeoutFactory.h">
|
||||
<Filter>Policies</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "IPC/DefaultTraits.h"
|
||||
#include "IPC/Policies/NullTimeoutFactory.h"
|
||||
#include "IPC/Policies/InfiniteTimeoutFactory.h"
|
||||
#include "WaitHandleFactoryMock.h"
|
||||
#include <exception>
|
||||
|
||||
|
@ -14,7 +14,7 @@ namespace Mocks
|
|||
{
|
||||
struct NullTimeoutTraits : DefaultTraits
|
||||
{
|
||||
using TimeoutFactory = Policies::NullTimeoutFactory;
|
||||
using TimeoutFactory = Policies::InfiniteTimeoutFactory;
|
||||
|
||||
template <typename Context>
|
||||
using TransactionManager = Policies::TransactionManager<Context, TimeoutFactory>;
|
||||
|
|
Загрузка…
Ссылка в новой задаче