本文整理汇总了C++中StringVectorDataPtr::readable方法的典型用法代码示例。如果您正苦于以下问题:C++ StringVectorDataPtr::readable方法的具体用法?C++ StringVectorDataPtr::readable怎么用?C++ StringVectorDataPtr::readable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StringVectorDataPtr
的用法示例。
在下文中一共展示了StringVectorDataPtr::readable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MemoryIndexedIO
void DisplayDriverServer::Session::handleReadOpenParameters( const boost::system::error_code& error )
{
if (error)
{
msg( Msg::Error, "DisplayDriverServer::Session::handleReadOpenParameters", error.message().c_str() );
m_socket.close();
return;
}
StringDataPtr displayDriverType;
Box2iDataPtr displayWindow, dataWindow;
StringVectorDataPtr channelNames;
CompoundDataPtr parameters;
bool scanLineOrder = false;
bool acceptsRepeatedData = false;
// handle imageOpen parameters.
try
{
MemoryIndexedIOPtr io = new MemoryIndexedIO( m_buffer, IndexedIO::rootPath, IndexedIO::Exclusive | IndexedIO::Read );
displayWindow = staticPointerCast<Box2iData>( Object::load( io, "displayWindow" ) );
dataWindow = staticPointerCast<Box2iData>( Object::load( io, "dataWindow" ) );
channelNames = staticPointerCast<StringVectorData>( Object::load( io, "channelNames" ) );
parameters = staticPointerCast<CompoundData>( Object::load( io, "parameters" ) );
const StringData *displayType = parameters->member<StringData>( "remoteDisplayType", true /* throw if missing */ );
// create a displayDriver using the factory function.
m_displayDriver = DisplayDriver::create( displayType->readable(), displayWindow->readable(), dataWindow->readable(), channelNames->readable(), parameters );
scanLineOrder = m_displayDriver->scanLineOrderOnly();
acceptsRepeatedData = m_displayDriver->acceptsRepeatedData();
}
catch( std::exception &e )
{
msg( Msg::Error, "DisplayDriverServer::Session::handleReadOpenParameters", e.what() );
sendException( e.what() );
m_socket.close();
return;
}
try
{
// send the result back.
sendResult( DisplayDriverServerHeader::imageOpen, sizeof(scanLineOrder) );
m_socket.send( boost::asio::buffer( &scanLineOrder, sizeof(scanLineOrder) ) );
sendResult( DisplayDriverServerHeader::imageOpen, sizeof(acceptsRepeatedData) );
m_socket.send( boost::asio::buffer( &acceptsRepeatedData, sizeof(acceptsRepeatedData) ) );
// prepare for getting imageData packages
boost::asio::async_read( m_socket,
boost::asio::buffer( m_header.buffer(), m_header.headerLength),
boost::bind(
&DisplayDriverServer::Session::handleReadHeader, SessionPtr(this),
boost::asio::placeholders::error
)
);
}
catch( std::exception &e )
{
msg( Msg::Error, "DisplayDriverServer::Session::handleReadOpenParameters", e.what() );
m_socket.close();
}
}