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


C++ Program::Id方法代码示例

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


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

示例1: StopProgram

int ProgramManager::StopProgram( int programId )
{
	Process* process = this->runningPrograms[programId];
	if ( process == NULL )
	{
		EventLogger::Instance()->WriteVerbose( "Program with id %d is not started!", programId );
		return ERROR_PRNOTSTARTED_ID;
	}

	Program* program = process->GetProgram();
	if ( program == NULL )
	{
		EventLogger::Instance()->WriteVerbose( "Program with id %d is not started!", programId );
		return ERROR_PRNOTSTARTED_ID;
	}

	process->Stop();

	// to do !!!
	MappingManager::Instance()->FinalizeProgram( program );

	// delete process & program;
	// delete this->runningPrograms[program->Id()];
	this->runningPrograms[program->Id()] = NULL;
	this->runningPrograms.erase( program->Id() );

	return 0;
}
开发者ID:bobi-rakova,项目名称:Agilart-Run-Time,代码行数:28,代码来源:ProgramManager.cpp

示例2: Remove

bool Programs::Remove(const Program& program)
{
	Programs::iterator it = std::find(m_programs.begin(), m_programs.end(), program.Id());
	if (it != m_programs.end())
	{
		m_programs.erase(it);
		return true;
	}
	return false;
}
开发者ID:jdierkse,项目名称:fast_tv_grab_nl,代码行数:10,代码来源:programs.cpp

示例3: LoadProgram

void ProgramManager::LoadProgram( string programName, string mappingName )
{
	string storageFolderPath = Configuration::Instance()->GetStringParam(
			PROGRAMS_STORAGE_DIR );
	string programSavePath = storageFolderPath + "/" + programName;
	string mappingSavePath = storageFolderPath + "/" + mappingName;

	string programDefinition = DataSerializationManager::Load( programSavePath.c_str() );
	string mappingDefinition = DataSerializationManager::Load( mappingSavePath.c_str() );

	Program* program = UpcbJsonParser::Instance()->ParseProgram( programDefinition );
	if( program == NULL )
		return;

	this->availablePrograms[program->Id()] = programDefinition;
	this->programMappings[program->Id()] = mappingDefinition;

	//delete program;
}
开发者ID:bobi-rakova,项目名称:Agilart-Run-Time,代码行数:19,代码来源:ProgramManager.cpp

示例4: HandleError

void ProgramManager::HandleError( void* sender, ErrorItem* error)
{
	Process* process = ( Process* )sender;
	if( process == NULL )
		return;

	Program* program = process->GetProgram();
	if ( program == NULL )
	{
		EventLogger::Instance()->WriteVerbose( "Program with id %d is still not started but an Error in the process with the same id is found!", program->Id() );
		return;
	}

	process->Stop();

	// to do !!!
	MappingManager::Instance()->FinalizeProgram( program );
	// delete process & program;
	// delete this->runningPrograms[program->Id()];
	this->runningPrograms[program->Id()] = NULL;
	this->runningPrograms.erase( program->Id() );
}
开发者ID:bobi-rakova,项目名称:Agilart-Run-Time,代码行数:22,代码来源:ProgramManager.cpp

示例5: AddProgram

void ProgramManager::AddProgram( string json )
{
	Program* program = UpcbJsonParser::Instance()->ParseProgram( json );

	if( program == NULL )
		return;

	this->availablePrograms[program->Id()] = json;

	//delete program;

	//Save Program & Mapping:
	string storageFolderPath = Configuration::Instance()->GetStringParam( PROGRAMS_STORAGE_DIR );

	struct stat st;
	if ( stat( storageFolderPath.c_str(), &st ) != 0 )
		mkdir( storageFolderPath.c_str(), 0777 );

	string programSavePath = storageFolderPath + "/" + program->Name() + ".xml";
	DataSerializationManager::Save( json, programSavePath.c_str() );
}
开发者ID:bobi-rakova,项目名称:Agilart-Run-Time,代码行数:21,代码来源:ProgramManager.cpp


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