本文整理汇总了C++中DataList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ DataList::end方法的具体用法?C++ DataList::end怎么用?C++ DataList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataList
的用法示例。
在下文中一共展示了DataList::end方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: startChunks
//=============================================================================
// METHOD: SPELLipcDataChunk::
//=============================================================================
int SPELLipcDataChunk::startChunks( const std::string& id, const DataList& data )
{
SPELLmonitor m(m_lock);
if (data.size()<=m_chunkSize) return 0;
ListOfDataList* chunks = new ListOfDataList();
DataList::const_iterator it;
DataList::const_iterator end = data.end();
unsigned int lineCount = 0;
DataList* chunk = new DataList();
for( it = data.begin(); it != end; it++)
{
chunk->push_back( (*it) );
lineCount++;
if (lineCount==m_chunkSize)
{
chunks->push_back( chunk );
chunk = new DataList();
lineCount = 0;
}
}
// Add the last partial chunk if any
if (chunk->size()>0)
{
chunks->push_back( chunk );
}
m_chunks[id] = chunks;
int totalChunks = chunks->size();
return totalChunks;
}
示例2:
void Auth2Certificate::AppendDataList( const DataList &theDataList )
{
Auth2Certificate::DataListCIter anIter = theDataList.begin();
while( anIter != theDataList.end() )
{
CertificateDataBlock *aBlock = (*anIter)->Duplicate();
mDataList.push_back( aBlock );
++anIter;
}
}
示例3: getChunk
//=============================================================================
// METHOD: SPELLipcDataChunk::
//=============================================================================
SPELLipcDataChunk::DataList SPELLipcDataChunk::getChunk( const std::string& id, unsigned int num )
{
DataList chunk;
DataMap::iterator it = m_chunks.find(id);
if (it != m_chunks.end())
{
ListOfDataList* chunks = it->second;
if (num<chunks->size())
{
DataList* list = (*chunks)[num];
DataList::iterator lit;
for( lit = list->begin(); lit != list->end(); lit++)
{
chunk.push_back( (*lit) );
}
}
}
return chunk;
}
示例4: sortDataList
//Sort data
void sortDataList(DataList& a)
{
sort(a.begin(),a.end(),myfunction);
}
示例5: sendCreatePlayer
//======================================================================================================================
//
// create player
//
bool MessageLib::sendCreatePlayer(PlayerObject* playerObject,PlayerObject* targetObject)
{
if(!_checkPlayer(targetObject))
return(false);
sendCreateObjectByCRC(playerObject,targetObject,false);
if(targetObject == playerObject)
{
sendBaselinesCREO_1(playerObject);
sendBaselinesCREO_4(playerObject);
}
sendBaselinesCREO_3(playerObject,targetObject);
sendBaselinesCREO_6(playerObject,targetObject);
sendCreateObjectByCRC(playerObject,targetObject,true);
sendContainmentMessage(playerObject->getPlayerObjId(),playerObject->getId(),4,targetObject);
sendBaselinesPLAY_3(playerObject,targetObject);
sendBaselinesPLAY_6(playerObject,targetObject);
if(targetObject == playerObject)
{
sendBaselinesPLAY_8(playerObject,targetObject);
sendBaselinesPLAY_9(playerObject,targetObject);
}
//close the yalp
sendEndBaselines(playerObject->getPlayerObjId(),targetObject);
sendPostureMessage(playerObject,targetObject);
if(playerObject->getParentId())
{
sendContainmentMessage(playerObject->getId(),playerObject->getParentId(),4,targetObject);
}
if(targetObject == playerObject)
{
// tangible objects
if(TangibleObject* hair = dynamic_cast<TangibleObject*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Hair)))
{
//only create the hair as the helmet will be created at a different time
if(hair->getTangibleType() == TanType_Hair)
{
sendCreateTangible(hair,targetObject);
}
}
// create inventory and contents
if(dynamic_cast<TangibleObject*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Inventory)))
{
sendInventory(playerObject);
}
// mission bag
if(TangibleObject* missionBag = dynamic_cast<TangibleObject*>(playerObject->getEquipManager()->getEquippedObject(CreatureEquipSlot_Mission)))
{
gMessageLib->sendCreateTangible(missionBag,playerObject);
//Now iterate through the missions and create them clientside
MissionBag* mbag = dynamic_cast<MissionBag*> (missionBag);
MissionList::iterator it = mbag->getMissions()->begin();
while(it != mbag->getMissions()->end())
{
MissionObject* mission = dynamic_cast<MissionObject*>(*it);
sendCreateObjectByCRC(mission, targetObject, false);
sendContainmentMessage(mission->getId(), mbag->getId(), 4, targetObject);
sendBaselinesMISO_3(mission, targetObject);
sendBaselinesMISO_6(mission, targetObject);
sendBaselinesMISO_8(mission, targetObject);
sendBaselinesMISO_9(mission, targetObject);
sendEndBaselines(mission->getId(), targetObject);
++it;
}
}
// datapad
Datapad* datapad = playerObject->getDataPad();
if(datapad)
{
//would be nice to use the tangibles objectcontainer for the datapad
//need to get missionobjects intangibles, Man Schematics, waypoints and stuff in though, so better do it manually
gMessageLib->sendCreateTangible(datapad,playerObject);
//now iterate through the schematics and create them clientside
Datapad* dpad = dynamic_cast<Datapad*> (datapad);
ManufacturingSchematicList* manufacturingSchematics = dpad->getManufacturingSchematics();
ManufacturingSchematicList::iterator it = manufacturingSchematics->begin();
while(it != manufacturingSchematics->end())
{
gMessageLib->sendCreateManufacturingSchematic((dynamic_cast<ManufacturingSchematic*>(*it)),playerObject ,false);
//.........这里部分代码省略.........
示例6: to_string
string to_string(const DataList &list) {
return Convert::to_string<'[', ']'>(list.begin(), list.end(), [](const ObjectPtr &obj) { return to_string(obj); });
}
示例7: main
int main() {
#ifdef _DEBUG
// When we have a memory leak, set this variable to
// the allocation number (e.g. 122) and then we'll break
// when that allocation occurs.
//_crtBreakAlloc = 17366 ;
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#endif // _DEBUG
{ // create local scope to allow for local memory cleanup before we check at end
//
// create the test data
//
DataList* dataList = CreateEventTestData();
//
// set up Soar
//
Kernel* kernel = Kernel::CreateKernelInNewThread();
Agent* agent = kernel->CreateAgent("Soar1");
RegisterForEvents(kernel, agent, dataList);
// Load up TOH as a base set of rules.
// Comment this out if we don't want any initial set of rules.
//cout << kernel->ExecuteCommandLine("source ..\\..\\SoarLibrary\\Demos\\towers-of-hanoi\\towers-of-hanoi.soar", agent->GetAgentName()) << endl ;
//
// let the user do whatever they want
//
string command;
do {
cout << agent->GetAgentName() << "> ";
getline(cin, command);
// check for special commands
if(command == "reset") {
ResetEventCounts(dataList);
cout << "counts reset" << endl;
} else if(!command.compare(0, 6, "counts")) {
string type = "";
if(command != "counts") { type = command.substr(7,command.length()-7); }
PrintEventData(dataList, type);
} else {
cout << kernel->ExecuteCommandLine(command.c_str(), agent->GetAgentName()) << endl;
}
} while( (command != "quit") && (command != "exit") );
kernel->Shutdown();
delete kernel;
//
// Show results
//
PrintEventData(dataList);
//string dummy;
//cout << endl << endl << "Press any key and enter to continue";
//cin >> dummy;
//
// clean up
//
for(DataList::iterator i = dataList->begin(); i != dataList->end(); i++) {
delete (*i);
}
delete dataList;
} // end local scope
return 0;
}