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


C++ ObjectRef::reset方法代码示例

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


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

示例1: MainThread

void MainThread()
{
	// Avoid program exit on broken pipe
	ACE_OS::signal (SIGPIPE, (ACE_SignalHandler) SIG_IGN);
	OrkLogManager::Instance()->Initialize();
	LOG4CXX_INFO(LOG.rootLog, CStdString("\n\nOrkAudio service starting\n"));

	ConfigManager::Instance()->Initialize();

	// Initialize object factory and register existing objects
	ObjectFactory::GetSingleton()->Initialize();

	ObjectRef objRef;
	objRef.reset(new PingMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new TapeMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new TapeResponse);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new SimpleResponseMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new DeleteTapeMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new CaptureMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new TcpPingMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new ReportingSkipTapeMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new RecordMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new PauseMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new StopMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	objRef.reset(new InitMsg);
	ObjectFactory::GetSingleton()->RegisterObject(objRef);
	//objRef.reset(new CrashMsg);
	//ObjectFactory::GetSingleton()->RegisterObject(objRef);
	//objRef.reset(new TestMsg);
	//ObjectFactory::GetSingleton()->RegisterObject(objRef);

	bool capturePluginOk = false;
	if(CapturePluginProxy::Singleton()->Initialize())
	{
		capturePluginOk = true;
	}

	std::list<ACE_DLL> pluginDlls;
	LoadPlugins(pluginDlls);

	// Register in-built filters
	FilterRef filter(new AlawToPcmFilter());
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new UlawToPcmFilter());
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new GsmToPcmFilter());
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new IlbcToPcmFilter());
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new AudioGainFilter());
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new G722ToPcmFilter());
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new SpeexDecoder() );
	FilterRegistry::instance()->RegisterFilter(filter);
	filter.reset(new G721CodecDecoder());
	FilterRegistry::instance()->RegisterFilter(filter);
	
	// Register in-built tape processors and build the processing chain
	OrkTrack::Initialize(CONFIG.m_trackerHostname, CONFIG.m_trackerServicename, CONFIG.m_trackerTcpPort);
	BatchProcessing::Initialize();
	CommandProcessing::Initialize();
	Reporting::Initialize();
	TapeFileNaming::Initialize();
	DirectionSelector::Initialize();
	TapeProcessorRegistry::instance()->CreateProcessingChain();

	if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(ImmediateProcessing::ThreadHandler)))
	{
		LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create immediate processing thread"));
	}
	if(CONFIG.m_storageAudioFormat != FfNative)
	{
		// storage format is not native, which means we need batch workers to compress to wanted format 
		if (!ACE_Thread_Manager::instance()->spawn_n(CONFIG.m_numBatchThreads, ACE_THR_FUNC(BatchProcessing::ThreadHandler)))
		{
			LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create batch processing thread"));
		}
	}
	if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(Reporting::ThreadHandler)))
	{
		LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create reporting thread"));
	}
	if (!ACE_Thread_Manager::instance()->spawn(ACE_THR_FUNC(TapeFileNaming::ThreadHandler)))
	{
		LOG4CXX_INFO(LOG.rootLog, CStdString("Failed to create tape file naming thread"));
	}

	if (!ACE_Thread_Manager::instance()->spawn_n(CONFIG.m_numCommandThreads,ACE_THR_FUNC(CommandProcessing::ThreadHandler)))
//.........这里部分代码省略.........
开发者ID:HiPiH,项目名称:Oreka,代码行数:101,代码来源:OrkAudio.cpp


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