Bump for 3.6-28
[LibreOffice.git] / autodoc / source / ary / idl / i_service.cxx
blob0aa16b9e32803388a2666b0b6e1653018c3897af
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <precomp.h>
30 #include <ary/idl/i_service.hxx>
33 // NOT FULLY DECLARED SERVICES
34 #include <cosv/tpl/processor.hxx>
35 #include <ary/idl/ik_service.hxx>
36 #include <ary/doc/d_oldidldocu.hxx>
37 #include <sci_impl.hxx>
38 #include "i2s_calculator.hxx"
41 namespace ary
43 namespace idl
46 Service::Service( const String & i_sName,
47 Ce_id i_nOwner )
48 : sName(i_sName),
49 nOwner(i_nOwner),
50 aIncludedServices(),
51 aSupportedInterfaces(),
52 aProperties()
56 Service::~Service()
58 for ( RelationList::iterator it = aIncludedServices.begin();
59 it != aIncludedServices.end();
60 ++it )
62 delete (*it).Info();
65 for ( RelationList::iterator it = aSupportedInterfaces.begin();
66 it != aSupportedInterfaces.end();
67 ++it )
69 delete (*it).Info();
73 void
74 Service::Get_SupportedInterfaces( Dyn_StdConstIterator<CommentedRelation> & o_rResult ) const
76 o_rResult = new SCI_Vector<CommentedRelation>(aSupportedInterfaces);
79 void
80 Service::Get_IncludedServices( Dyn_StdConstIterator<CommentedRelation> & o_rResult ) const
82 o_rResult = new SCI_Vector<CommentedRelation>(aIncludedServices);
85 void
86 Service::do_Accept( csv::ProcessorIfc & io_processor ) const
88 csv::CheckedCall(io_processor, *this);
91 ClassId
92 Service::get_AryClass() const
94 return class_id;
97 const String &
98 Service::inq_LocalName() const
100 return sName;
103 Ce_id
104 Service::inq_NameRoom() const
106 return nOwner;
109 Ce_id
110 Service::inq_Owner() const
112 return nOwner;
115 E_SightLevel
116 Service::inq_SightLevel() const
118 return sl_File;
122 namespace ifc_service
125 inline const Service &
126 service_cast( const CodeEntity & i_ce )
128 csv_assert( i_ce.AryClass() == Service::class_id );
129 return static_cast< const Service& >(i_ce);
132 void
133 attr::Get_IncludedServices( Dyn_StdConstIterator<CommentedRelation> & o_result,
134 const CodeEntity & i_ce )
136 o_result = new SCI_Vector<CommentedRelation>( service_cast(i_ce).aIncludedServices );
139 void
140 attr::Get_ExportedInterfaces( Dyn_StdConstIterator<CommentedRelation> & o_result,
141 const CodeEntity & i_ce )
143 o_result = new SCI_Vector<CommentedRelation>( service_cast(i_ce).aSupportedInterfaces );
146 void
147 attr::Get_Properties( Dyn_CeIterator & o_result,
148 const CodeEntity & i_ce )
150 o_result = new SCI_Vector<Ce_id>( service_cast(i_ce).aProperties );
153 void
154 xref::Get_IncludingServices( Dyn_CeIterator & o_result,
155 const CodeEntity & i_ce )
157 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(service_2s_IncludingServices));
160 void
161 xref::Get_InstantiatingSingletons( Dyn_CeIterator & o_result,
162 const CodeEntity & i_ce )
164 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(service_2s_InstantiatingSingletons));
168 } // namespace ifc_service
171 } // namespace idl
172 } // namespace ary
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */