Пример #1
0
void ComponentFactory::checkAttribute(shared_ptr<mw::Component> component,
                                      const std::string &refID,
                                      const std::string &name,
                                      const std::string &value)
{
	if(component == 0) {
		throw MissingReferenceException(refID, name, value);		
	}
}
Пример #2
0
shared_ptr<mw::Component> mStopMovieFactory::createObject(std::map<std::string, std::string> parameters,
													   mwComponentRegistry *reg) {
	
	const char *MOVIE = "movie";
	
	REQUIRE_ATTRIBUTES(parameters, MOVIE);
	
	shared_ptr <mMovieStimulus> the_movie = reg->getObject<mMovieStimulus>(parameters.find(MOVIE)->second);
	
	if(the_movie == 0) {
		throw MissingReferenceException(parameters.find("reference_id")->second, MOVIE, parameters.find(MOVIE)->second);		
	}
	
	shared_ptr <mStopMovie> new_stop_movie_action = shared_ptr<mStopMovie>(new mStopMovie(the_movie));
	return new_stop_movie_action;		
}