From: Christophe de V. <cde...@al...> - 2003-02-06 17:29:26
|
=2D----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Le Jeudi 6 F=E9vrier 2003 17:50, Stefan Seefeld a =E9crit : > I agree that this is quite independent of the rest. It merely addresses > the type safety issue, i.e. it helps us recover the exact type of a > child node. > > In terms of API complexity it requires all nodes to have an 'accept' > method, to be implemented as > > void Element::accept(Visitor *v) { v->visit_element(this);} > > plus a 'Visitor' base class that has one 'visit' method per node type. > (to be implemented by users) Implemented by users, but with a default empty implementation I think. We could then make a visitor which will 'see' only the TextNodes of a Docum= ent=20 for example. =2D----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+QptYB+sU3TyOQjARAt7NAJwNjzfZ9zdRvNgIpZer7rDd6cbIuACeOwOk ecXYt+qPWy/SeRV3K3PZ4/4=3D =3DPn76 =2D----END PGP SIGNATURE----- |