Opened 16 years ago
Last modified 15 years ago
#189 new enhancement
Add the functionality of ItemSetTraits to the graphs
Reported by: | Peter Kovacs | Owned by: | Balazs Dezso |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | core | Version: | hg main |
Keywords: | Cc: | ||
Revision id: |
Description
Maybe we could introduce the functionality of ItemSetTraits
to the graph concepts and to the adaptors in order to have the followings for all graph types.
Graph::Map<T, Value>
Graph::It<T>
orGraph::ItemIt<T>
Where T
can be Node
, Arc
or Edge
.
Change History (7)
comment:1 Changed 16 years ago by
Owner: | changed from Alpar Juttner to Balazs Dezso |
---|
comment:2 Changed 16 years ago by
Milestone: | LEMON 1.1 release → LEMON 1.2 release |
---|
comment:3 follow-up: 5 Changed 15 years ago by
comment:5 follow-up: 6 Changed 15 years ago by
Replying to kpeter:
Similar problem arises for functions, too. E.g. there are
Node fromId(int, Node) const Edge fromId(int, Edge) const Arc fromId(int, Arc) const int maxId(Node) const int maxId(Edge) const int maxId(Arc) constfunctions in the graph classes (with dummy parameters) to provide alternatives for
nodeFromId()
,maxNodeId()
etc. functions. However the above functions are not documented, they are only used in internal tools (likeItemSetTraits
).If the above question of the ticket is solved, then these functions could also be replaced by template functions that are specialized for
Node
,Arc
andEdge
types.template <typename Item> Item fromId(int) const template <typename Item> int maxId() constSo e.g.
maxId<Node>()
could be used as an alternative tomaxNodeId()
(instead ofmaxId(Node())
, which is a bit strange).What do you think?
It isn't a good idea, because the template specialization is forbidden in class space. The only solution would be if the specialized function was also declared out of the class, and this helper function would be called from the member function.
comment:6 Changed 15 years ago by
Replying to deba:
It isn't a good idea, because the template specialization is forbidden in class space.
Thanks, I didn't know that.
comment:7 Changed 15 years ago by
Milestone: | LEMON 1.2 release |
---|
Similar problem arises for functions, too. E.g. there are
functions in the graph classes (with dummy parameters) to provide alternatives for
nodeFromId()
,maxNodeId()
etc. functions. However the above functions are not documented, they are only used in internal tools (likeItemSetTraits
).If the above question of the ticket is solved, then these functions could also be replaced by template functions that are specialized for
Node
,Arc
andEdge
types.So e.g.
maxId<Node>()
could be used as an alternative tomaxNodeId()
(instead ofmaxId(Node())
, which is a bit strange).What do you think?