1*1c78a5d6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir *
3*1c78a5d6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*1c78a5d6SAndrew Rist * or more contributor license agreements. See the NOTICE file
5*1c78a5d6SAndrew Rist * distributed with this work for additional information
6*1c78a5d6SAndrew Rist * regarding copyright ownership. The ASF licenses this file
7*1c78a5d6SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*1c78a5d6SAndrew Rist * "License"); you may not use this file except in compliance
9*1c78a5d6SAndrew Rist * with the License. You may obtain a copy of the License at
10*1c78a5d6SAndrew Rist *
11*1c78a5d6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*1c78a5d6SAndrew Rist *
13*1c78a5d6SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*1c78a5d6SAndrew Rist * software distributed under the License is distributed on an
15*1c78a5d6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1c78a5d6SAndrew Rist * KIND, either express or implied. See the License for the
17*1c78a5d6SAndrew Rist * specific language governing permissions and limitations
18*1c78a5d6SAndrew Rist * under the License.
19*1c78a5d6SAndrew Rist *
20*1c78a5d6SAndrew Rist *************************************************************/
21*1c78a5d6SAndrew Rist
22*1c78a5d6SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir #ifndef ARY_IDL_I_PROPERTY_HXX
25cdf0e10cSrcweir #define ARY_IDL_I_PROPERTY_HXX
26cdf0e10cSrcweir
27cdf0e10cSrcweir // BASE CLASSES
28cdf0e10cSrcweir #include <ary/idl/i_ce.hxx>
29cdf0e10cSrcweir
30cdf0e10cSrcweir
31cdf0e10cSrcweir
32cdf0e10cSrcweir
33cdf0e10cSrcweir namespace ary
34cdf0e10cSrcweir {
35cdf0e10cSrcweir namespace idl
36cdf0e10cSrcweir {
37cdf0e10cSrcweir namespace ifc_property
38cdf0e10cSrcweir {
39cdf0e10cSrcweir struct attr;
40cdf0e10cSrcweir }
41cdf0e10cSrcweir
42cdf0e10cSrcweir
43cdf0e10cSrcweir /** Represents an IDL property.
44cdf0e10cSrcweir */
45cdf0e10cSrcweir class Property : public CodeEntity
46cdf0e10cSrcweir {
47cdf0e10cSrcweir public:
48cdf0e10cSrcweir enum E_ClassId { class_id = 2004 };
49cdf0e10cSrcweir
50cdf0e10cSrcweir class Stereotypes
51cdf0e10cSrcweir {
52cdf0e10cSrcweir public:
53cdf0e10cSrcweir enum E_Flags
54cdf0e10cSrcweir {
55cdf0e10cSrcweir readonly = 1,
56cdf0e10cSrcweir bound = 2,
57cdf0e10cSrcweir constrained = 4,
58cdf0e10cSrcweir maybeambiguous = 8,
59cdf0e10cSrcweir maybedefault = 16,
60cdf0e10cSrcweir maybevoid = 32,
61cdf0e10cSrcweir removable = 64,
62cdf0e10cSrcweir transient = 128,
63cdf0e10cSrcweir s_MAX
64cdf0e10cSrcweir };
Stereotypes()65cdf0e10cSrcweir Stereotypes() : nFlags(0) {}
66cdf0e10cSrcweir
HasAny() const67cdf0e10cSrcweir bool HasAny() const { return nFlags != 0; }
IsReadOnly() const68cdf0e10cSrcweir bool IsReadOnly() const { return (nFlags & UINT32(readonly)) != 0; }
IsBound() const69cdf0e10cSrcweir bool IsBound() const { return (nFlags & UINT32(bound)) != 0; }
IsConstrained() const70cdf0e10cSrcweir bool IsConstrained() const
71cdf0e10cSrcweir { return (nFlags & UINT32(constrained)) != 0; }
IsMayBeAmbiguous() const72cdf0e10cSrcweir bool IsMayBeAmbiguous() const
73cdf0e10cSrcweir { return (nFlags & UINT32(maybeambiguous)) != 0; }
IsMayBeDefault() const74cdf0e10cSrcweir bool IsMayBeDefault() const
75cdf0e10cSrcweir { return (nFlags & UINT32(maybedefault)) != 0; }
IsMayBeVoid() const76cdf0e10cSrcweir bool IsMayBeVoid() const { return (nFlags & UINT32(maybevoid)) != 0; }
IsRemovable() const77cdf0e10cSrcweir bool IsRemovable() const { return (nFlags & UINT32(removable)) != 0; }
IsTransient() const78cdf0e10cSrcweir bool IsTransient() const { return (nFlags & UINT32(transient)) != 0; }
79cdf0e10cSrcweir
Set_Flag(E_Flags i_flag)80cdf0e10cSrcweir void Set_Flag(
81cdf0e10cSrcweir E_Flags i_flag )
82cdf0e10cSrcweir { nFlags |= UINT32(i_flag); }
83cdf0e10cSrcweir private:
84cdf0e10cSrcweir // DATA
85cdf0e10cSrcweir UINT32 nFlags;
86cdf0e10cSrcweir };
87cdf0e10cSrcweir
88cdf0e10cSrcweir
89cdf0e10cSrcweir // LIFECYCLE
90cdf0e10cSrcweir Property(
91cdf0e10cSrcweir const String & i_sName,
92cdf0e10cSrcweir Ce_id i_nService,
93cdf0e10cSrcweir Ce_id i_nModule,
94cdf0e10cSrcweir Type_id i_nType,
95cdf0e10cSrcweir Stereotypes i_stereotypes );
96cdf0e10cSrcweir ~Property();
97cdf0e10cSrcweir // INQUIRY
98cdf0e10cSrcweir Type_id Type() const;
99cdf0e10cSrcweir
100cdf0e10cSrcweir private:
101cdf0e10cSrcweir // Interface csv::ConstProcessorClient:
102cdf0e10cSrcweir virtual void do_Accept(
103cdf0e10cSrcweir csv::ProcessorIfc & io_processor ) const;
104cdf0e10cSrcweir // Interface ary::Object:
105cdf0e10cSrcweir virtual ClassId get_AryClass() const;
106cdf0e10cSrcweir
107cdf0e10cSrcweir // Interface CodeEntity
108cdf0e10cSrcweir virtual const String & inq_LocalName() const;
109cdf0e10cSrcweir virtual Ce_id inq_NameRoom() const;
110cdf0e10cSrcweir virtual Ce_id inq_Owner() const;
111cdf0e10cSrcweir virtual E_SightLevel inq_SightLevel() const;
112cdf0e10cSrcweir
113cdf0e10cSrcweir friend struct ifc_property::attr;
114cdf0e10cSrcweir
115cdf0e10cSrcweir // DATA
116cdf0e10cSrcweir String sName;
117cdf0e10cSrcweir Ce_id nOwner;
118cdf0e10cSrcweir Ce_id nNameRoom;
119cdf0e10cSrcweir
120cdf0e10cSrcweir Type_id nType;
121cdf0e10cSrcweir Stereotypes aStereotypes;
122cdf0e10cSrcweir };
123cdf0e10cSrcweir
124cdf0e10cSrcweir
125cdf0e10cSrcweir
126cdf0e10cSrcweir
127cdf0e10cSrcweir // IMPLEMENTATION
128cdf0e10cSrcweir inline Type_id
Type() const129cdf0e10cSrcweir Property::Type() const
130cdf0e10cSrcweir {
131cdf0e10cSrcweir return nType;
132cdf0e10cSrcweir }
133cdf0e10cSrcweir
134cdf0e10cSrcweir
135cdf0e10cSrcweir
136cdf0e10cSrcweir
137cdf0e10cSrcweir } // namespace idl
138cdf0e10cSrcweir } // namespace ary
139cdf0e10cSrcweir #endif
140