1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef ADC_DISPLAY_CRE_LINK_HXX
25 #define ADC_DISPLAY_CRE_LINK_HXX
26 
27 
28 // USED SERVICES
29 	// BASE CLASSES
30 #include <cosv/tpl/processor.hxx>
31 	// COMPONENTS
32 	// PARAMETERS
33 
34 namespace ary
35 {
36 namespace cpp
37 {
38  	class CodeEntity;
39     class Namespace;
40     class Class;
41     class Enum;
42     class Typedef;
43     class Function;
44     class Variable;
45     class EnumValue;
46     class Define;
47     class Macro;
48 }
49 }
50 
51 
52 class OuputPage_Environment;
53 
54 
55 
56 /** Displays links to ->{ary::cpp::CodeEntity CodeEntites}.
57 */
58 class LinkCreator : public csv::ProcessorIfc,
59                     public csv::ConstProcessor<ary::cpp::Namespace>,
60                     public csv::ConstProcessor<ary::cpp::Class>,
61                     public csv::ConstProcessor<ary::cpp::Enum>,
62                     public csv::ConstProcessor<ary::cpp::Typedef>,
63                     public csv::ConstProcessor<ary::cpp::Function>,
64                     public csv::ConstProcessor<ary::cpp::Variable>,
65                     public csv::ConstProcessor<ary::cpp::EnumValue>,
66                     public csv::ConstProcessor<ary::cpp::Define>,
67                     public csv::ConstProcessor<ary::cpp::Macro>
68 {
69   public:
70                         LinkCreator(
71                             char *              o_rOutput,
72                             uintt               i_nOutputSize );
73                         ~LinkCreator();
74 
75 
76     void                SetEnv(
77                             const OuputPage_Environment &
78                                                 i_rEnv );
79   private:
80     void                Create_PrePath(
81                             const ary::cpp::CodeEntity &
82                                                 i_rData );
83     // Interface csv::ConstProcessor<>
84     virtual void        do_Process(
85                             const ary::cpp::Namespace &
86                                                 i_rData );
87     virtual void        do_Process(
88                             const ary::cpp::Class &
89                                                 i_rData );
90     virtual void        do_Process(
91                             const ary::cpp::Enum &
92                                                 i_rData );
93     virtual void        do_Process(
94                             const ary::cpp::Typedef &
95                                                 i_rData );
96     virtual void        do_Process(
97                             const ary::cpp::Function &
98                                                 i_rData );
99 	virtual void        do_Process(
100                             const ary::cpp::Variable &
101                                                 i_rData );
102     virtual void        do_Process(
103                             const ary::cpp::EnumValue &
104                                                 i_rData );
105 	virtual void        do_Process(
106 							const ary::cpp::Define &
107                                                 i_rData );
108 	virtual void        do_Process(
109 							const ary::cpp::Macro &
110                                                 i_rData );
111 	// DATA
112     char *              pOut;
113     uintt               nOutMaxSize;
114     const OuputPage_Environment *
115                         pEnv;
116 };
117 
118 
119 
120 
121 // IMPLEMENTATION
122 inline void
SetEnv(const OuputPage_Environment & i_rEnv)123 LinkCreator::SetEnv( const OuputPage_Environment & i_rEnv )
124     { pEnv = &i_rEnv; }
125 
126 
127 
128 
129 #endif
130