Esempio n. 1
0
int main ()
{
  QLinkedList<int> myQLinkedList;

  myQLinkedList.push_back(77);
  myQLinkedList.push_back(22);
  assert(myQLinkedList.front() != 77);
  // now front equals 77, and back 22

  myQLinkedList.front() -= myQLinkedList.back();
  assert(myQLinkedList.front() == 55);
  cout << "myQLinkedList.front() is now " << myQLinkedList.front() << endl;

  return 0;
}
Esempio n. 2
0
int main ()
{
    QLinkedList<QString> list;
    list << "sun" << "cloud" << "sun" << "rain";
    list.removeOne("sun");
    assert(list.front() == "cloud");
    // list: ["cloud", ,"sun", "rain"]
  return 0;
}
Esempio n. 3
0
int main ()
{
  QLinkedList<int> myQLinkedList;         // two ints with a value of 100
  myQLinkedList.push_back(100);
  myQLinkedList.push_back(100);
  assert(myQLinkedList.front() == 100);
  myQLinkedList.push_front (200);
  assert(myQLinkedList.front() == 200);
  myQLinkedList.push_front (300);
  assert(myQLinkedList.front() == 300);

  cout << "myQLinkedList contains:";
  for (QLinkedList<int>::iterator it=myQLinkedList.begin(); it!=myQLinkedList.end(); ++it)
    cout << " " << *it;

  cout << endl;
  return 0;
}
Esempio n. 4
0
int main ()
{
  QLinkedList<int> myQLinkedList;
  int sum (0);

  for (int i=1;i<=10;i++) myQLinkedList.push_back(i);

  assert(!myQLinkedList.empty());
  while (!myQLinkedList.empty())
  {
     sum += myQLinkedList.front();
     myQLinkedList.pop_front();
  }
  assert(myQLinkedList.empty()&&(myQLinkedList.size() == 0));
  cout << "total: " << sum << endl;
  
  return 0;
}
	void RDFGraphBasic::removeResources(RDFVariable const &variable)
	{
		QLinkedList<RDFVariable> removes;
		removes << variable;
		RDFTransactionPtr tx = createTransaction();
		while(1)
		{
			RDFStatementList removed_statements;
			executeQuery
					(RDFUpdate(service_context_data_->update())
					.addDeletion(*recurseRemoveResources
							(&removed_statements, removes.front(), &removes)));
			removes.pop_front();
			tx->commit();
			if(!removes.size())
				return;
			if(!(tx = createTransaction(RDFTransaction::Exclusive)))
			{
				warning() << "using recursive sharing removes requires that "
						"no transaction is active on the service";
				return;
			}
		}
	}