当前位置: 首页>>代码示例>>C++>>正文


C++ BitString::setFieldJustify方法代码示例

本文整理汇总了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()" );

    }
开发者ID:open-power,项目名称:hostboot,代码行数:51,代码来源:prdfsimScrDB.C


注:本文中的BitString::setFieldJustify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。