xref: /aoo4110/main/autodoc/inc/ary/idl/i_service.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_IDL_I_SERVICE_HXX
25 #define ARY_IDL_I_SERVICE_HXX
26 
27 // BASE CLASSES
28 #include <ary/idl/i_ce.hxx>
29 
30 // USED SERVICES
31 #include <ary/idl/i_comrela.hxx>
32 #include <ary/stdconstiter.hxx>
33 #include <ary/idl/ik_service.hxx>
34 
35 
36 
37 
38 namespace ary
39 {
40 namespace info
41 {
42     class CodeInformation;
43 }
44 namespace idl
45 {
46 namespace ifc_service
47 {
48     struct attr;
49 }
50 
51 
52 /** Represents an IDL service.
53 */
54 class Service : public CodeEntity
55 {
56   public:
57     enum E_ClassId { class_id = 2003 };     // See reposy.cxx
58 
59     // LIFECYCLE
60                         Service(
61                             const String &      i_sName,
62                             Ce_id               i_nOwner );
63                         ~Service();
64 
65     // INQUIRY
66     void                Get_SupportedInterfaces(
67                             Dyn_StdConstIterator<CommentedRelation> &
68                                                 o_rResult ) const;
69     void                Get_IncludedServices(
70                             Dyn_StdConstIterator<CommentedRelation> &
71                                                 o_rResult ) const;
72 
73     // ACCESS
74     void                Add_Property(
75                             Ce_id               i_nProperty );
76     void                AddRef_IncludedService(
77                             Type_id             i_nService,
78                             DYN doc::OldIdlDocu *
79                                                 pass_dpDocu );
80     void                AddRef_SupportedInterface(
81                             Type_id             i_nInterface,
82                             DYN doc::OldIdlDocu *
83                                                 pass_dpDocu );
84   private:
85     // Interface csv::ConstProcessorClient:
86     virtual void        do_Accept(
87                             csv::ProcessorIfc & io_processor ) const;
88     // Interface ary::Object:
89     virtual ClassId     get_AryClass() const;
90 
91     // Interface CodeEntity
92     virtual const String &  inq_LocalName() const;
93     virtual Ce_id           inq_NameRoom() const;
94     virtual Ce_id           inq_Owner() const;
95     virtual E_SightLevel    inq_SightLevel() const;
96 
97     // Locals
98     typedef std::vector< CommentedRelation >    RelationList;
99     typedef std::vector<Ce_id>                  PropertyList;
100     friend struct ifc_service::attr;
101 
102     // DATA
103     String              sName;
104     Ce_id               nOwner;
105 
106     RelationList        aIncludedServices;
107     RelationList        aSupportedInterfaces;
108     PropertyList        aProperties;
109 };
110 
111 
112 
113 
114 // IMPLEMENTATION
115 inline void
Add_Property(Ce_id i_nProperty)116 Service::Add_Property( Ce_id i_nProperty )
117     { aProperties.push_back(i_nProperty); }
118 
119 inline void
AddRef_IncludedService(Type_id i_nService,DYN doc::OldIdlDocu * pass_dpDocu)120 Service::AddRef_IncludedService( Type_id                    i_nService,
121                                  DYN doc::OldIdlDocu  *     pass_dpDocu )
122     { aIncludedServices.push_back( CommentedRelation(i_nService, pass_dpDocu) ); }
123 
124 inline void
AddRef_SupportedInterface(Type_id i_nInterface,DYN doc::OldIdlDocu * pass_dpDocu)125 Service::AddRef_SupportedInterface( Type_id                 i_nInterface,
126                                     DYN doc::OldIdlDocu *   pass_dpDocu )
127     { aSupportedInterfaces.push_back( CommentedRelation(i_nInterface, pass_dpDocu) ); }
128 
129 
130 
131 
132 
133 }   // namespace idl
134 }   // namespace ary
135 #endif
136