1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef ARY_IDL_I_FUNCTION_HXX
21 #define ARY_IDL_I_FUNCTION_HXX
24 #include <ary/idl/i_ce.hxx>
27 #include <ary/idl/i_param.hxx>
28 #include <ary/idl/ik_function.hxx>
29 #include <ary/stdconstiter.hxx>
40 /** Represents an IDL function.
42 Special case constructor:
43 Constructors have return type "0".
45 class Function
: public CodeEntity
48 enum E_ClassId
{ class_id
= 2002 };
50 typedef std::vector
< Parameter
> ParamList
;
51 typedef std::vector
< Type_id
> ExceptionList
;
56 const String
& i_sName
,
59 Type_id i_nReturnType
,
63 const String
& i_sName
,
70 const String
& i_sName
,
74 /// The function's parameter list ends with the ellipse "..." .
77 Type_id i_nException
);
80 Type_id
ReturnType() const;
81 const ParamList
& Parameters() const { return aParameters
; }
83 Exceptions() const { return aExceptions
; }
84 bool IsOneway() const;
85 bool HasEllipse() const { return bEllipse
; }
88 // Interface csv::ConstProcessorClient:
89 virtual void do_Accept(
90 csv::ProcessorIfc
& io_processor
) const;
91 // Interface ary::Object:
92 virtual ClassId
get_AryClass() const;
94 // Interface CodeEntity
95 virtual const String
& inq_LocalName() const;
96 virtual Ce_id
inq_NameRoom() const;
97 virtual Ce_id
inq_Owner() const;
98 virtual E_SightLevel
inq_SightLevel() const;
101 friend struct ifc_function::attr
;
109 ParamList aParameters
;
110 ExceptionList aExceptions
;
120 Function::Add_Parameter( const String
& i_sName
,
122 E_ParameterDirection i_eDirection
)
124 aParameters
.push_back( Parameter(i_sName
,i_nType
,i_eDirection
) );
128 Function::Set_Ellipse()
134 Function::Add_Exception( Type_id i_nException
)
136 aExceptions
.push_back(i_nException
);
140 Function::ReturnType() const
141 { return nReturnType
; }
144 Function::IsOneway() const
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */