本文整理汇总了C++中OutputPort::getLastWrittenValue方法的典型用法代码示例。如果您正苦于以下问题:C++ OutputPort::getLastWrittenValue方法的具体用法?C++ OutputPort::getLastWrittenValue怎么用?C++ OutputPort::getLastWrittenValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OutputPort
的用法示例。
在下文中一共展示了OutputPort::getLastWrittenValue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createConnection
static bool createConnection(OutputPort<T>& output_port, base::InputPortInterface& input_port, ConnPolicy const& policy)
{
if ( !output_port.isLocal() ) {
log(Error) << "Need a local OutputPort to create connections." <<endlog();
return false;
}
InputPort<T>* input_p = dynamic_cast<InputPort<T>*>(&input_port);
// This is the input channel element of the output half
base::ChannelElementBase::shared_ptr output_half = 0;
if (input_port.isLocal() && policy.transport == 0)
{
// Local connection
if (!input_p)
{
log(Error) << "Port " << input_port.getName() << " is not compatible with " << output_port.getName() << endlog();
return false;
}
// local ports, create buffer here.
output_half = buildBufferedChannelOutput<T>(*input_p, output_port.getPortID(), policy, output_port.getLastWrittenValue());
}
else
{
// if the input is not local, this is a pure remote connection,
// if the input *is* local, the user requested to use a different transport
// than plain memory, rare case, but we accept it. The unit tests use this for example
// to test the OOB transports.
if ( !input_port.isLocal() ) {
output_half = createRemoteConnection( output_port, input_port, policy);
} else
output_half = createOutOfBandConnection<T>( output_port, *input_p, policy);
}
if (!output_half)
return false;
// Since output is local, buildChannelInput is local as well.
// This this the input channel element of the whole connection
base::ChannelElementBase::shared_ptr channel_input =
buildChannelInput<T>(output_port, input_port.getPortID(), output_half);
return createAndCheckConnection(output_port, input_port, channel_input, policy );
}
示例2: buildBufferedChannelInput
static base::ChannelElementBase::shared_ptr buildBufferedChannelInput(OutputPort<T>& port, ConnID* conn_id, ConnPolicy const& policy, base::ChannelElementBase::shared_ptr output_channel)
{
assert(conn_id);
base::ChannelElementBase::shared_ptr endpoint = new ConnInputEndpoint<T>(&port, conn_id);
base::ChannelElementBase::shared_ptr data_object = buildDataStorage<T>(policy, port.getLastWrittenValue() );
endpoint->setOutput(data_object);
if (output_channel)
data_object->setOutput(output_channel);
return endpoint;
}