本文整理汇总了C++中ObjectArray::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectArray::push_back方法的具体用法?C++ ObjectArray::push_back怎么用?C++ ObjectArray::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectArray
的用法示例。
在下文中一共展示了ObjectArray::push_back方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SortVector
//------------------------------------------------------------------------------
Integer PropagationStateManager::SortVector()
{
#ifdef DEBUG_STATE_CONSTRUCTION
MessageInterface::ShowMessage(
"Entered PropagationStateManager::SortVector()\n");
#endif
StringArray *propList;
std::vector<Integer> order;
std::vector<Gmat::StateElementId> idList;
ObjectArray owners;
StringArray property;
std::vector<Integer>::iterator oLoc;
Gmat::StateElementId id;
Integer size, loc = 0, val;
stateSize = 0;
// Initially assume there is no post superposition member
hasPostSuperpositionMember = false;
#ifdef DEBUG_STATE_CONSTRUCTION
MessageInterface::ShowMessage("Element list:\n");
Integer k = 0;
for (std::map<GmatBase*, StringArray*>::iterator i = elements.begin();
i != elements.end(); ++i)
{
current = i->first;
propList = i->second;
MessageInterface::ShowMessage(" %d: %s ->\n", ++k,
current->GetName().c_str());
for (UnsignedInt j = 0; j < propList->size(); ++j)
{
MessageInterface::ShowMessage(" %s\n", (*propList)[j].c_str());
}
}
#endif
// First build a list of the property IDs and objects, measuring state size
// at the same time
for (UnsignedInt q = 0; q < objects.size(); ++q)
{
current = objects[q];
propList = elements[current];
for (StringArray::iterator j = propList->begin();
j != propList->end(); ++j)
{
id = (Gmat::StateElementId)current->SetPropItem(*j);
if (id == Gmat::UNKNOWN_STATE)
throw PropagatorException("Unknown state element: " + (*j) +
" on object " + current->GetName() + ", a " +
current->GetTypeName());
size = current->GetPropItemSize(id);
if (size <= 0)
throw PropagatorException("State element " + (*j) +
" has size set less than or equal to 0; unable to continue.");
stateSize += size;
for (Integer k = 0; k < size; ++k)
{
idList.push_back(id);
if (current->PropItemNeedsFinalUpdate(id))
hasPostSuperpositionMember = true;
owners.push_back(current);
property.push_back(*j);
// Put this item in the ordering list
oLoc = order.begin();
while (oLoc != order.end())
{
val = idList[*oLoc];
if (id < val)
{
#ifdef DEBUG_STATE_CONSTRUCTION
MessageInterface::ShowMessage("Inserting; id = %d, z = %d,"
" loc = %d\n", id, (*oLoc), loc);
#endif
order.insert(oLoc, loc);
break;
}
++oLoc;
}
if (oLoc == order.end())
order.push_back(loc);
++loc;
}
}
}
ListItem *newItem;
val = 0;
completionIndexList.clear();
completionSizeList.clear();
#ifdef DEBUG_STATE_CONSTRUCTION
MessageInterface::ShowMessage(
"State size is %d()\n", stateSize);
//.........这里部分代码省略.........