xref: /aoo4110/main/autodoc/inc/ary/doc/d_boolean.hxx (revision b1cdbd2c)
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_BOOLEAN_HXX
25 #define ARY_DOC_D_BOOLEAN_HXX
26 
27 // BASE CLASSES
28 #include <ary/doc/d_node.hxx>
29 
30 // USED SERVICES
31 
32 
33 
34 
35 namespace ary
36 {
37 namespace doc
38 {
39 
40 
41 /** Repesents a boolean documentation item like "optional" or "not optional".
42 */
43 class Boolean : public Node
44 {
45   public:
46 	// LIFECYCLE
47 	explicit    		Boolean(
48 						    nodetype::id        i_type );
49 	virtual				~Boolean();
50 
51     // OPERATIONS
52     void                Set(
53                             bool                i_b );
54     // INQUIRY
55     bool                IsTrue() const;
56 
57   private:
58     // Interface csv::ConstProcessorClient:
59     virtual void        do_Accept(
60                             csv::ProcessorIfc & io_processor ) const;
61     // DATA
62 	bool				b;
63 };
64 
65 
66 
67 
68 // IMPLEMENTATION
69 inline
Boolean(nodetype::id i_type)70 Boolean::Boolean(nodetype::id i_type)
71     :   Node(i_type),
72         b(false)
73 {
74 }
75 
76 inline bool
IsTrue() const77 Boolean::IsTrue() const
78 {
79     return b;
80 }
81 
82 inline void
Set(bool i_b)83 Boolean::Set( bool i_b )
84 {
85     b = i_b;
86 }
87 
88 
89 
90 }   // namespace doc
91 }   // namespace ary
92 #endif
93