Unneeded asymmetries between Constraint/Generator public interfaces.

Reasoning on the user interface.
I noted that the enumeration Type and the corresponding accessor method type() are declared:
- public in Generator.defs.hh - PPL_INTERNAL (hence, private for the end-user) in Constraint.defs.hh
Also, for the class Constraint we do provide boolean tests is_equality() and is_inequality, while similar tests are not provided for Generator: we only have is_line() is declared as PPL_INTERNAL; we don't have methods is_ray() and is_vertex(). NOTE: the method is_ray_or_vertex() is PPL_INTERNAL, as it should be.
In order to have a more uniform interface, I suggest the following:
- let the enums Type and methods type() be public, so that the user has a uniform way to investigate the type of constraints/generators.
- let the boolean tests, including the yet to be written is_ray() and is_vertex(), but excluding is_ray_or_vertex(), be either all public or all PPL_INTERNAL.
What do you think ? Should I go on and implement this change ?
Ciao, Enea.

Enea Zaffanella wrote:
Reasoning on the user interface.
I noted that the enumeration Type and the corresponding accessor method type() are declared:
- public in Generator.defs.hh
- PPL_INTERNAL (hence, private for the end-user) in Constraint.defs.hh
Also, for the class Constraint we do provide boolean tests is_equality() and is_inequality, while similar tests are not provided for Generator: we only have is_line() is declared as PPL_INTERNAL; we don't have methods is_ray() and is_vertex(). NOTE: the method is_ray_or_vertex() is PPL_INTERNAL, as it should be.
In order to have a more uniform interface, I suggest the following:
- let the enums Type and methods type() be public, so that the user has
a uniform way to investigate the type of constraints/generators.
I agree.
- let the boolean tests, including the yet to be written is_ray() and
is_vertex(), but excluding is_ray_or_vertex(), be either all public or all PPL_INTERNAL.
I would agree on having them all public (is_line included), even though I believed we agreed on the fact that the name "vertex" is somewhat special.
What do you think ? Should I go on and implement this change ?
Please go ahead.
Roberto

Roberto Bagnara wrote:
[...]
I would agree on having them all public (is_line included), even though I believed we agreed on the fact that the name "vertex" is somewhat special.
I know, but that is another story. This type inspection method will be renamed with all the other methods using the word "vertex" improperly, all at once. THEN, we will probably add a new method called either is_vertex() or is_extremal_point() that will answer "true" if the point is a proper vertex.
Enea
participants (2)
-
Enea Zaffanella
-
Roberto Bagnara