Exemplo n.º 1
0
	Parameter operator()(const std::string& name) const
	{
		ParametersMap::const_iterator it = pmap.find(name);
		if (it != pmap.end())
		{
			return it->second;
		}
		else
		{
			throw missed_parameter_error(Message() << "Parameter " << name << " is missed");
		}
	}
Exemplo n.º 2
0
	inline operator T()
	{
		if (!valid)
		{
			throw wrong_parameter_error(invalidity_reason);
		}
		try 
		{
			return getValue<T>();
		}
		catch (const missed_parameter_error&)
		{
			throw missed_parameter_error(parameter_name + " is missed");
		}
	}
Exemplo n.º 3
0
	inline T getValue() const
	{
		T* v;
		if (!isInitialized())
		{
			throw missed_parameter_error("Parameter is missed");
		}
		if (isTypeCorrect<T>())
		{
			void* vv = policy->getValue(const_cast<void**>(&value_ptr));
			v = reinterpret_cast<T*>(vv);
		}
		else
			throw wrong_parameter_type_error("Wrong value type");
		return *v;
	}