1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.3
4 .\" ========================================================================
5 .de Sh \" Subsection heading
13 .de Sp \" Vertical space (when we can't use .PP)
17 .de Vb \" Begin verbatim text
22 .de Ve \" End verbatim text
26 .\" Set up some character translations and predefined strings. \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote. | will give a
29 .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30 .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31 .\" expand to `' in nroff, nothing in troff, for use with C<>.
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
57 . tm Index:\\$1\t\\n%\t"\\$2"
63 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear. Run. Save yourself. No user-serviceable parts.
70 . \" fudge factors for nroff and troff
79 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85 . \" simple accents for nroff and troff
95 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102 . \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 . \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 . \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
129 .\" ========================================================================
131 .IX Title "Tree::Simple::VisitorFactory 3"
132 .TH Tree::Simple::VisitorFactory 3 "2005-11-28" "perl v5.8.7" "User Contributed Perl Documentation"
134 Tree::Simple::VisitorFactory \- A factory object for dispensing Visitor objects
136 .IX Header "SYNOPSIS"
138 \& use Tree::Simple::VisitorFactory;
142 \& my $tf = Tree::Simple::VisitorFactory\->new();
146 \& my $visitor = $tf\->get("PathToRoot");
150 \& # or call it as a class method
151 \& my $visitor = Tree::Simple::VisitorFactory\->getVisitor("PathToRoot");
154 .IX Header "DESCRIPTION"
155 This object is really just a factory for dispensing Tree::Simple::Visitor::* objects. It is not required to use this package in order to use all the Visitors, it is just a somewhat convienient way to avoid having to type thier long class names.
157 I considered making this a Singleton, but I did not because I thought that some people might not want that. I know that I am very picky about using Singletons, especially in multiprocess environments like mod_perl, so I implemented the smallest instance I knew how to, and made sure all other methods could be called as class methods too.
162 Returns an minimal instance of this object, basically just a reference back to the package (literally, see the source if you care).
163 .IP "\fBget ($visitor_type)\fR" 4
164 .IX Item "get ($visitor_type)"
165 Attempts to load the \f(CW$visitor_type\fR and returns an instance of it if successfull. If no \f(CW$visitor_type\fR is specified an exception is thrown, if \f(CW$visitor_type\fR fails to load, and exception is thrown.
166 .IP "\fBgetVisitor ($visitor_type)\fR" 4
167 .IX Item "getVisitor ($visitor_type)"
168 This is an alias of \f(CW\*(C`get\*(C'\fR.
169 .SH "AVAILABLE VISITORS"
170 .IX Header "AVAILABLE VISITORS"
171 This distibution provides a number of Visitor objects which can be loaded just by giving their name. Below is a description of the available Visitors and a sort description of what they do. I have attempted to classify the Visitors into groups which are related to their use.
173 This factory will load any module contained inside the \fBTree::Simple::Visitor::*\fR namespace. Given a name, it will attempt to \f(CW\*(C`require\*(C'\fR the module \fBTree::Simple::Visitor::<\f(BIName\fB>.pm\fR. This allows others to create Visitors which can be accessed with this factory, without needed to include them in this distrobution.
174 .Sh "Search/Path Related Visitors"
175 .IX Subsection "Search/Path Related Visitors"
176 .IP "\fBPathToRoot\fR" 4
177 .IX Item "PathToRoot"
178 Given a Tree::Simple object, this Visitor will find the path back to the tree's root node.
179 .IP "\fBFindByPath\fR" 4
180 .IX Item "FindByPath"
181 Given a path and Tree::Simple hierarchy, this Visitor will attempt to find the node specified by the path.
182 .IP "\fBFindByUID\fR" 4
184 Given a \s-1UID\s0 and Tree::Simple hierarchy, this Visitor will attempt to find the node with the same \s-1UID\s0.
185 .IP "\fBFindByNodeValue\fR" 4
186 .IX Item "FindByNodeValue"
187 Given a node value and Tree::Simple hierarchy, this Visitor will attempt to find the node with the same node value.
188 .Sh "Traversal Visitors"
189 .IX Subsection "Traversal Visitors"
190 .IP "\fBBreadthFirstTraversal\fR" 4
191 .IX Item "BreadthFirstTraversal"
192 This implements a breadth-first traversal of a Tree::Simple hierarchy.
193 .IP "\fBPostOrderTraversal\fR" 4
194 .IX Item "PostOrderTraversal"
195 Post-order traversal is a variation of the depth-first traversal in which the sub\-tree's are processed \fIbefore\fR the parent.
196 .IP "\fBPreOrderTraversal\fR" 4
197 .IX Item "PreOrderTraversal"
198 Pre-order traversal is a depth-first traversal method in which the sub\-tree's are processed \fIafter\fR the parent.
199 .Sh "FileSystem Visitors"
200 .IX Subsection "FileSystem Visitors"
201 .IP "\fBLoadDirectoryTree\fR" 4
202 .IX Item "LoadDirectoryTree"
203 This visitor can be used to load a directory tree into a Tree::Simple hierarchy.
204 .IP "\fBCreateDirectoryTree\fR" 4
205 .IX Item "CreateDirectoryTree"
206 This visitor can be used to create a set of directories and files from a Tree::Simple object hierarchy.
207 .Sh "Conversion Visitors"
208 .IX Subsection "Conversion Visitors"
209 .IP "\fBFromNestedArray\fR" 4
210 .IX Item "FromNestedArray"
211 Given a tree constructed from nested arrays, this Visitor will create the equivalent Tree::Simple heirarchy.
212 .IP "\fBToNestedArray\fR" 4
213 .IX Item "ToNestedArray"
214 Given a Tree::Simple heirarchy, this Visitor will create the equivalent tree constructed from nested arrays.
215 .IP "\fBFromNestedHash\fR" 4
216 .IX Item "FromNestedHash"
217 Given a tree constructed from nested hashs, this Visitor will create the equivalent Tree::Simple heirarchy.
218 .IP "\fBToNestedHash\fR" 4
219 .IX Item "ToNestedHash"
220 Given a Tree::Simple heirarchy, this Visitor will create the equivalent tree constructed from nested hashes.
221 .Sh "Reflective Visitors"
222 .IX Subsection "Reflective Visitors"
223 .IP "\fBLoadClassHierarchy\fR" 4
224 .IX Item "LoadClassHierarchy"
225 Given a class name or instance, this Visitor will create a Tree::Simple hierarchy which models the classes inheritance heirarchy.
227 .IX Subsection "Misc. Visitors"
228 .IP "\fBGetAllDescendents\fR" 4
229 .IX Item "GetAllDescendents"
230 Given a Tree::Simple instance this Visitor will return all the descendents recursively on down the hierarchy.
233 This implements a multi-level sort of a Tree::Simple heirarchy.
234 .IP "\fBVariableDepthClone\fR" 4
235 .IX Item "VariableDepthClone"
236 A Visitor for cloning parts of Tree::Simple hierarchy
239 None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
241 .IX Header "CODE COVERAGE"
242 I use \fBDevel::Cover\fR to test the code coverage of my tests, below is the \fBDevel::Cover\fR report on this module test suite.
245 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\-
246 \& File stmt branch cond sub pod time total
247 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\-
248 \& Tree/Simple/VisitorFactory.pm 100.0 100.0 n/a 100.0 100.0 0.4 100.0
249 \& Tree/Simple/Visitor/BreadthFirstTraversal.pm 100.0 100.0 66.7 100.0 100.0 2.5 96.3
250 \& Tree/Simple/Visitor/PostOrderTraversal.pm 100.0 100.0 77.8 100.0 100.0 1.7 96.3
251 \& Tree/Simple/Visitor/PreOrderTraversal.pm 100.0 n/a 33.3 100.0 100.0 0.7 90.5
252 \& Tree/Simple/Visitor/CreateDirectoryTree.pm 100.0 85.7 86.7 100.0 100.0 3.4 95.8
253 \& Tree/Simple/Visitor/LoadClassHierarchy.pm 100.0 73.1 33.3 100.0 100.0 4.9 89.2
254 \& Tree/Simple/Visitor/LoadDirectoryTree.pm 100.0 89.3 85.2 100.0 100.0 26.1 94.7
255 \& Tree/Simple/Visitor/FindByNodeValue.pm 100.0 100.0 86.7 100.0 100.0 3.1 98.3
256 \& Tree/Simple/Visitor/FindByPath.pm 100.0 100.0 66.7 100.0 100.0 1.2 97.9
257 \& Tree/Simple/Visitor/FindByUID.pm 100.0 100.0 86.7 100.0 100.0 2.9 98.3
258 \& Tree/Simple/Visitor/GetAllDescendents.pm 100.0 100.0 77.8 100.0 100.0 2.3 97.1
259 \& Tree/Simple/Visitor/PathToRoot.pm 100.0 87.5 75.0 100.0 100.0 0.8 95.1
260 \& Tree/Simple/Visitor/Sort.pm 100.0 100.0 77.8 100.0 100.0 8.8 98.1
261 \& Tree/Simple/Visitor/ToNestedArray.pm 100.0 100.0 66.7 100.0 100.0 1.5 96.5
262 \& Tree/Simple/Visitor/ToNestedHash.pm 100.0 100.0 66.7 100.0 100.0 1.4 96.5
263 \& Tree/Simple/Visitor/FromNestedArray.pm 100.0 94.4 81.8 100.0 100.0 8.1 96.6
264 \& Tree/Simple/Visitor/FromNestedHash.pm 100.0 91.7 77.8 100.0 100.0 4.8 95.9
265 \& Tree/Simple/Visitor/VariableDepthClone.pm 100.0 100.0 66.7 100.0 100.0 25.5 97.3
266 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\-
267 \& Total 100.0 93.8 76.3 100.0 100.0 100.0 96.1
268 \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\-
271 .IX Header "SEE ALSO"
272 These Visitor classes are meant to work with Tree::Simple hierarchies, you should refer to that module for more information.
275 stevan little, <stevan@iinteractive.com>
276 .SH "COPYRIGHT AND LICENSE"
277 .IX Header "COPYRIGHT AND LICENSE"
278 Copyright 2004, 2005 by Infinity Interactive, Inc.
280 <http://www.iinteractive.com>
282 This library is free software; you can redistribute it and/or modify
283 it under the same terms as Perl itself.