Logo Search packages:      
Sourcecode: pan version File versions  Download package

void DataImpl::MyTree::get_children ( const Quark mid,
articles_t &  setme 
) const [virtual]

if message_id is empty, the root nodes are returned.

Implements pan::Data::ArticleTree.

Definition at line 37 of file my-tree.cc.

{
  if (mid.empty()) // get the roots
  {
    foreach_const (nodes_t, _nodes, it)
    if (it->second->_article && !it->second->_parent)
      setme.push_back (it->second->_article);
  }
  else // get children of a particular article
  {
    nodes_t::const_iterator parent_it (_nodes.find (mid));
    if (parent_it != _nodes.end()) {
      ArticleNode::children_t& kids (parent_it->second->_children);
      setme.reserve (kids.size());
      foreach_const (ArticleNode::children_t, kids, it)
        setme.push_back ((*it)->_article);
    }
  }
}

Generated by  Doxygen 1.6.0   Back to index