本文整理汇总了C++中Offer::owner方法的典型用法代码示例。如果您正苦于以下问题:C++ Offer::owner方法的具体用法?C++ Offer::owner怎么用?C++ Offer::owner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Offer
的用法示例。
在下文中一共展示了Offer::owner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fill
TER
Taker::cross (Offer const& leg1, Offer const& leg2)
{
// In bridged crossings, XRP must can't be the input to the first leg
// or the output of the second leg.
if (isXRP (leg1.amount ().in) || isXRP (leg2.amount ().out))
return tefINTERNAL;
auto ret = do_cross (
leg1.amount (), leg1.quality (), leg1.owner (),
leg2.amount (), leg2.quality (), leg2.owner ());
return fill (ret.first, leg1, ret.second, leg2);
}
示例2: assert
// Performs funds transfers to fill the given offer and adjusts offer.
TER
Taker::fill (BasicTaker::Flow const& flow, Offer const& offer)
{
// adjust offer
consume_offer (offer, flow.order);
TER result = tesSUCCESS;
if (cross_type () != CrossType::XrpToIou)
{
assert (!isXRP (flow.order.in));
if(result == tesSUCCESS)
result = redeemIOU (account (), flow.issuers.in, flow.issuers.in.issue ());
if (result == tesSUCCESS)
result = issueIOU (offer.owner (), flow.order.in, flow.order.in.issue ());
}
else
{
assert (isXRP (flow.order.in));
if (result == tesSUCCESS)
result = transferXRP (account (), offer.owner (), flow.order.in);
}
// Now send funds from the account whose offer we're taking
if (cross_type () != CrossType::IouToXrp)
{
assert (!isXRP (flow.order.out));
if(result == tesSUCCESS)
result = redeemIOU (offer.owner (), flow.issuers.out, flow.issuers.out.issue ());
if (result == tesSUCCESS)
result = issueIOU (account (), flow.order.out, flow.order.out.issue ());
}
else
{
assert (isXRP (flow.order.out));
if (result == tesSUCCESS)
result = transferXRP (offer.owner (), account (), flow.order.out);
}
if (result == tesSUCCESS)
direct_crossings_++;
return result;
}
示例3: redeemIOU
// Performs bridged funds transfers to fill the given offers and adjusts offers.
TER
Taker::fill (
BasicTaker::Flow const& flow1, Offer const& leg1,
BasicTaker::Flow const& flow2, Offer const& leg2)
{
// Adjust offers accordingly
consume_offer (leg1, flow1.order);
consume_offer (leg2, flow2.order);
TER result = tesSUCCESS;
// Taker to leg1: IOU
if (leg1.owner () != account ())
{
if (result == tesSUCCESS)
result = redeemIOU (account (), flow1.issuers.in, flow1.issuers.in.issue ());
if (result == tesSUCCESS)
result = issueIOU (leg1.owner (), flow1.order.in, flow1.order.in.issue ());
}
// leg1 to leg2: bridging over XRP
if (result == tesSUCCESS)
result = transferXRP (leg1.owner (), leg2.owner (), flow1.order.out);
// leg2 to Taker: IOU
if (leg2.owner () != account ())
{
if (result == tesSUCCESS)
result = redeemIOU (leg2.owner (), flow2.issuers.out, flow2.issuers.out.issue ());
if (result == tesSUCCESS)
result = issueIOU (account (), flow2.order.out, flow2.order.out.issue ());
}
if (result == tesSUCCESS)
{
bridge_crossings_++;
xrp_flow_ += flow1.order.out;
}
return result;
}