[great-users] return connected objects ordered by an attribute value
Belschner, Tim
tim.belschner at ils.uni-stuttgart.de
Wed Mar 25 09:54:12 CDT 2015
Hello everybody,
during a transformation I stick some model objects “Operation” with a crosslink “clDataOperation” to the model object “Data_IN”. In my last rule, I pass in the “Data_IN” object and would like to get all connected “Operation” objects in a set, so that I can iterate through. The solution is pretty simple:
########## CODE BEGIN #############
set< DataflowDSL::Operation> Found_Operations= Data_IN.clDataOperationdst();
for(set< DataflowDSL::Operation>::const_iterator it1= Found_Operations.begin(); it1 != Found_Operations.end(); ++it1)
{
cout << it1->name() << std::endl;
}
########## CODE END #############
Now, I would like to order the “Operation” objects by the value of their integer attribute “SequenceID”. For this I am using the “_sorted” version of the API call. Unfortunately, I am struggling with the proper call of the function “clDataOperationdst_sorted”, especially the correct declaration of “Pred”.
Here is what I got so far:
########## CODE BEGIN #############
Udm::CrossAssocAttr< DataflowDSL::Operation, Pred> > Found_Operations= Data_IN.clDataOperationdst_sorted( &DataflowDSL::Operation::SequenceID );
########## CODE END #############
Could someone please give me an example how the “_sorted” version has to be called in a correct way?
Thanks in advance and best regards
Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.isis.vanderbilt.edu/pipermail/great-users/attachments/20150325/9e4dbbc5/attachment.html
More information about the great-users
mailing list