本文整理汇总了C++中NDAttribute::setDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ NDAttribute::setDescription方法的具体用法?C++ NDAttribute::setDescription怎么用?C++ NDAttribute::setDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NDAttribute
的用法示例。
在下文中一共展示了NDAttribute::setDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
/** Adds an attribute to the list.
* This is a convenience function for adding attributes to a list.
* It first searches the list to see if there is an existing attribute
* with the same name. If there is it just changes the properties of the
* existing attribute. If not, it creates a new attribute with the
* specified properties.
* IMPORTANT: This method is only capable of creating attributes
* of the NDAttribute base class type, not derived class attributes.
* To add attributes of a derived class to a list the NDAttributeList::add(NDAttribute*)
* method must be used.
* \param[in] pName The name of the attribute to be added.
* \param[in] pDescription The description of the attribute.
* \param[in] dataType The data type of the attribute.
* \param[in] pValue A pointer to the value for this attribute.
*
*/
NDAttribute* NDAttributeList::add(const char *pName, const char *pDescription, NDAttrDataType_t dataType, void *pValue)
{
//const char *functionName = "NDAttributeList::add";
NDAttribute *pAttribute;
epicsMutexLock(this->lock);
pAttribute = this->find(pName);
if (pAttribute) {
pAttribute->setDescription(pDescription);
pAttribute->setValue(dataType, pValue);
} else {
pAttribute = new NDAttribute(pName, pDescription, dataType, pValue);
ellAdd(&this->list, &pAttribute->listNode.node);
}
epicsMutexUnlock(this->lock);
return(pAttribute);
}