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 ARY_DOC_D_PARAMETER_HXX
25 #define ARY_DOC_D_PARAMETER_HXX
26 
27 // USED SERVICES
28 	// BASE CLASSES
29 #include <ary/doc/d_node.hxx>
30 
31 namespace ary
32 {
33 namespace doc
34 {
35 
36 
37 /** Documentation unit with Parameter.
38 */
39 template <class T>
40 class Parametrized : public Node
41 {
42   public:
43 	// LIFECYCLE
44 	explicit    		Parametrized(
45 	                        nodetype::id        i_id,
46                             T                   i_Parameter );
47 	virtual				~Parametrized();
48 
49     // INQUIRY
50     const HyperText &   Doc() const;
51     const T &           Parameter() const;
52 
53     // ACESS
54     HyperText &         Doc();
55     void                Set_Parameter(
56                             const T &           i_param );
57   private:
58     // Interface csv::ConstProcessorClient:
59     virtual void        do_Accept(
60                             csv::ProcessorIfc & io_processor ) const;
61     // DATA
62     HyperText           aDoc;
63     T                   aParameter;
64 };
65 
66 
67 
68 
69 // IMPLEMENTATION
70 template <class T>
Parametrized(nodetype::id i_id,T i_Parameter)71 Parametrized<T>::Parametrized( nodetype::id     i_id,
72                                T                i_Parameter )
73     :   Node(i_id),
74         aDoc(),
75         aParameter(i_Parameter)
76 {
77 }
78 
79 template <class T>
~Parametrized()80 Parametrized<T>::~Parametrized()
81 {
82 }
83 
84 template <class T>
85 const HyperText &
Doc() const86 Parametrized<T>::Doc() const
87 {
88     return aDoc;
89 }
90 
91 template <class T>
92 const T &
Parameter() const93 Parametrized<T>::Parameter() const
94 {
95     return aParameter;
96 }
97 
98 template <class T>
99 HyperText &
Doc()100 Parametrized<T>::Doc()
101 {
102     return aDoc;
103 }
104 
105 template <class T>
106 inline void
Set_Parameter(const T & i_param)107 Parametrized<T>::Set_Parameter(const T & i_param)
108 {
109     aParameter = i_param;
110 }
111 
112 
113 
114 
115 }   // namespace doc
116 }   // namespace ary
117 #endif
118