xref: /aoo41x/main/autodoc/inc/ary/idl/i_struct.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_STRUCT_HXX
25 #define ARY_IDL_I_STRUCT_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_struct
38 {
39     struct attr;
40 }
41 
42 
43 /** Represents an IDL struct.
44 */
45 class Struct : public CodeEntity
46 {
47   public:
48     enum E_ClassId { class_id = 2008 };
49 
50     // LIFECYCLE
51                         Struct(
52                             const String &      i_sName,
53                             Ce_id               i_nOwner,
54                             Type_id             i_nBase,
55                             const String &      i_sTemplateParameter,
56                             Type_id             i_nTemplateParameterType );
57                         ~Struct();
58     // INQUIRY
59     Type_id             Base() const;
60     String              TemplateParameter() const;
61     Type_id             TemplateParameterType() const;
62 
63     // ACCESS
64     void                Add_Member(
65                             Ce_id               i_nMember );
66   private:
67     // Interface csv::ConstProcessorClient:
68     virtual void        do_Accept(
69                             csv::ProcessorIfc & io_processor ) const;
70     // Interface ary::Object:
71     virtual ClassId     get_AryClass() const;
72 
73     // Interface CodeEntity
74     virtual const String &  inq_LocalName() const;
75     virtual Ce_id           inq_NameRoom() const;
76     virtual Ce_id           inq_Owner() const;
77     virtual E_SightLevel    inq_SightLevel() const;
78 
79     // Locals
80     typedef std::vector<Ce_id>     ElementList;
81     friend struct ifc_struct::attr;
82 
83     // DATA
84     String              sName;
85     Ce_id               nOwner;
86 
87     Type_id             nBase;
88     String              sTemplateParameter;
89     Type_id             nTemplateParameterType;
90     ElementList         aElements;
91 };
92 
93 
94 
95 
96 // IMPLEMENTATION
97 inline Type_id
Base() const98 Struct::Base() const
99 {
100     return nBase;
101 }
102 
103 inline String
TemplateParameter() const104 Struct::TemplateParameter() const
105 {
106     return sTemplateParameter;
107 }
108 
109 inline Type_id
TemplateParameterType() const110 Struct::TemplateParameterType() const
111 {
112     return nTemplateParameterType;
113 }
114 
115 inline void
Add_Member(Ce_id i_nMember)116 Struct::Add_Member( Ce_id i_nMember )
117 {
118     aElements.push_back(i_nMember);
119 }
120 
121 
122 
123 
124 }   // namespace idl
125 }   // namespace ary
126 #endif
127