Update ooo320-m1
[ooovba.git] / autodoc / source / ary / idl / i_function.cxx
blobea33275d1e9881873f3682f642a860f9559dc4fe
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i_function.cxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
31 #include <precomp.h>
32 #include <ary/idl/i_function.hxx>
35 // NOT FULLY DECLARED SERVICES
36 #include <cosv/tpl/processor.hxx>
37 #include <sci_impl.hxx>
41 namespace ary
43 namespace idl
46 Function::Function( const String & i_sName,
47 Ce_id i_nOwner,
48 Ce_id i_nNameRoom,
49 Type_id i_nReturnType,
50 bool i_bOneWay )
51 : sName(i_sName),
52 nOwner(i_nOwner),
53 nNameRoom(i_nNameRoom),
54 nReturnType(i_nReturnType),
55 aParameters(),
56 aExceptions(),
57 bOneWay(i_bOneWay),
58 bEllipse(false)
62 Function::Function( const String & i_sName,
63 Ce_id i_nOwner,
64 Ce_id i_nNameRoom )
65 : sName(i_sName),
66 nOwner(i_nOwner),
67 nNameRoom(i_nNameRoom),
68 nReturnType(0),
69 aParameters(),
70 aExceptions(),
71 bOneWay(false),
72 bEllipse(false)
76 Function::~Function()
80 void
81 Function::do_Accept( csv::ProcessorIfc & io_processor ) const
83 csv::CheckedCall(io_processor, *this);
86 ClassId
87 Function::get_AryClass() const
89 return class_id;
92 const String &
93 Function::inq_LocalName() const
95 return sName;
98 Ce_id
99 Function::inq_NameRoom() const
101 return nNameRoom;
104 Ce_id
105 Function::inq_Owner() const
107 return nOwner;
110 E_SightLevel
111 Function::inq_SightLevel() const
113 return sl_Member;
117 namespace ifc_function
120 inline const Function &
121 function_cast( const CodeEntity & i_ce )
123 csv_assert( i_ce.AryClass() == Function::class_id );
124 return static_cast< const Function& >(i_ce);
127 Type_id
128 attr::ReturnType( const CodeEntity & i_ce )
130 return function_cast(i_ce).nReturnType;
133 bool
134 attr::IsOneway( const CodeEntity & i_ce )
136 return function_cast(i_ce).bOneWay;
139 bool
140 attr::HasEllipse( const CodeEntity & i_ce )
142 return function_cast(i_ce).bEllipse;
145 void
146 attr::Get_Parameters( Dyn_StdConstIterator<ary::idl::Parameter> & o_result,
147 const CodeEntity & i_ce )
149 o_result
150 = new SCI_Vector<Parameter>( function_cast(i_ce).aParameters );
153 void
154 attr::Get_Exceptions( Dyn_TypeIterator & o_result,
155 const CodeEntity & i_ce )
157 o_result
158 = new SCI_Vector<Type_id>( function_cast(i_ce).aExceptions );
165 } // namespace ifc_function
167 } // namespace idl
168 } // namespace ary