當前位置: 首頁>>代碼示例>>C++>>正文


C++ Linked類代碼示例

本文整理匯總了C++中Linked的典型用法代碼示例。如果您正苦於以下問題:C++ Linked類的具體用法?C++ Linked怎麽用?C++ Linked使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Linked類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: next

inline void Linked<C>::insert_after(Linked<C>& x) { 
  // *p -> *this -> x -> *n
  x.set_prev(*this);
  x.set_next(this->next());
  next().set_prev(x);
  set_next(x);

}
開發者ID:qmc,項目名稱:dsqss,代碼行數:8,代碼來源:link.hpp

示例2: b

ILoadedDllEntry * SafePluginMap::getPluginDll(const char *id, const char *version, bool checkVersion)
{
    CriticalBlock b(crit);
    Linked<PluginDll> ret = static_cast<PluginDll *>(map.getValue(id));
    if (ret && checkVersion)
    {
        if (!ret->checkVersion(version))
            return NULL;
    }
    return ret.getLink();
}
開發者ID:hhy5277,項目名稱:HPCC-Platform,代碼行數:11,代碼來源:thorplugin.cpp

示例3: convertExisting

    void convertExisting()
    {
        Linked<IPropertyTree> pmPart = pmExisting;
        const char *s = strstr(pmid.str(), "::");
        if (s)
            pmPart->addProp("@id", s+2);
        packageMaps->removeTree(pmExisting);

        Owned<IPropertyTree> pmTree = createPTree("PackageMap", ipt_ordered);
        pmTree->setProp("@id", pmid);
        pmTree->setPropBool("@multipart", true);
        pmTree->addPropTree("Part", pmPart.getClear());
        pmExisting = packageMaps->addPropTree("PackageMap", pmTree.getClear());
    }
開發者ID:Josh-Googler,項目名稱:HPCC-Platform,代碼行數:14,代碼來源:ws_packageprocessService.cpp

示例4: notify

 virtual void notify(SubscriptionId subid, const char *daliXpath, SDSNotifyFlags flags, unsigned valueLen, const void *valueData)
 {
     Linked<CDaliPackageWatcher> me = this;  // Ensure that I am not released by the notify call (which would then access freed memory to release the critsec)
     Linked<ISDSSubscription> myNotifier;
     {
         CriticalBlock b(crit);
         if (traceLevel > 5)
             DBGLOG("Notification on %s (%s), %p", xpath.get(), daliXpath ? daliXpath : "", this);
         myNotifier.set(notifier);
         // allow crit to be released, allowing this to be unsubscribed, to avoid deadlocking when other threads via notify call unsubscribe
     }
     if (myNotifier)
         myNotifier->notify(subid, daliXpath, flags, valueLen, valueData);
 }
開發者ID:kenrowland,項目名稱:HPCC-Platform,代碼行數:14,代碼來源:ccddali.cpp

示例5: main

int main(int argc, char *argv[])
{
	String read="run -t -includelist linkdemo";
	Linked<String> tokenlist;
	Linked<String> optionlist;
	
	char s[]="hello world";
	String test=s;
	std::cout<<test;

	char str[50];
	int i=0;
	std::cout<<read.length()<<std::endl;
	while(read[i]!='\0')
	{
		int j=0;
		if(read[i]!='-')
		{
			while(read[i]!=' ' && read[i]!='\0')
				str[j++]=read[i++];
			str[j]='\0';
			String temp=str;
			tokenlist.InsertAfter(temp);
		}
		else
		{
			while(read[i]!=' ' && read[i]!='\0')
				str[j++]=read[i++];
			str[j]='\0';
			String temp=str;
			//std::cout<<str<<endl;
			optionlist.InsertAfter(temp);
			//PrintLink(optionlist);
		}
		std::cout<<"|"<<str<<"|"<<endl;
		if(read[i]!='\0')
			i++;
	}
	PrintLink(tokenlist);
	//PrintLink(optionlist);
	/*Linked<String> l;
	String stre="hell world";
	l.InsertAfter(stre);
	PrintLink(l);*/

	std::system("pause");
	return 0;
}
開發者ID:deliangyang,項目名稱:Data-Structure,代碼行數:48,代碼來源:strTest.cpp

示例6: main

main(){

	Linked L;

	L.append(1);
	L.append(3);
	L.append(5);
	L.append(3);
	L.append(5);
	L.append(11);
	L.displayList();
	L.remDups();
	std::cout << "duplicates removed \n" ; 
	std::cout << L ;


}
開發者ID:ameyaskVT,項目名稱:sample,代碼行數:17,代碼來源:linked.cpp

示例7: prev

inline void Linked<C>::insert_before(Linked<C>& x) {
  x.set_prev(prev());
  x.set_next(*this);//thisは、ROOTインスタンスを指す。
  prev().set_next(x);
  set_prev(x);
}
開發者ID:qmc,項目名稱:dsqss,代碼行數:6,代碼來源:link.hpp

示例8: process

    virtual void process() override
    {
        ActPrintLog("INDEXWRITE: Start");
        init();

        IRowStream *stream = inputStream;
        ThorDataLinkMetaInfo info;
        input->getMetaInfo(info);
        outRowAllocator.setown(getRowAllocator(helper->queryDiskRecordSize()));
        start();
        if (refactor)
        {
            assertex(isLocal);
            if (active)
            {
                unsigned targetWidth = partDesc->queryOwner().numParts()-(buildTlk?1:0);
                assertex(0 == container.queryJob().querySlaves() % targetWidth);
                unsigned partsPerNode = container.queryJob().querySlaves() / targetWidth;
                unsigned myPart = queryJobChannel().queryMyRank();

                IArrayOf<IRowStream> streams;
                streams.append(*LINK(stream));
                --partsPerNode;

 // Should this be merging 1,11,21,31 etc.
                unsigned p=0;
                unsigned fromPart = targetWidth+1 + (partsPerNode * (myPart-1));
                for (; p<partsPerNode; p++)
                {
                    streams.append(*createRowStreamFromNode(*this, fromPart++, queryJobChannel().queryJobComm(), mpTag, abortSoon));
                }
                ICompare *icompare = helper->queryCompare();
                assertex(icompare);
                Owned<IRowLinkCounter> linkCounter = new CThorRowLinkCounter;
                myInputStream.setown(createRowStreamMerger(streams.ordinality(), streams.getArray(), icompare, false, linkCounter));
                stream = myInputStream;
            }
            else // serve nodes, creating merged parts
                rowServer.setown(createRowServer(this, stream, queryJobChannel().queryJobComm(), mpTag));
        }
        processed = THORDATALINK_STARTED;

        // single part key support
        // has to serially pull all data fron nodes 2-N
        // nodes 2-N, could/should start pushing some data (as it's supposed to be small) to cut down on serial nature.
        unsigned node = queryJobChannel().queryMyRank();
        if (singlePartKey)
        {
            if (1 == node)
            {
                try
                {
                    open(*partDesc, false, helper->queryDiskRecordSize()->isVariableSize());
                    loop
                    {
                        OwnedConstThorRow row = inputStream->ungroupedNextRow();
                        if (!row)
                            break;
                        if (abortSoon) return;
                        processRow(row);
                    }

                    unsigned node = 2;
                    while (node <= container.queryJob().querySlaves())
                    {
                        Linked<IOutputRowDeserializer> deserializer = ::queryRowDeserializer(input);
                        CMessageBuffer mb;
                        Owned<ISerialStream> stream = createMemoryBufferSerialStream(mb);
                        CThorStreamDeserializerSource rowSource;
                        rowSource.setStream(stream);
                        bool successSR;
                        loop
                        {
                            {
                                BooleanOnOff tf(receivingTag2);
                                successSR = queryJobChannel().queryJobComm().sendRecv(mb, node, mpTag2);
                            }
                            if (successSR)
                            {
                                if (rowSource.eos())
                                    break;
                                Linked<IEngineRowAllocator> allocator = ::queryRowAllocator(input);
                                do
                                {
                                    RtlDynamicRowBuilder rowBuilder(allocator);
                                    size32_t sz = deserializer->deserialize(rowBuilder, rowSource);
                                    OwnedConstThorRow fRow = rowBuilder.finalizeRowClear(sz);
                                    processRow(fRow);
                                }
                                while (!rowSource.eos());
                            }
                        }
                        node++;
                    }
                }
                catch (CATCHALL)
                {
                    close(*partDesc, partCrc, true);
                    throw;
                }
//.........這裏部分代碼省略.........
開發者ID:bolaria,項目名稱:HPCC-Platform,代碼行數:101,代碼來源:thindexwriteslave.cpp

示例9: processMessage

    void processMessage(CMessageBuffer &mb)
    {
        ICoven &coven=queryCoven();
        MemoryBuffer params;
        params.swapWith(mb);
        int fn;
        params.read(fn);
        switch (fn) {
        case MDR_GET_VALUE: {
                StringAttr id;
                StringBuffer buf;
                params.read(id);
                if (0 == stricmp(id,"threads")) {
                    mb.append(getThreadList(buf).str());
                }
                else if (0 == stricmp(id, "mpqueue")) {
                    mb.append(getReceiveQueueDetails(buf).str());
                }
                else if (0 == stricmp(id, "locks")) {
                    mb.append(querySDS().getLocks(buf).str());
                }
                else if (0 == stricmp(id, "sdsstats")) {
                    mb.append(querySDS().getUsageStats(buf).str());
                }
                else if (0 == stricmp(id, "connections")) {
                    mb.append(querySDS().getConnections(buf).str());
                }
                else if (0 == stricmp(id, "sdssubscribers")) {
                    mb.append(querySDS().getSubscribers(buf).str());
                }
                else if (0 == stricmp(id, "clients")) {
                    mb.append(querySessionManager().getClientProcessList(buf).str());
                }
                else if (0 == stricmp(id, "subscriptions")) {
                    mb.append(getSubscriptionList(buf).str());
                }
                else if (0 == stricmp(id, "mpverify")) {
                    queryWorldCommunicator().verifyAll(buf);
                    mb.append(buf.str());
                }
                else if (0 == stricmp(id, "extconsistency")) {
                    mb.append(querySDS().getExternalReport(buf).str());
                }
                else if (0 == stricmp(id, "build")) {
                    mb.append("$Id: dadiags.cpp 62376 2011-02-04 21:59:58Z sort $");
                }
                else if (0 == stricmp(id, "sdsfetch")) {
                    StringAttr branchpath;
                    params.read(branchpath);
                    Linked<IPropertyTree> sroot = querySDSServer().lockStoreRead();
                    try { sroot->queryPropTree(branchpath)->serialize(mb); }
                    catch (...) { querySDSServer().unlockStoreRead(); throw; }
                    querySDSServer().unlockStoreRead();
                }
                else if (0 == stricmp(id, "perf")) {
                    getSystemTraceInfo(buf,PerfMonStandard);
                    mb.append(buf.str());
                }
                else if (0 == stricmp(id, "sdssize")) {
                    StringAttr branchpath;
                    params.read(branchpath);
                    Linked<IPropertyTree> sroot = querySDSServer().lockStoreRead();
                    StringBuffer sbuf;
                    try { 
                        toXML(sroot->queryPropTree(branchpath),sbuf); 
                        DBGLOG("sdssize '%s' = %d",branchpath.get(),sbuf.length());
                    }
                    catch (...) { 
                        querySDSServer().unlockStoreRead(); 
                        throw; 
                    }
                    querySDSServer().unlockStoreRead();
                    mb.append(sbuf.length());
                }
                else if (0 == stricmp(id, "disconnect")) {
                    StringAttr client;
                    params.read(client);
                    SocketEndpoint ep(client);
                    PROGLOG("Dalidiag request to close client connection: %s", client.get());
                    Owned<INode> node = createINode(ep);
                    queryCoven().disconnect(node);
                }
                else if (0 == stricmp(id, "unlock")) {
                    __int64 connectionId;
                    bool disconnect;
                    params.read(connectionId);
                    params.read(disconnect);
                    PROGLOG("Dalidiag request to unlock connection id: %" I64F "x", connectionId);
                    StringBuffer connectionInfo;
                    bool success = querySDSServer().unlock(connectionId, disconnect, connectionInfo);
                    mb.append(success);
                    if (success)
                        mb.append(connectionInfo);
                }
                else if (0 == stricmp(id, "save")) {
                    PROGLOG("Dalidiag requests SDS save");
                    querySDSServer().saveRequest();
                }
                else if (0 == stricmp(id, "settracetransactions")) {
                    PROGLOG("Dalidiag requests Trace Transactions");
//.........這裏部分代碼省略.........
開發者ID:PaulCharlton,項目名稱:HPCC-Platform,代碼行數:101,代碼來源:dadiags.cpp

示例10: run

 int run()
 {
     if (!started) {
         try {
             in->start();
             started = true;
         }
         catch(IException * e)
         {
             ActPrintLog(&activity, e, "ThorLookaheadCache starting input");
             startexception.setown(e);
             if (asyncstart) 
                 notify->onInputStarted(startexception);
             running = false;
             stopped = true;
             startsem.signal();
             return 0;
         }
     }
     try {
         StringBuffer temp;
         if (allowspill)
             GetTempName(temp,"lookahd",true);
         assertex(bufsize);
         if (allowspill)
             smartbuf.setown(createSmartBuffer(&activity, temp.toCharArray(), bufsize, queryRowInterfaces(in)));
         else
             smartbuf.setown(createSmartInMemoryBuffer(&activity, queryRowInterfaces(in), bufsize));
         if (notify) 
             notify->onInputStarted(NULL);
         startsem.signal();
         Linked<IRowWriter> writer = smartbuf->queryWriter();
         if (preserveLhsGrouping)
         {
             while (required&&running)
             {
                 OwnedConstThorRow row = in->nextRow();
                 if (!row)
                 {
                     row.setown(in->nextRow());
                     if (!row)
                         break;
                     else
                         writer->putRow(NULL); // eog
                 }
                 ++count;
                 writer->putRow(row.getClear());
                 if (required!=RCUNBOUND)
                     required--;
             }
         }
         else
         {
             while (required&&running)
             {
                 OwnedConstThorRow row = in->ungroupedNextRow();
                 if (!row)
                     break;
                 ++count;
                 writer->putRow(row.getClear());
                 if (required!=RCUNBOUND)
                     required--;
             }
         }
     }
     catch(IException * e)
     {
         ActPrintLog(&activity, e, "ThorLookaheadCache get exception");
         getexception.setown(e);
     }   
     if (notify)
         notify->onInputFinished(count);
     if (smartbuf)
         smartbuf->queryWriter()->flush();
     running = false;
     try {
         if (in)
             in->stop();
     }
     catch(IException * e)
     {
         ActPrintLog(&activity, e, "ThorLookaheadCache stop exception");
         if (!getexception.get())
             getexception.setown(e);
     }   
     return 0;
 }
開發者ID:afishbeck,項目名稱:HPCC-Platform,代碼行數:87,代碼來源:thactivityutil.cpp

示例11: flush

 virtual void flush()
 {
     if (!flushdone) {
         out->flush();
         offset_t end = out->getPosition();
         writeidxofs(end);
         if (outidx)
             outidx->flush();
         flushdone = true;
     }
 }
開發者ID:,項目名稱:,代碼行數:11,代碼來源:

示例12: init

 void init()
 {
     StringBuffer xpath("Software/ThorCluster[@name=\"");
     xpath.append(clusterName).append("\"]");
     Owned<IRemoteConnection> conn = querySDS().connect("/Environment", myProcessSession(), RTM_LOCK_READ, SDS_LOCK_TIMEOUT);
     environment.setown(createPTreeFromIPT(conn->queryRoot()));
     options = environment->queryPropTree(xpath.str());
     if (!options)
         throwUnexpected();
     groupName.set(options->queryProp("@nodeGroup"));
     if (groupName.isEmpty())
         groupName.set(options->queryProp("@name"));
     VStringBuffer spareS("%s_spares", groupName.get());
     spareGroupName.set(spareS);
     group.setown(queryNamedGroupStore().lookup(groupName));
     spareGroup.setown(queryNamedGroupStore().lookup(spareGroupName));
 }
開發者ID:RobertoMalatesta,項目名稱:HPCC-Platform,代碼行數:17,代碼來源:swapnodelib.cpp

示例13: putRow

 void putRow(const void *_row)
 {
     offset_t start = out->getPosition();
     OwnedConstThorRow row = _row;
     out->putRow(row.getLink());
     idx++;
     if (idx==interval) {
         idx = 0;
         if (overflowed||rowArray.isFull()) {  
             overflowsize = out->getPosition();
             if (!overflowed) {
                 PROGLOG("Sample buffer full");
                 overflowed = true;
             }
         }
         else 
             rowArray.append(row.getClear());
     }
     writeidxofs(start);
 }
開發者ID:,項目名稱:,代碼行數:20,代碼來源:

示例14: 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,代碼來源:

示例15: getPosition

 virtual offset_t getPosition() 
 { 
     return out->getPosition(); 
 }
開發者ID:,項目名稱:,代碼行數:4,代碼來源:


注:本文中的Linked類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。