xref: /trunk/main/autodoc/inc/ary/idl/i_service.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ARY_IDL_I_SERVICE_HXX
29 #define ARY_IDL_I_SERVICE_HXX
30 
31 // BASE CLASSES
32 #include <ary/idl/i_ce.hxx>
33 
34 // USED SERVICES
35 #include <ary/idl/i_comrela.hxx>
36 #include <ary/stdconstiter.hxx>
37 #include <ary/idl/ik_service.hxx>
38 
39 
40 
41 
42 namespace ary
43 {
44 namespace info
45 {
46     class CodeInformation;
47 }
48 namespace idl
49 {
50 namespace ifc_service
51 {
52     struct attr;
53 }
54 
55 
56 /** Represents an IDL service.
57 */
58 class Service : public CodeEntity
59 {
60   public:
61     enum E_ClassId { class_id = 2003 };     // See reposy.cxx
62 
63     // LIFECYCLE
64                         Service(
65                             const String &      i_sName,
66                             Ce_id               i_nOwner );
67                         ~Service();
68 
69     // INQUIRY
70     void                Get_SupportedInterfaces(
71                             Dyn_StdConstIterator<CommentedRelation> &
72                                                 o_rResult ) const;
73     void                Get_IncludedServices(
74                             Dyn_StdConstIterator<CommentedRelation> &
75                                                 o_rResult ) const;
76 
77     // ACCESS
78     void                Add_Property(
79                             Ce_id               i_nProperty );
80     void                AddRef_IncludedService(
81                             Type_id             i_nService,
82                             DYN doc::OldIdlDocu *
83                                                 pass_dpDocu );
84     void                AddRef_SupportedInterface(
85                             Type_id             i_nInterface,
86                             DYN doc::OldIdlDocu *
87                                                 pass_dpDocu );
88   private:
89     // Interface csv::ConstProcessorClient:
90     virtual void        do_Accept(
91                             csv::ProcessorIfc & io_processor ) const;
92     // Interface ary::Object:
93     virtual ClassId     get_AryClass() const;
94 
95     // Interface CodeEntity
96     virtual const String &  inq_LocalName() const;
97     virtual Ce_id           inq_NameRoom() const;
98     virtual Ce_id           inq_Owner() const;
99     virtual E_SightLevel    inq_SightLevel() const;
100 
101     // Locals
102     typedef std::vector< CommentedRelation >    RelationList;
103     typedef std::vector<Ce_id>                  PropertyList;
104     friend struct ifc_service::attr;
105 
106     // DATA
107     String              sName;
108     Ce_id               nOwner;
109 
110     RelationList        aIncludedServices;
111     RelationList        aSupportedInterfaces;
112     PropertyList        aProperties;
113 };
114 
115 
116 
117 
118 // IMPLEMENTATION
119 inline void
120 Service::Add_Property( Ce_id i_nProperty )
121     { aProperties.push_back(i_nProperty); }
122 
123 inline void
124 Service::AddRef_IncludedService( Type_id                    i_nService,
125                                  DYN doc::OldIdlDocu  *     pass_dpDocu )
126     { aIncludedServices.push_back( CommentedRelation(i_nService, pass_dpDocu) ); }
127 
128 inline void
129 Service::AddRef_SupportedInterface( Type_id                 i_nInterface,
130                                     DYN doc::OldIdlDocu *   pass_dpDocu )
131     { aSupportedInterfaces.push_back( CommentedRelation(i_nInterface, pass_dpDocu) ); }
132 
133 
134 
135 
136 
137 }   // namespace idl
138 }   // namespace ary
139 #endif
140