本文整理汇总了C++中O2G2Ptr::requiresPin方法的典型用法代码示例。如果您正苦于以下问题:C++ O2G2Ptr::requiresPin方法的具体用法?C++ O2G2Ptr::requiresPin怎么用?C++ O2G2Ptr::requiresPin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类O2G2Ptr
的用法示例。
在下文中一共展示了O2G2Ptr::requiresPin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onSessionStatusChanged
void SessionStatusListener::onSessionStatusChanged(IO2GSessionStatus::O2GSessionStatus status)
{
BOOST_LOG_TRIVIAL(trace) << __PRETTY_FUNCTION__;
switch (status)
{
case IO2GSessionStatus::Disconnected:
BOOST_LOG_TRIVIAL(info) << "status::disconnected";
mConnected = false;
mDisconnected = true;
SetEvent(mSessionEvent);
break;
case IO2GSessionStatus::Connecting:
BOOST_LOG_TRIVIAL(info) << "status::connecting";
break;
case IO2GSessionStatus::TradingSessionRequested:
{
BOOST_LOG_TRIVIAL(info) << "status::trading session requested";
O2G2Ptr<IO2GSessionDescriptorCollection> descriptors = mSession->getTradingSessionDescriptors();
bool found = false;
if (descriptors)
{
if (mPrintSubsessions)
BOOST_LOG_TRIVIAL(info) << "descriptors available:";
for (int i = 0; i < descriptors->size(); ++i)
{
O2G2Ptr<IO2GSessionDescriptor> descriptor = descriptors->get(i);
if (mPrintSubsessions)
BOOST_LOG_TRIVIAL(info) << " id:='" << descriptor->getID()
<< "' name='" << descriptor->getName()
<< "' description='" << descriptor->getDescription()
<< "' " << (descriptor->requiresPin() ? "requires pin" : "");
if (mSessionID == descriptor->getID())
{
found = true;
break;
}
}
}
if (!found)
{
onLoginFailed("The specified sub session identifier is not found");
}
else
{
mSession->setTradingSession(mSessionID.c_str(), mPin.c_str());
}
}
break;
case IO2GSessionStatus::Connected:
BOOST_LOG_TRIVIAL(info) << "status::connected";
mConnected = true;
mDisconnected = false;
SetEvent(mSessionEvent);
break;
case IO2GSessionStatus::Reconnecting:
BOOST_LOG_TRIVIAL(info) << "status::reconnecting";
break;
case IO2GSessionStatus::Disconnecting:
BOOST_LOG_TRIVIAL(info) << "status::disconnecting";
break;
case IO2GSessionStatus::SessionLost:
BOOST_LOG_TRIVIAL(info) << "status::session lost";
break;
}
}