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


C++ ListNode::getData方法代码示例

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


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

示例1: printList

void LinkedList::printList(ofstream& out){
   out << "ListHead --> (" << listHead->getData() << ", " << listHead->getNext() << ") ";
   ListNode* temp = listHead->getNext();
   while(temp != NULL){
      out << "--> (" << temp->getData() << ", " << temp->getNext() << ") ";
      temp = temp->getNext();
   }
   out << endl;
}
开发者ID:rramphal100,项目名称:cs323,代码行数:9,代码来源:main.cpp

示例2: createMiddlePhaseJobs

    /*!
     * Create middlephase jobs according to the \ref BroadPhaseJob.
     *
     * See also \ref MiddlePhaseJobCreator and \ref
     * DetectorDeformManager::pickAlgorithmFor
     */
    void Pipeline::createMiddlePhaseJobs(BroadPhaseJob* broadPhaseJob) {
        List<CollisionPair*>& jobResults = broadPhaseJob->getJobResultsReference();
        for (ListNode<CollisionPair*>* node = jobResults.getFirstNode(); node; node = node->getNext()) {
            CollisionPair* pair = node->getData();

            // TODO make CollisionPair store Proxy pointers.
            //      we usually dont care about the BVs when reading the pairs!!
            Proxy* p1 = pair->bvol1->getHierarchyNode()->getProxy();
            Proxy* p2 = pair->bvol2->getHierarchyNode()->getProxy();

            if (p1->getProxyType() & PROXYTYPE_DEFORMABLE ||
                    p2->getProxyType() & PROXYTYPE_DEFORMABLE) {

                if (mWorld->getUseCollisionCaching()) {
                    bool cacheApplied = mWorld->getCollisionCache()->applyCacheIfAvailable(p1, p2);
                    if (cacheApplied) {
                        continue;
                    }
                }

                DetectorDeformAlgorithm* algorithm = mDetectorDeformManager->pickAlgorithmFor(p1, p2);
                if (algorithm) {
                    // TODO: fix API.
                    //       createCollisionJobFor() uses CollisionPair,
                    //       pickAlgorithmFor() uses two Proxy pointers.
                    //       choose one!
                    algorithm->createCollisionJobFor(*pair);
                }
            }
        }


        mMiddlePhaseJobCreator->createJobs(broadPhaseJob);
    }
开发者ID:ColinGilbert,项目名称:d-collide,代码行数:40,代码来源:pipeline.cpp

示例3: copy

void List::copy(List L){
		Head = NULL;
		ListNode * temp = L.Head;
		while(temp!=NULL){
			this->append(temp->getData());
			temp=temp->getNext();
		}
}
开发者ID:arkidm14,项目名称:algorithms,代码行数:8,代码来源:Big+Int.cpp

示例4: while

void List<NODETYPE>::concatenate(List<NODETYPE> &listSecond) {
    ListNode<NODETYPE> *currentPtr = listSecond.firstPtr;

    while (currentPtr != 0) {
        insertAtBack(currentPtr->getData());
        currentPtr = currentPtr->nextPtr;
    }
}
开发者ID:siidney,项目名称:Cpp-How-To-Program-9E,代码行数:8,代码来源:List.hpp

示例5: start

 /*!
  * Start all jobs that have been added to this collection (see \ref addJob).
  * If a job gets added after this point, it will get started immediately
  * (unless \ref resetCompleted has been called in between, which also resets
  * the started flag).
  */
 void ThreadJobCollection::start() {
     if (mStarted) {
         return;
     }
     if (getAllJobsCompleted()) {
         throw Exception("Cannot start collection - all jobs already marked as completed");
     }
     mStarted = true;
     if (mJobs.empty()) {
         allJobsCompleted();
     } else {
         for (ListNode<ThreadJob*>* node = mJobs.getFirstNode(); node; node = node->getNext()) {
             startJob(node->getData());
         }
     }
 }
开发者ID:ColinGilbert,项目名称:d-collide,代码行数:22,代码来源:threadjobcollection.cpp

示例6: DisplayTrip

void DisplayTrip(const int BORDER,
				  string username,
			      Trip &trip)
{
	const int NUM_OF_OPTIONS = trip.getDestinations().size();

	//Data Structures
	ListNode<tripNode>* 	   selected[NUM_OF_OPTIONS];
	int            parentAr   [NUM_OF_OPTIONS];
	int            dist       [NUM_OF_OPTIONS];

	List<tripNode> destinations;
	avltree<User>  users;

	//Input-Output
	stringstream   ss;
	stringstream   ss2;

	//Variables
	int input;
	int option;
	int index;
	int distance;
	int totalDistance;

	string tripStr;
	string tripName;

	ifstream inFile;
	ofstream outFile;
	User     tempUser;

	tripNode tempTrip;
	tripNode lastTrip;
	tripNode source;
	ListNode<tripNode> *node;

	DWORD mode;

	//Initialize Variables
	input         = 0;
	option        = 1;
	index         = 0;
	distance      = 0;
	totalDistance = 0;

	destinations = trip.getDestinations();
	destinations.to_front();

	CenterStrings(ss, "Press Enter to Select a Trip", BORDER);
	CenterStrings(ss, "Use Up or Down Arrow Keys to Navigate list", BORDER);
	CenterStrings(ss, "Press Ctrl-S to Save and Exit \n\n", BORDER);

	if(destinations.currentNode(source)){
		destinations.to_front();
		source = trip.getSource();
		fastRoute(destinations,
				  source,
				  parentAr,
				  dist,
				  NUM_OF_OPTIONS);
	}

	//Initialize all indices of currentTrip[] to 0 (All options unselected)
	for(int pos = 0; pos < NUM_OF_OPTIONS; pos++){
		selected[pos] = NULL;
	}


	//Main Loop
	while(input != -1)
	{
		// Clear Console.
		system("CLS");

		//Reset Index
		index = 0;
		//PrintInput("MainMenu.txt");
		cout << (MenuString());
		cout << ss.str() << '\n';

		destinations.to_front();

		// Prints Selection.  Passes parameter based on
		// current value of option.
		node = destinations.currentNode();
		while(node != NULL){
			if(index == 0)
			{
				distance = 0;
			}
			else
			{
				distance = node->getData().s.getLocation().distanceTo
													(lastTrip.s.getLocation());
			}
			totalDistance += distance;
			lastTrip = node->getData();

			ss2 << node->getData().s.getStadiumName().str
//.........这里部分代码省略.........
开发者ID:scottcmiller,项目名称:CS1D,代码行数:101,代码来源:DisplayTrip.cpp

示例7: allJobsCompleted

 /*!
  * Called once all jobs in this collection have been completed, i.e.:
  * \li every job that was added using \ref addJob also called \ref setJobCollection
  * \li all jobs that belong to this collection have been added (see \ref setAllJobsAreAdded)
  *
  * Derived classes that reimplement this method \em must call the base
  * implementation!
  */
 void ThreadJobCollection::allJobsCompleted() {
     mAllJobsCompleted = true;
     for (ListNode<ThreadJobCollection*>* node = mStartOnceCompleted.getFirstNode(); node; node = node->getNext()) {
         node->getData()->start();
     }
 }
开发者ID:ColinGilbert,项目名称:d-collide,代码行数:14,代码来源:threadjobcollection.cpp

示例8: main

int main()
{
	//PlaySound(("NFL_REMIX.wav"), NULL, SND_LOOP | SND_ASYNC);
	List<Souvenir> souvList;
	avltree< TeamContainer<teamName> >    teamAvl;
	avltree< TeamContainer<stadiumName> > stadiumAvl;
	avltree< TeamContainer<year> >        yearAvl;

	ofstream outFile;
	ifstream inFile;
	tripNode tempTrip;
	List<tripNode> trip;
	Team        stad;
	string temp;
	tripNode       source;
	int size = 0;



    MainMenu(80);

	outFile.open("CONSOLE OUTPUT.txt");

	List<Team> stadiumList;

	GenerateStadiums("NFLStadiums.txt", stadiumList);

	stadiumList.to_front();
	ListNode<Team>* tempNode;

	while(!(stadiumList.isEmpty())){
		tempNode = stadiumList.pop();
		if(tempNode != NULL){
			Team tempStadium = tempNode->getData();
			stadiumAvl.insert(TeamContainer<stadiumName>(tempStadium));
			teamAvl.insert(TeamContainer<teamName>(tempStadium));
			yearAvl.insert(TeamContainer<year>(tempStadium));
		}
	}

	outFile << "------------------------------------------------------" << endl
			<< "-        LIST OF NFL TEAMS BY : STADIUM NAME          " << endl
			<< "------------------------------------------------------"
			<< endl << endl;
	outFile << stadiumAvl.inorder() << endl << endl;

	outFile << "------------------------------------------------------" << endl
			<< "-        LIST OF NFL TEAMS BY : TEAM NAME             " << endl
			<< "------------------------------------------------------"
			<< teamAvl.inorder() << endl << endl;

	outFile << "------------------------------------------------------" << endl
			<< "-        LIST OF NFL TEAMS BY : STADIUM NAME          " << endl
			<< "------------------------------------------------------"
			<< endl << endl;
	outFile << yearAvl.inorder() << endl << endl;




	outFile << "------------------------------------------------------" << endl
		    << "-     AVL TREE BY Team Name : ASCENDING ORDER     -" << endl
		    << "------------------------------------------------------"
		    << endl << endl;
	outFile << stadiumAvl.inorder();

	//START OF AVL TREE
		GenerateStadiums("NFLStadiums.txt", stadiumList);
		avltree< TeamContainer<roofType> > roofAvl;

		while(!(stadiumList.isEmpty())){
			tempNode = stadiumList.pop();
			if(tempNode != NULL){
				Team tempStadium = tempNode->getData();
				roofAvl.insert(TeamContainer<roofType>(tempStadium));
			}
		}

		outFile << "------------------------------------------------------" << endl
			    << "-     AVL TREE BY ROOF TYPE: ASCENDING ORDER     -" << endl
			    << "------------------------------------------------------"
			    << endl << endl;
		outFile << roofAvl.inorder();

	return 0;
}
开发者ID:scottcmiller,项目名称:CS1D,代码行数:86,代码来源:main.cpp

示例9: startJobs

 /*!
  * Start all jobs in \p list, i.e. add them to the \ref getWorkerPool
  */
 void Pipeline::startJobs(List<ThreadJob*>* list) {
     for (ListNode<ThreadJob*>* node = list->getFirstNode(); node; node = node->getNext()) {
         mWorkerPool->addJob(node->getData());
     }
     list->clear();
 }
开发者ID:ColinGilbert,项目名称:d-collide,代码行数:9,代码来源:pipeline.cpp


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