Example #1
0
	ClauseHead* set(Solver& s, LitVec& c) {
		ClauseCreator::Result ret;
		uint32 flags = ClauseCreator::clause_explicit|ClauseCreator::clause_no_add;
		if (shared_) {
			ret = ClauseCreator::integrate(s, createShared(c), flags);
		}
		else {
			ret = ClauseCreator::create(s, c, flags, ClauseInfo(Constraint_t::learnt_other));
		}
		return ret.local;
	}
Example #2
0
shared_ptr<Factorable> ClassFactory::createShared( std::string name )
{
	FactorableCreatorsMap::const_iterator i = map.find( name );
	if( i == map.end() )
	{
		dlm.load(name);
		if (dlm.isLoaded(name))
		{
			if( map.find( name ) == map.end() )
			{
				// Well, exception are also a way to return value, right?
				// This throws at startup for every .so that doesn't contain class named the same as the library.
				// I.e. almost everything in yade-libs and some others installed locally...
				// Don't log that, it would confuse users.
				//LOG_FATAL("Can't create class "<<name<<" - was never registered.");
				throw std::runtime_error(("Class "+name+" not registered in the ClassFactory.").c_str());
			}
			return createShared(name);
		}
		throw std::runtime_error(("Class "+name+" could not be factored in the ClassFactory.").c_str());
	}
	return ( i -> second.createShared ) ();
}
Example #3
0
 Translateable(const char* base, Args&&... arguments)
 : _baseString(base)
 , _operands{createShared(std::forward<Args>(arguments))...} {
 }