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