[Lemon-devel] Renaming basic classes

Ladanyi, Akos ladanyi at tmit.bme.hu
Tue Sep 4 13:50:53 CEST 2007


On Mon, 2007-09-03 at 21:00 +0200, Balazs Dezso wrote:
> Hi Developers
> 
> The idea of renaming the main graph classes and items is quite urgent 
> question. The UEdge and BpUGraph names are involved and on some points the 
> naming conventions are not complete.
> 
> After some discussions, we suggest the next rename mappings:
> Graph => Digraph
> UGraph => Graph
> BpUGraph => Bigraph
> 
> Edge => Arc
> UEdge => Edge
> 
> uEdge...() => edge...()
> aNode...() => anode...()
> bNode...() => bnode...()
This does not conform to our coding style, does it? What about changing
the coding style so that member function names start with capital
letter? Or is that too drastic?
> 
> The source() and target() functions could be changed in the undirected graphs 
> to first() and second(), or anode() and bnode(). This second variant is very 
> close to the Bigraph interface, but there is not concrete meaning of the 
> order of the nodes.
> 
> In my point of view the graph structures are quite stable but some solutions 
> should be revised. The extenders make the compile errors and warnings 
> unreadable but we do not have better solution.
On the meeting Alpar said that there is a solution to avoid extenders
but that would require templated NodeIt-s and bros. And the problem with
these that they can not be typedefed like this:
typedef NodeIt<ListGraph> NodeIt;

If you are a user of the library you can avoid this by not using a
"using namespace lemon" but having typedefs like these:
typedef lemon::ListGraph Graph;
typedef lemon::NodeIt<Graph> NodeIt;

I know, this doesn't help if you are witing code in the lemon namespace,
but if a "typedef NodeIt<ListGraph> NodeI" is not good enough, then we
could put the NodeIt in a separate namespace under lemon, for example:
lemon::graph::NodeIt.

What do you think?
>  The handling of anodes and 
> bnodes also should be revised.
> 
> Please comment this suggestions, if you agree with this proposals or if you 
> have some improvements or other opinion.

Akos




More information about the Lemon-devel mailing list