xref: /aoo41x/main/autodoc/inc/ary/idl/i_attribute.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_ATTRIBUTE_HXX
25 #define ARY_IDL_I_ATTRIBUTE_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_attribute
38 {
39     struct attr;
40 }
41 
42 
43 
44 
45 /** @resp
46     Represents an IDL property.
47 */
48 class Attribute : public CodeEntity
49 {
50   public:
51     enum E_ClassId { class_id = 2014 };
52 
53     // LIFECYCLE
54                         Attribute(
55                             const String &      i_sName,
56                             Ce_id               i_nInterface,
57                             Ce_id               i_nModule,
58                             Type_id             i_nType,
59                             bool                i_bReadonly,
60                             bool                i_bBound );
61                         ~Attribute();
62     // OPERATIONS
63     void                Add_GetException(
64                             Type_id             i_nException );
65     void                Add_SetException(
66                             Type_id             i_nException );
67 
68     // INQUIRY
69     Type_id             Type() const;
70     bool                IsReadonly() const;
71     bool                IsBound() const;
72 
73   private:
74     // Interface csv::ConstProcessorClient:
75     virtual void        do_Accept(
76                             csv::ProcessorIfc & io_processor ) const;
77     // Interface ary::Object
78     virtual ClassId     get_AryClass() const;
79 
80     // Interface CodeEntity
81     virtual const String &  inq_LocalName() const;
82     virtual Ce_id           inq_NameRoom() const;
83     virtual Ce_id           inq_Owner() const;
84     virtual E_SightLevel    inq_SightLevel() const;
85 
86     // Local
87     typedef std::vector< Type_id >      ExceptionList;
88     friend struct ifc_attribute::attr;
89 
90     // DATA
91     String              sName;
92     Ce_id               nOwner;
93     Ce_id               nNameRoom;
94 
95     Type_id             nType;
96     ExceptionList       aGetExceptions;
97     ExceptionList       aSetExceptions;
98     bool                bReadonly;
99     bool                bBound;
100 };
101 
102 
103 
104 
105 // IMPLEMENTATION
106 inline void
Add_GetException(Type_id i_nException)107 Attribute::Add_GetException( Type_id i_nException )
108     { aGetExceptions.push_back(i_nException); }
109 
110 inline void
Add_SetException(Type_id i_nException)111 Attribute::Add_SetException( Type_id i_nException )
112     { aSetExceptions.push_back(i_nException); }
113 
114 inline Type_id
Type() const115 Attribute::Type() const
116     { return nType; }
117 
118 inline bool
IsReadonly() const119 Attribute::IsReadonly() const
120     { return bReadonly; }
121 
122 inline bool
IsBound() const123 Attribute::IsBound() const
124     { return bBound; }
125 
126 
127 
128 
129 }   // namespace idl
130 }   // namespace ary
131 #endif
132