本文整理汇总了C++中AddedElement函数的典型用法代码示例。如果您正苦于以下问题:C++ AddedElement函数的具体用法?C++ AddedElement怎么用?C++ AddedElement使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AddedElement函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: memcpy
/**
* Pack an unsigned 8-bit int into the dashboard data structure.
* @param value Data to be packed into the structure.
*/
void Dashboard::AddU8(UINT8 value)
{
if (!ValidateAdd(sizeof(UINT8))) return;
memcpy(m_packPtr, (char*)&value, sizeof(value));
m_packPtr += sizeof(value);
AddedElement(kU8);
}
示例2: sizeof
/**
* Pack a boolean into the dashboard data structure.
* @param value Data to be packed into the structure.
*/
void Dashboard::AddBoolean(bool value)
{
if (!ValidateAdd(sizeof(char))) return;
*m_packPtr = value ? 1 : 0;
m_packPtr += sizeof(char);
AddedElement(kBoolean);
}
示例3: memcpy
/**
* Pack a signed 16-bit int into the dashboard data structure.
* @param value Data to be packed into the structure.
*/
void Dashboard::AddI16(int16_t value)
{
if (!ValidateAdd(sizeof(int16_t))) return;
memcpy(m_packPtr, (char*)&value, sizeof(value));
m_packPtr += sizeof(value);
AddedElement(kI16);
}
示例4: wpi_setWPIError
/**
* Indicate the end of a cluster packed into the dashboard data structure.
*
* After packing data into the cluster, call FinalizeCluster().
* Every call to AddCluster() must have a matching call to FinalizeCluster().
*/
void Dashboard::FinalizeCluster()
{
if (m_complexTypeStack.top() != kCluster)
{
wpi_setWPIError(MismatchedComplexTypeClose);
return;
}
m_complexTypeStack.pop();
AddedElement(kOther);
}