本文整理汇总了C++中BitString::setFieldJustify方法的典型用法代码示例。如果您正苦于以下问题:C++ BitString::setFieldJustify方法的具体用法?C++ BitString::setFieldJustify怎么用?C++ BitString::setFieldJustify使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitString
的用法示例。
在下文中一共展示了BitString::setFieldJustify方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
void ScrDB::Read(TARGETING::TargetHandle_t i_ptargetHandle,
BitString & bs,
uint64_t registerId)
{
//PRDF_DENTER( "ScrDB::Read() huid: 0x%X, addr: 0x%016X",
// getHuid(i_ptargetHandle), registerId );
DataList data;
unsigned int dataWordSize = bs.getBitLen()/32;
dataWordSize += (bs.getBitLen() % 32) ? 1 : 0;
// if the register has a predetermined value than get it
if(pChipset.find(i_ptargetHandle) != pChipset.end())
{
PreScrMap pscrmap = pChipset[i_ptargetHandle];
if(pscrmap.find(registerId) != pscrmap.end()) // we must have a predetermined value
{
SimScrDataSet pValues = pscrmap[registerId];
data = pValues.GetData(); // get next set of values
// pValues has changed - copy it back
pscrmap[registerId] = pValues;
pChipset[i_ptargetHandle] = pscrmap;
}
}
if(data.size() == 0) // use the last value written to this reg
{
// get a copy of the scrMap for this chip - if one does not exist it will be created
ScrMap scrMap = chipset[i_ptargetHandle];
// get a copy of the data for this address from the scrMap for this chip
// if data structure does not exist, it will be created, but will be empty
data = scrMap[registerId];
if(data.size() == 0) // This is the first time this register has been accessed
{
while(data.size() < dataWordSize) data.push_back(0); // zero fill
scrMap[registerId] = data;
chipset[i_ptargetHandle] = scrMap; // update the persistent copy of the scrMap
}
}
if(0 != data.size())
{
for(unsigned int i = 0; i < data.size(); ++i)
{
bs.setFieldJustify((i*32), 32, data[i]);
}
PRDF_TRAC( "ScrDB::Read() huid: %X, addr: %016X, data: %08X %08X",
getHuid(i_ptargetHandle), registerId, data[0],
2 == data.size() ? data[1] : 0 );
}
//PRDF_DEXIT( "ScrDB::Read()" );
}