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


C++ Ptr::setImported方法代码示例

本文整理汇总了C++中profile::Ptr::setImported方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::setImported方法的具体用法?C++ Ptr::setImported怎么用?C++ Ptr::setImported使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在profile::Ptr的用法示例。


在下文中一共展示了Ptr::setImported方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: parse_dives

void TransferWorker::parse_dives(Driver::Ptr driver, const dive_data_t & dives)
{
	IMixFinder::Ptr mf = boost::dynamic_pointer_cast<IMixFinder>(m_session->finder<Mix>());
	Mix::Ptr air = mf->findByName("Air");

	parser_data data;
	data.mixfinder = mf;

	// Parse the Dives
	dive_data_t::const_iterator it;
	for (it = dives.begin(); it != dives.end(); it++)
	{
		// Setup Parser Data
		data.dive.reset(new Dive);
		data.mixes.clear();
		data.profile.clear();
		data.vendor.clear();

		data.haswp = false;
		data.curmix = air;

		// Parse the Header and Profile
		driver->parse(it->first, & parse_header, & parse_profile, & data);

		// Append the final Waypoint
		if (data.haswp)
			data.profile.push_back(data.curwp);

		// Update Dive Data
		data.dive->setComputer(m_dc);

		// Set the Dive Mix as the first Mix in the profile
		if (data.haswp)
			data.dive->setMix(data.profile.begin()->mix);

		// Create Profile
		Profile::Ptr profile = Profile::Ptr(new Profile);
		profile->setComputer(m_dc);
		profile->setDive(data.dive);
		profile->setImported(time(NULL));
		profile->setProfile(data.profile);
		profile->setRawProfile(it->first);
		profile->setVendor(json_encode(data.vendor));

		// Emit Parsed Dive
		emit parsedDive(profile);
	}
}
开发者ID:asymworks,项目名称:benthos-app,代码行数:48,代码来源:transferworker.cpp


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