class LoopbackConnectionFactory

Defined at line 35 of file ../../src/zircon/bin/hwstress/testing_util.h

LoopbackConnectionFactory simplifies creation of client connections

to a local object implementing a FIDL interface.

For example, use as follows:

// Create a factory.

LoopbackConnectionFactory factory;

// Create an object implementing "FidlProtocol".

FakeFidlProtocolImpl instance;

// Create a channel to it...

zx::channel channel = factory.CreateChannelTo

<FidlProtocol

>(

&instance

);

// ... or generate a sync binding.

FidlProtocolSyncPtr ptr = factory.CreateSyncPtrTo

<FidlProtocol

>(

&instance

);

The channels will continue to be serviced while ever the

LoopbackConnectionFactory remains live.

Public Methods

void LoopbackConnectionFactory ()

Defined at line 37 of file ../../src/zircon/bin/hwstress/testing_util.h

void ~LoopbackConnectionFactory ()

Defined at line 39 of file ../../src/zircon/bin/hwstress/testing_util.h

template <typename T>
zx::channel CreateChannelTo (T * impl)

Create a channel to |impl| implementing FIDL interface |T|.

Defined at line 46 of file ../../src/zircon/bin/hwstress/testing_util.h

template <typename T>
fidl::SynchronousInterfacePtr<T> CreateSyncPtrTo (T * impl)

Create a fidl::SynchronousInterfacePtr to |impl| implementing FIDL

interface |T|.

Defined at line 59 of file ../../src/zircon/bin/hwstress/testing_util.h