[Lemon-devel] path.h include tree

Balazs Dezso deba at inf.elte.hu
Thu Jan 24 18:49:24 CET 2008


Hi

> I've cut off the LemonReader/Writer part (which part should be revised
> together with GraphReader/Writer IMHO). Then everything became much
> easier.
Peter said that he will revise the LEMON IO, I think in a short time we should 
work out some concept about redesign.
Just a few ideas:
* functionality change
  - restrict the format of the values
  - multiple reading of one map
* simplification
  - possibility of merging the implementations for different Items
  - better separation of codes
* implementation
  - ?
> Two more questions about function pathSource():
>       * Shouldn't we call it just source()?
The pathSource() is a template function. If we remove the "path" prefix the 
function reflect to its functionality (In my opinion, the documentation is 
not sufficient.). In addition, it could cause conflicting names in the 
future.
>       * Currently, its behavior is undefined for empty paths. What is
>         even worse, it will probably causes a segfault if one tries to
>         use it. Shouldn't it return INVALID instead?
I'm not sure... We could state as precondition that the path should not be 
empty. I think the INVALID returning  could solve just a few problem, because 
it just postpone the problem of checking that the result is INVALID or not, 
and it is less efficient.

But I rather suggest a good assertion policy for lemon. For a long while I use 
two repos from other programs, one is compiled with the official flags, and 
one with next flags:
  -ggdb
  -fno-inline
  -DLEMON_USE_DEBUG_MAP
  -DLEMON_ENABLE_ASSERTS 
  -DLEMON-D_GLIBCXX_DEBUG
If more assertions are in the lemon, then it would help to localize the 
problems in the lemon or in the programs.

Best, Balazs


On Thursday 24 January 2008 15.12.46 Alpár Jüttner wrote:
> Hi,
>
> Thanks for the comments.
>
> I'm still working the path related stuff, but I'm going to put these
> changes into my public repo.
>
> I've cut off the LemonReader/Writer part (which part should be revised
> together with GraphReader/Writer IMHO). Then everything became much
> easier.
> As path_utils.h is included by path.c, I see no reason to keep it as a
> separate file. Thus I going to merge it with path.h if nobody has
> objection.
>
> Two more questions about function pathSource():
>       * Shouldn't we call it just source()?
>       * Currently, its behavior is undefined for empty paths. What is
>         even worse, it will probably causes a segfault if one tries to
>         use it. Shouldn't it return INVALID instead?
>
>
> Regard,
> Alpar
>
> On Thu, 2008-01-24 at 13:37 +0100, Balazs Dezso wrote:
> > Hi,
> >
> > a bad design caused the complex dependency tree, unfortunately. The
> > automatic template path copy is an important feature of path concept, and
> > this made the path.h dependent to path_utils.h, because the general path
> > copy is defined there. On other way, usually the ..._utils.h file
> > contains various utilities connected to ..., for example ... reading and
> > writing with Lemon IO. As a consequence, the path.h should include the
> > path_utils.h and the path_utils.h includes what the lemon IO needs.
> >
> > There are two possible improvements on the design:
> > 1) The lemon IO should be separated to several files and some ..._fwd.h
> > files are necessary also.
> > 2) The path_utils.h should be splited to two parts, one for just the path
> > copy, and one for the other related stuffs.
> >
> > Best, Balazs
> >
> > On Thursday 24 January 2008 12.07.06 Alpár Jüttner wrote:
> > > Hi,
> > >
> > > I started to port path.h into the hg repo. I thought it would be an
> > > easy task, but then I checked its dependencies and I created a
> > > dependency tree (see below).  Note that
> > >       * all the standard headers are missing from this list.
> > >       * This tree shows exactly the files (with multiplications) the
> > >         preprocessor goes through during the compilation (i.e. when a
> > >         file is scanned for the second time its dependencies are not
> > >         scanned again.)
> > >
> > > Regards,
> > > Alpar
> > >
> > > lemon/path.h
> > >     lemon/path_utils.h
> > >         lemon/concepts/path.h
> > >             lemon/bits/invalid.h
> > >             lemon/bits/utility.h
> > >             lemon/concept_check.h
> > >         lemon/lemon_reader.h
> > >             lemon/error.h
> > >             lemon/graph_utils.h
> > >                 lemon/bits/invalid.h
> > >                 lemon/bits/utility.h
> > >                 lemon/maps.h
> > >                     lemon/bits/utility.h
> > >                     lemon/bits/traits.h
> > >                         lemon/bits/utility.h
> > >                 lemon/bits/traits.h
> > >                 lemon/bits/alteration_notifier.h
> > >                     lemon/bits/utility.h
> > >                 lemon/bits/default_map.h
> > >                     lemon/bits/array_map.h
> > >                         lemon/bits/traits.h
> > >                         lemon/bits/alteration_notifier.h
> > >                         lemon/concept_check.h
> > >                         lemon/concepts/maps.h
> > >                             lemon/bits/utility.h
> > >                             lemon/concept_check.h
> > >                     lemon/bits/vector_map.h
> > >                         lemon/bits/traits.h
> > >                         lemon/bits/utility.h
> > >                         lemon/bits/alteration_notifier.h
> > >                         lemon/concept_check.h
> > >                         lemon/concepts/maps.h
> > >                     lemon/bits/debug_map.h
> > >                         lemon/bits/traits.h
> > >                         lemon/bits/utility.h
> > >                         lemon/error.h
> > >                         lemon/bits/alteration_notifier.h
> > >                         lemon/concept_check.h
> > >                         lemon/concepts/maps.h
> > >             lemon/bits/utility.h
> > >             lemon/bits/item_reader.h
> > >                 lemon/error.h
> > >             lemon/dim2.h
> > >                 lemon/bits/utility.h
> > >             lemon/concept_check.h
> > >             lemon/concepts/maps.h
> > >         lemon/lemon_writer.h
> > >             lemon/error.h
> > >             lemon/bits/invalid.h
> > >             lemon/graph_utils.h
> > >             lemon/bits/item_writer.h
> > >                 lemon/error.h
> > >             lemon/bits/utility.h
> > >             lemon/maps.h
> > >             lemon/dim2.h
> > >             lemon/concept_check.h
> > >             lemon/concepts/maps.h
> > >     lemon/error.h
> > >     lemon/bits/invalid.h
> > >
> > >
> > > _______________________________________________
> > > Lemon-devel mailing list
> > > Lemon-devel at lemon.cs.elte.hu
> > > http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel
> >
> > _______________________________________________
> > Lemon-devel mailing list
> > Lemon-devel at lemon.cs.elte.hu
> > http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel
>
> _______________________________________________
> Lemon-devel mailing list
> Lemon-devel at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-devel





More information about the Lemon-devel mailing list