void ElementDataGridRow::OnDataSourceDestroy(DataSource* ROCKET_UNUSED(_data_source)) { data_source->DetachListener(this); data_source = NULL; RemoveChildren(); }
void PhysicsServer::Init() { if (m_bInited) { return; } RemoveChildren(); m_Objects.clear(); dInitODE(); m_WorldID = dWorldCreate(); m_DefaultSpaceID = dHashSpaceCreate( NULL ); m_ContactGroupID = dJointGroupCreate( 0 ); dWorldSetAutoDisableFlag( m_WorldID, 1 ); dWorldSetAutoDisableAverageSamplesCount( m_WorldID, 1 ); if (m_WorldID) { SetERP( m_ERP ); SetCFM( m_CFM ); SetGravity( m_Gravity ); } m_pDefMaterial = g_pObjectServer->FindObject<PhysMaterial>( "defaullt_mtl", this ); if (!m_pDefMaterial) { m_pDefMaterial = new PhysMaterial(); m_pDefMaterial->SetName( "defaullt_mtl" ); AddChild( m_pDefMaterial ); } m_bInited = true; } // PhysicsServer::Init
void CNcdNodeFolder::ExpireAndRemoveChildrenL() { DLTRACEIN(("")); TInt count = iChildren.Count(); CNcdNode* node = NULL; RPointerArray<CNcdExpiredNode> expiredNodes; CleanupResetAndDestroyPushL( expiredNodes ); expiredNodes.ReserveL( count ); while( count-- ) { node = NodeManager().NodePtrL( iChildren[ count ]->Identifier() ); if ( node ) { NodeManager().SetNodeExpiredL( *node, EFalse, EFalse, expiredNodes ); } } CleanupStack::PopAndDestroy( &expiredNodes ); // Delete child metadatas from disk cache NodeManager().RemoveChildrenMetadataL( *this ); // Empty children lists RemoveChildren(); }
spContext::~spContext() { RemoveChildren(); for( size_t i = 0; i != mComments.size(); ++i ) delete mComments[i]; }
void Actor::RemoveChildren() { RemoveChildren([](Actor& actor) { return actor.GetStatus() == Status::Dead; }); EachChildren([](Actor& actor) { actor.RemoveChildren(); }); }
void JModel::Clear() { m_IBFirstByte = 0; m_IBIteration = -1; m_IBufID = -1; RemoveChildren(); m_Vertices.Clear(); m_Indices.Clear(); } // JModel::Clear
void CSerialPortItems::ReloadContents() { int i; RemoveChildren(); CSerialPortItem *item; for(i=0; i<16; i++){ item = new CSerialPortItem(&key, i+1); AddChild(0, item); } }
void UITreeItemInfo::ToggleExpanded() { if ((GetName() == "..") || (GetName() == "."))return; isExpanded = !isExpanded; if (isExpanded) { RemoveChildren(); ownerTree->RecursiveTreeWalk(this->GetPathname(), this); } }
PPDBuilder(BView* parent, BView* view, BMessage& settings) : fParent(parent) , fView(view) , fBounds(view->Bounds()) , fSettings(settings) { RemoveChildren(view); fBounds.OffsetTo(0, 0); fBounds.left += kLeftMargin; fBounds.top += kTopMargin; fBounds.right -= kRightMargin; }
// Removes all the child cells and fetches them again from the data source. void ElementDataGridRow::RefreshRows() { // Remove all our child rows from the table. RemoveChildren(); // Load the children from the data source. if (data_source) { int num_rows = data_source->GetNumRows(data_table); if (num_rows > 0) { AddChildren(0, num_rows); } } }
bool XMLElement::SetStringVector(const StringVector& value) { if (!RemoveChildren("string")) return false; for (auto i = value.begin(); i != value.end(); ++i) { XMLElement stringElem = CreateChild("string"); if (!stringElem) return false; stringElem.SetAttribute("value", *i); } return true; }
bool XMLElement::SetVariantMap(const VariantMap& value) { if (!RemoveChildren("variant")) return false; for (auto i = value.begin(); i != value.end(); ++i) { XMLElement variantElem = CreateChild("variant"); if (!variantElem) return false; variantElem.SetUInt("hash", i->first.Value()); variantElem.SetVariant(i->second); } return true; }
bool XMLElement::SetVariantVector(const VariantVector& value) { // Must remove all existing variant child elements (if they exist) to not cause confusion if (!RemoveChildren("variant")) return false; for (auto i = value.begin(); i != value.end(); ++i) { XMLElement variantElem = CreateChild("variant"); if (!variantElem) return false; variantElem.SetVariant(*i); } return true; }
bool XMLElement::SetVariantMap(const VariantMap& value) { if (!RemoveChildren("variant")) return false; for (VariantMap::ConstIterator i = value.Begin(); i != value.End(); ++i) { XMLElement variantElem = CreateChild("variant"); if (!variantElem) return false; variantElem.SetInt("hash", i->first_.Value()); variantElem.SetVariant(i->second_); } return true; }
PhysicsServer::~PhysicsServer() { RemoveChildren(); if (m_WorldID) { dJointGroupDestroy( m_ContactGroupID ); dSpaceDestroy( m_DefaultSpaceID ); dWorldDestroy( m_WorldID ); dCloseODE(); } m_bInited = false; if (s_pInstance == this) { s_pInstance = NULL; } } // PhysicsServer::~PhysicsServer
void PPDConfigView::FillDetails(Statement* statement) { RemoveChildren(fDetails); if (statement == NULL) { return; } StatementList* children= statement->GetChildren(); if (children == NULL) { return; } BRect bounds(fDetails->Bounds()); bounds.OffsetTo(kLeftMargin, kTopMargin); DetailsBuilder builder(this, fDetails, bounds, statement, fSettings); builder.Visit(children); }
void CDCSItem::ReloadContents() { RTK_CURSOR hNode; PRTK_NODE pNode; CNodeItem *item; RemoveChildren(); // discover all running nodes // discover_nodes(1000); hNode = open_first_node(); pNode = (PRTK_NODE)cursor_get_item(hNode); while( pNode ){ item = new CNodeItem(&pNode->key); AddChild(item); cursor_move_next(hNode); pNode = (PRTK_NODE)cursor_get_item(hNode); } close_handle(hNode); }
void spInterFileContext::ParseContents( SourceParserPlugin* pPlugin ) { mDeletionMarks.erase( mDeletionMarks.begin(), mDeletionMarks.end() ); RemoveChildren(); // clean up top-level context mParser.SetPlugin( pPlugin ); for( size_t i = 0; i != m_Files.size(); ++i ) { wxChar* s = (char*)(m_Contents[i].c_str()); spFile* pFCtx = mParser.Parse( s, s + m_Contents[i].length() ); pFCtx->m_FileName = m_Files[i]; AddMember( pFCtx ); } }
HierarchyNode::~HierarchyNode() { RemoveChildren(); if (auto parent = weakParent.lock()) { if (parent->firstChild.get() == this) { parent->firstChild = sibling; } else if (parent->firstChild) { auto prevSibling = parent->firstChild; POMDOG_ASSERT(prevSibling); while (prevSibling->sibling.get() != this) { prevSibling = prevSibling->sibling; } if (prevSibling->sibling.get() == this) { prevSibling->sibling = sibling; } } } }
CNcdNodeFolder::~CNcdNodeFolder() { DLTRACEIN(("this: %X", this)); for ( TInt i = 0; i < iChildren.Count(); ++i ) { DLINFO(( _L("Child %d, ns: %S, id: %S"), i, &iChildren[i]->Identifier().NodeNameSpace(), &iChildren[i]->Identifier().NodeId() )); } RemoveChildren(); if ( iNodeSeenFolder ) { DLINFO(("Closing node seen folder")); iNodeSeenFolder->Close(); iNodeSeenFolder = NULL; } iPreviousChildren.ResetAndDestroy(); DLTRACEOUT(("")); }
void CXML_Element::Empty() { RemoveChildren(); }
bool XMLElement::RemoveChildren(const ea::string& name) { return RemoveChildren(name.c_str()); }
void ElementDataGridRow::OnRowRemove(DataSource* _data_source, const Rocket::Core::String& _data_table, int first_row_removed, int num_rows_removed) { if (_data_source == data_source && _data_table == data_table) RemoveChildren(first_row_removed, num_rows_removed); }
// Adds the cell contents, and marks the row as loaded. void ElementDataGridRow::Load(const DataQuery& row_information) { // Check for a data source. If they're both set then we set // ourselves up with it. if (row_information.IsFieldSet(DataSource::CHILD_SOURCE)) { Rocket::Core::String data_source = row_information.Get< Rocket::Core::String >(DataSource::CHILD_SOURCE, ""); if (!data_source.Empty()) { SetDataSource(data_source); } else { // If we've no data source, then we should remove any children. RemoveChildren(); } } // Now load our cells. for (int i = 0; i < parent_grid->GetNumColumns(); i++) { Core::Element* cell = GetChild(i); if (cell) { // Fetch the column: const ElementDataGrid::Column* column = parent_grid->GetColumn(i); // Now we use the column's formatter to process the raw data into the // XML string, and parse that into the actual Core::Elements. If there is // no formatter, then we just send through the raw text, in CVS form. Rocket::Core::StringList raw_data; for (size_t i = 0; i < column->fields.size(); i++) { if (column->fields[i] == DataSource::DEPTH) { raw_data.push_back(Rocket::Core::String(8, "%d", depth)); } else if (column->fields[i] == DataSource::NUM_CHILDREN) { raw_data.push_back(Rocket::Core::String(8, "%d", children.size())); } else { raw_data.push_back(row_information.Get< Rocket::Core::String >(column->fields[i], "")); } } Rocket::Core::String cell_string; if (column->formatter) { column->formatter->FormatData(cell_string, raw_data); } else { for (size_t i = 0; i < raw_data.size(); i++) { if (i > 0) { cell_string.Append(","); } cell_string.Append(raw_data[i]); } } // Remove all the cell's current contents. while (cell->GetNumChildren(true) > 0) { cell->RemoveChild(cell->GetChild(0)); } // Add the new contents to the cell. Core::Factory::InstanceElementText(cell, cell_string); } else { ROCKET_ERROR; } } dirty_cells = false; }
bool XMLElement::RemoveChildren(const String& name) { return RemoveChildren(name.CString()); }