[gme-users] Controlling the order in which children are returned,decorators

Endre Magyari endre at isis.vanderbilt.edu
Thu Jul 8 22:02:08 CDT 2004


> [Adi]
> I believe there is a way in UDM to also provide a comparator but you
> will have to cross check with either Endre or Attila. A post to the
> UDM-users would yield a result. In my case I have written my own sort
> functions. I can provide you with a simple insertion sort routine if you
> need one.




No need to post to UDM-users, I'm listening here as well.
All generated API calls which return sets do have a "_sorted" version, 
which also accepts an orderer functor.

here is an example:

non-sorted getter:
Udm::ChildrenAttr<RefPort::RootFolder> RootFolder_children() const 
{ return Udm::ChildrenAttr<RefPort::RootFolder>(impl, 
meta_RootFolder_children); }

sorted getter:
template <class Pred> Udm::ChildrenAttr<RefPort::RootFolder, Pred> 
RootFolder_children_sorted(const Pred &) const { return 
Udm::ChildrenAttr<RefPort::RootFolder, Pred>(impl, 
meta_RootFolder_children); }

Endre.


More information about the gme-users mailing list