Beispiel #1
0
 void* doretrieveApiInstance(const PyHolder* pythonType, const TypeInfo* typeInfo, const char* expectedType, 
                             const char* methodNamespacePrefix, const char* methodNameForErrorString) throw (WrongTypeException)
 {
   if (pythonType == NULL || pythonType->magicNumber != XBMC_PYTHON_TYPE_MAGIC_NUMBER)
     throw WrongTypeException("Non api type passed in place of the expected type \"%s.\"",expectedType);
   if (!isParameterRightType(typeInfo->swigType,expectedType,methodNamespacePrefix))
   {
     // maybe it's a child class
     if (typeInfo->parentType)
       return doretrieveApiInstance(pythonType, typeInfo->parentType,expectedType, 
                                    methodNamespacePrefix, methodNameForErrorString);
     else
       throw WrongTypeException("Incorrect type passed to \"%s\", was expecting a \"%s\" but received a \"%s\"",
                                methodNameForErrorString,expectedType,typeInfo->swigType);
   }
   return ((PyHolder*)pythonType)->pSelf;
 }
Beispiel #2
0
	inline T ParameterGroup::translate(const pair_type& named_data,
					   const Requirement& chk) const
        {
	    const std::string& name = named_data.first;
	    const data_type data = named_data.second;
	    std::string conversion_error;
	    T value = ParameterMapItemTrait<T>::convert(*data, conversion_error,
                                                        output_is_enabled_);
	    if (conversion_error != "") {
		std::cerr << "ERROR: Failed to convert the element named '"
			  << name
			  << "' in the group '"
			  << this->path()
			  << "' to the type '"
			  << ParameterMapItemTrait<T>::type()
			  << "'.\n";
		std::cerr << "The conversion routine returned the following message:\n"
			  << conversion_error
			  << "\n";
		throw WrongTypeException();
	    }
	    std::string requirement_result = chk(value);
	    if (requirement_result != "") {
		std::cerr << "ERROR: The element named '"
			  << name
			  << "' in the group '"
			  << this->path()
			  << "' of type '"
			  << ParameterMapItemTrait<T>::type()
			  << "' failed to meet a requirenemt.\n";
		std::cerr << "The requirement enforcer returned the following message:\n"
			  << requirement_result
			  << "\n";
		throw RequirementFailedException<Requirement>();
	    }
	    return value;
	}
Beispiel #3
0
uint32 Value::getUnsigned() throw(WrongTypeException) {
	throw WrongTypeException();
}
Beispiel #4
0
bool Value::isSignedValue() throw(WrongTypeException) {
	throw WrongTypeException();
}
Beispiel #5
0
int32 AddressValue::getSigned() throw(WrongTypeException) {
	throw WrongTypeException();
}