当前位置: 首页>>代码示例>>C++>>正文


C++ StringVectorDataPtr::readable方法代码示例

本文整理汇总了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();
	}

}
开发者ID:Alwnikrotikz,项目名称:cortex-vfx,代码行数:66,代码来源:DisplayDriverServer.cpp


注:本文中的StringVectorDataPtr::readable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。