1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i_service.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #include <ary/idl/i_service.hxx>
35 // NOT FULLY DECLARED SERVICES
36 #include <cosv/tpl/processor.hxx>
37 #include <ary/idl/ik_service.hxx>
38 #include <ary/doc/d_oldidldocu.hxx>
39 #include <sci_impl.hxx>
40 #include "i2s_calculator.hxx"
48 Service::Service( const String
& i_sName
,
53 aSupportedInterfaces(),
60 for ( RelationList::iterator it
= aIncludedServices
.begin();
61 it
!= aIncludedServices
.end();
67 for ( RelationList::iterator it
= aSupportedInterfaces
.begin();
68 it
!= aSupportedInterfaces
.end();
76 Service::Get_SupportedInterfaces( Dyn_StdConstIterator
<CommentedRelation
> & o_rResult
) const
78 o_rResult
= new SCI_Vector
<CommentedRelation
>(aSupportedInterfaces
);
82 Service::Get_IncludedServices( Dyn_StdConstIterator
<CommentedRelation
> & o_rResult
) const
84 o_rResult
= new SCI_Vector
<CommentedRelation
>(aIncludedServices
);
88 Service::do_Accept( csv::ProcessorIfc
& io_processor
) const
90 csv::CheckedCall(io_processor
, *this);
94 Service::get_AryClass() const
100 Service::inq_LocalName() const
106 Service::inq_NameRoom() const
112 Service::inq_Owner() const
118 Service::inq_SightLevel() const
124 namespace ifc_service
127 inline const Service
&
128 service_cast( const CodeEntity
& i_ce
)
130 csv_assert( i_ce
.AryClass() == Service::class_id
);
131 return static_cast< const Service
& >(i_ce
);
135 attr::Get_IncludedServices( Dyn_StdConstIterator
<CommentedRelation
> & o_result
,
136 const CodeEntity
& i_ce
)
138 o_result
= new SCI_Vector
<CommentedRelation
>( service_cast(i_ce
).aIncludedServices
);
142 attr::Get_ExportedInterfaces( Dyn_StdConstIterator
<CommentedRelation
> & o_result
,
143 const CodeEntity
& i_ce
)
145 o_result
= new SCI_Vector
<CommentedRelation
>( service_cast(i_ce
).aSupportedInterfaces
);
149 attr::Get_Properties( Dyn_CeIterator
& o_result
,
150 const CodeEntity
& i_ce
)
152 o_result
= new SCI_Vector
<Ce_id
>( service_cast(i_ce
).aProperties
);
156 xref::Get_IncludingServices( Dyn_CeIterator
& o_result
,
157 const CodeEntity
& i_ce
)
159 o_result
= new SCI_Vector
<Ce_id
>(i_ce
.Secondaries().List(service_2s_IncludingServices
));
163 xref::Get_InstantiatingSingletons( Dyn_CeIterator
& o_result
,
164 const CodeEntity
& i_ce
)
166 o_result
= new SCI_Vector
<Ce_id
>(i_ce
.Secondaries().List(service_2s_InstantiatingSingletons
));
170 } // namespace ifc_service