xref: /trunk/main/autodoc/inc/ary/idl/i_property.hxx (revision 1c78a5d6)
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_IDL_I_PROPERTY_HXX
25 #define ARY_IDL_I_PROPERTY_HXX
26 
27 // BASE CLASSES
28 #include <ary/idl/i_ce.hxx>
29 
30 
31 
32 
33 namespace ary
34 {
35 namespace idl
36 {
37 namespace ifc_property
38 {
39     struct attr;
40 }
41 
42 
43 /** Represents an IDL property.
44 */
45 class Property : public CodeEntity
46 {
47   public:
48     enum E_ClassId { class_id = 2004 };
49 
50     class Stereotypes
51     {
52       public:
53         enum E_Flags
54         {
55             readonly = 1,
56             bound = 2,
57             constrained = 4,
58             maybeambiguous = 8,
59             maybedefault = 16,
60             maybevoid = 32,
61             removable = 64,
62             transient = 128,
63             s_MAX
64         };
Stereotypes()65                             Stereotypes()       : nFlags(0) {}
66 
HasAny() const67         bool                HasAny() const      { return nFlags != 0; }
IsReadOnly() const68         bool                IsReadOnly() const  { return (nFlags & UINT32(readonly)) != 0; }
IsBound() const69         bool                IsBound() const     { return (nFlags & UINT32(bound)) != 0; }
IsConstrained() const70         bool                IsConstrained() const
71                                                 { return (nFlags & UINT32(constrained)) != 0; }
IsMayBeAmbiguous() const72         bool                IsMayBeAmbiguous() const
73                                                 { return (nFlags & UINT32(maybeambiguous)) != 0; }
IsMayBeDefault() const74         bool                IsMayBeDefault() const
75                                                 { return (nFlags & UINT32(maybedefault)) != 0; }
IsMayBeVoid() const76         bool                IsMayBeVoid() const { return (nFlags & UINT32(maybevoid)) != 0; }
IsRemovable() const77         bool                IsRemovable() const { return (nFlags & UINT32(removable)) != 0; }
IsTransient() const78         bool                IsTransient() const { return (nFlags & UINT32(transient)) != 0; }
79 
Set_Flag(E_Flags i_flag)80         void                Set_Flag(
81                                 E_Flags         i_flag )
82                                                 { nFlags |= UINT32(i_flag); }
83       private:
84         // DATA
85         UINT32              nFlags;
86     };
87 
88 
89     // LIFECYCLE
90                         Property(
91                             const String &      i_sName,
92                             Ce_id               i_nService,
93                             Ce_id               i_nModule,
94                             Type_id             i_nType,
95                             Stereotypes         i_stereotypes );
96                         ~Property();
97     // INQUIRY
98     Type_id             Type() const;
99 
100   private:
101     // Interface csv::ConstProcessorClient:
102     virtual void        do_Accept(
103                             csv::ProcessorIfc & io_processor ) const;
104     // Interface ary::Object:
105     virtual ClassId     get_AryClass() const;
106 
107     // Interface CodeEntity
108     virtual const String &  inq_LocalName() const;
109     virtual Ce_id           inq_NameRoom() const;
110     virtual Ce_id           inq_Owner() const;
111     virtual E_SightLevel    inq_SightLevel() const;
112 
113     friend struct ifc_property::attr;
114 
115     // DATA
116     String              sName;
117     Ce_id               nOwner;
118     Ce_id               nNameRoom;
119 
120     Type_id             nType;
121     Stereotypes         aStereotypes;
122 };
123 
124 
125 
126 
127 // IMPLEMENTATION
128 inline Type_id
Type() const129 Property::Type() const
130 {
131     return nType;
132 }
133 
134 
135 
136 
137 }   // namespace idl
138 }   // namespace ary
139 #endif
140