本文整理汇总了C++中rho::apigenerator::CMethodResult::setError方法的典型用法代码示例。如果您正苦于以下问题:C++ CMethodResult::setError方法的具体用法?C++ CMethodResult::setError怎么用?C++ CMethodResult::setError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rho::apigenerator::CMethodResult
的用法示例。
在下文中一共展示了CMethodResult::setError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setProperties
void CSensorImpl::setProperties(const rho::Hashtable<rho::String, rho::String>& propertyMap, rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request to set properties : " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot set properties");
} else
{
for (rho::Hashtable<rho::String, rho::String>::const_iterator propMapItr = propertyMap.begin(); propMapItr != propertyMap.end(); propMapItr++)
{
if (_stricmp(propMapItr->first.c_str(), "minimumGap") == 0)
{
int minimumGap = atoi(propMapItr->second.c_str());
if (minimumGap < 200)
{
minimumGap = 200;
}
this->m_rawSensor->setMinimumGap(minimumGap);
} else
{
oResult.setError(propMapItr->first + " is readonly or is invalid.");
}
}
}
}
示例2: getProperties
void CSensorImpl::getProperties(const rho::Vector<rho::String>& arrayofNames, rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request for get properties : " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot get properties");
} else
{
rho::Hashtable<rho::String, rho::String> propsHash;
for (rho::Vector<rho::String>::const_iterator namesIterator = arrayofNames.begin(); namesIterator != arrayofNames.end(); namesIterator++)
{
if (_stricmp((*namesIterator).c_str(), "minimumGap") == 0)
{
propsHash.put(*namesIterator, rho::common::convertToStringA<int>(this->m_rawSensor->getMinimumGap()));
} else if (_stricmp((*namesIterator).c_str(), "type") == 0)
{
propsHash.put(*namesIterator, this->m_rawSensor->getType());
} else if (_stricmp((*namesIterator).c_str(), "status") == 0)
{
propsHash.put(*namesIterator, this->m_rawSensor->getStatus());
} else
{
propsHash.put(*namesIterator, "Invalid attribute");
}
}
oResult.set(propsHash);
}
}
示例3: getType
void CSensorImpl::getType(rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Request received for type : " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot get type.");
} else
{
oResult.set(this->m_rawSensor->getType());
}
}
示例4: start
//methods
virtual void start( int interval, rho::apiGenerator::CMethodResult& oResult)
{
if (interval <= 0)
{
oResult.setError("invalid interval");
return;
}
m_oResult = oResult;
common::CRhoTimer& timerManager = RHODESAPP().getTimer();
timerManager.addNativeTimer(interval, this);
}
示例5: setProperty
void CSensorImpl::setProperty(const rho::String& propertyName, const rho::String& propertyValue, rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request to set property : " + m_sensorId + " : " + propertyName + " = " + propertyValue;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot set property " + propertyName);
} else
{
if (_stricmp(propertyName.c_str(), "minimumGap") == 0)
{
int minimumGap = atoi(propertyValue.c_str());
if (minimumGap < 200)
{
minimumGap = 200;
}
this->m_rawSensor->setMinimumGap(minimumGap);
} else
{
oResult.setError(propertyName + " is readonly or is invalid.");
}
}
}
示例6: getProperty
void CSensorImpl::getProperty(const rho::String& propertyName, rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request for get property : " + m_sensorId + " : " + propertyName;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot set " + propertyName);
} else
{
if (_stricmp(propertyName.c_str(), "minimumGap") == 0)
{
oResult.set(this->m_rawSensor->getMinimumGap());
} else if (_stricmp(propertyName.c_str(), "type") == 0)
{
oResult.set(this->m_rawSensor->getType());
} else if (_stricmp(propertyName.c_str(), "status") == 0)
{
oResult.set(this->m_rawSensor->getStatus());
} else
{
oResult.setError("Invalid attribute");
}
}
}
示例7: setMinimumGap
void CSensorImpl::setMinimumGap(int minimumGap, rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Request received to set minimum gap : " + m_sensorId + " : to " + rho::common::convertToStringA<int>(minimumGap);
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot set minimumegap.");
}
else
{
if (minimumGap < 200)
minimumGap = 200;
this->m_rawSensor->setMinimumGap(minimumGap);
oResult.set(true);
}
}
示例8: getAllProperties
void CSensorImpl::getAllProperties(rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request for get all properties : " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot get properties");
} else
{
rho::Hashtable<rho::String, rho::String> propsHash;
propsHash.put("minimumGap", rho::common::convertToStringA<int>(this->m_rawSensor->getMinimumGap()));
propsHash.put("type", this->m_rawSensor->getType());
propsHash.put("status", this->m_rawSensor->getStatus());
oResult.set(propsHash);
}
}
示例9: stop
void CSensorImpl::stop(rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request to stop sensor: " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot get stop.");
}
else
{
this->m_rawSensor->Stop();
if ((NULL != m_callbackMethodResult) && (m_callbackMethodResult->hasCallback()))
{
m_callbackMethodResult = NULL;
}
rho::common::CMutexLock lock(m_cs);
m_cache.clear();
}
}
示例10: readData
void CSensorImpl::readData(rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request to readData: " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot get stop.");
}
else
{
rho::common::CMutexLock lock(m_cs);
if (m_cache.empty())
{
rho::Hashtable<rho::String, rho::String> props;
props.put("message", "No Samples received from sensor. Check status");// The sampling is stopped (check status) or retry based on the minium gap property or reduce the gap interval");
props.put("status", "error");
oResult.set(props);
}
else
oResult.set(m_cache);
}
}
示例11: start
void CSensorImpl::start(rho::apiGenerator::CMethodResult& oResult)
{
LOG(TRACE) + "Received request to start sensor: " + m_sensorId;
if (NULL == m_rawSensor)
{
oResult.setError("No sensor found. Cannot get start.");
}
else
{
//const char * status = m_rawSensor->getStatus();
this->m_rawSensor->Start();
rho::common::CMutexLock lock(m_cs);
if (oResult.hasCallback())
{
m_callbackMethodResult = &oResult;
}
else
{
m_callbackMethodResult = NULL;
}
}
}
示例12: setWindowSize
void CSystemImpl::setWindowSize(int, int, rho::apiGenerator::CMethodResult& result)
{
result.setError("not implemented at Android platform");
}
示例13: getScreenSleeping
void CSystemImpl::getScreenSleeping(rho::apiGenerator::CMethodResult& result)
{
result.setError("not implemented at Android platform");
}
示例14: setShowKeyboard
void CSystemImpl::setShowKeyboard(bool, rho::apiGenerator::CMethodResult& result)
{
result.setError("not implemented at Android platform");
}
示例15: setHttpProxyURI
void CSystemImpl::setHttpProxyURI(const rho::String&, rho::apiGenerator::CMethodResult& result)
{
result.setError("not implemented at Android platform");
}