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


C++ Linked::get方法代码示例

本文整理汇总了C++中Linked::get方法的典型用法代码示例。如果您正苦于以下问题:C++ Linked::get方法的具体用法?C++ Linked::get怎么用?C++ Linked::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Linked的用法示例。


在下文中一共展示了Linked::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeidxofs

    void writeidxofs(offset_t o)
    {
        // lazy index write

        if (outidx.get()) {
            outidx->write(sizeof(o),&o);
            return;
        }
        if (lastofs) {
            if (fixedsize!=o-lastofs) {
                // right create idx
                StringBuffer tempname;
                GetTempName(tempname.clear(),"srtidx",false);
                outidxfile.setown(createIFile(tempname.str()));
                Owned<IFileIO> fileioidx = outidxfile->open(IFOcreate);
                outidx.setown(fileioidx?createBufferedIOStream(fileioidx,0x100000):NULL);
                if (outidx.get()==NULL) {
                    StringBuffer err;
                    err.append("Cannot create ").append(outidxfile->queryFilename());
                    LOG(MCerror, thorJob, "%s", err.str());
                    throw MakeStringException(-1, "%s", err.str());
                }
                offset_t s = 0;
                while (s<=lastofs) {
                    outidx->write(sizeof(s),&s);
                    s += fixedsize;
                }
                assertex(s==lastofs+fixedsize);
                fixedsize = 0;
                writeidxofs(o);
                return;
            }
        }
        else
            fixedsize = (size32_t)(o-lastofs);
        lastofs = o;
    }
开发者ID:,项目名称:,代码行数:37,代码来源:

示例2: CDigitalSignatureManager

 CDigitalSignatureManager(CLoadedKey *_pubKey, CLoadedKey *_privKey) : pubKey(_pubKey), privKey(_privKey)
 {
     signingConfigured = nullptr != privKey.get();
     verifyingConfigured = nullptr != pubKey.get();
 }
开发者ID:Michael-Gardner,项目名称:HPCC-Platform,代码行数:5,代码来源:digisign.cpp

示例3: prepareKey

    void prepareKey()
    {
        IDistributedFile *f = index.get();
        IDistributedSuperFile *super = f->querySuperFile();

        unsigned nparts = f->numParts(); // includes tlks if any, but unused in array
        performPartLookup.ensure(nparts);

        bool checkTLKConsistency = NULL != super && 0 != (TIRsorted & indexBaseHelper->getFlags());
        if (nofilter)
        {
            while (nparts--) performPartLookup.append(true);
            if (!checkTLKConsistency) return;
        }
        else
        {
            while (nparts--) performPartLookup.append(false); // parts to perform lookup set later
        }

        Owned<IDistributedFileIterator> iter;
        if (super) {
            iter.setown(super->getSubFileIterator(true));
            verifyex(iter->first());
            f = &iter->query();
        }
        unsigned width = f->numParts()-1;
        assertex(width);
        unsigned tlkCrc;
        bool first = true;
        unsigned superSubIndex=0;
        bool fileCrc = false, rowCrc = false;
        loop {
            Owned<IDistributedFilePart> part = f->getPart(width);
            if (checkTLKConsistency)
            {
                unsigned _tlkCrc;
                if (part->getCrc(_tlkCrc))
                    fileCrc = true;
                else if (part->queryAttributes().hasProp("@crc")) // NB: key "@crc" is not a crc on the file, but data within.
                {
                    _tlkCrc = part->queryAttributes().getPropInt("@crc");
                    rowCrc = true;
                }
                else if (part->queryAttributes().hasProp("@tlkCrc")) // backward compat.
                {
                    _tlkCrc = part->queryAttributes().getPropInt("@tlkCrc");
                    rowCrc = true;
                }
                else
                {
                    if (rowCrc || fileCrc)
                    {
                        checkTLKConsistency = false;
                        Owned<IException> e = MakeActivityWarning(&container, 0, "Cannot validate that tlks in superfile %s match, some crc attributes are missing", super->queryLogicalName());
                        container.queryJob().fireException(e);
                    }       
                }
                if (rowCrc && fileCrc)
                {
                    checkTLKConsistency = false;
                    Owned<IException> e = MakeActivityWarning(&container, 0, "Cannot validate that tlks in superfile %s match, due to mixed crc types.", super->queryLogicalName());
                    container.queryJob().fireException(e);
                }
                if (checkTLKConsistency)
                {
                    if (first)
                    {
                        tlkCrc = _tlkCrc;
                        first = false;
                    }
                    else if (tlkCrc != _tlkCrc)
                        throw MakeActivityException(this, 0, "Sorted output on super files comprising of non coparitioned sub keys is not supported (TLK's do not match)");
                }
            }
            if (!nofilter)
            {
                Owned<IKeyIndex> keyIndex;
                unsigned copy;
                for (copy=0; copy<part->numCopies(); copy++)
                {
                    RemoteFilename rfn;
                    OwnedIFile ifile = createIFile(part->getFilename(rfn,copy));
                    if (ifile->exists())
                    {
                        StringBuffer remotePath;
                        rfn.getRemotePath(remotePath);
                        unsigned crc;
                        part->getCrc(crc);
                        keyIndex.setown(createKeyIndex(remotePath.str(), crc, false, false));
                        break;
                    }
                }
                if (!keyIndex)
                    throw MakeThorException(TE_FileNotFound, "Top level key part does not exist, for key: %s", indexBaseHelper->getFileName());
            
                unsigned maxSize = indexBaseHelper->queryDiskRecordSize()->querySerializedMeta()->getRecordSize(NULL); // used only if fixed
                Owned <IKeyManager> tlk = createKeyManager(keyIndex, maxSize, NULL);
                indexBaseHelper->createSegmentMonitors(tlk);
                tlk->finishSegmentMonitors();
                tlk->reset();
//.........这里部分代码省略.........
开发者ID:afishbeck,项目名称:HPCC-Platform,代码行数:101,代码来源:thindexread.cpp


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