xref: /aoo41x/main/autodoc/inc/ary/cpp/c_funct.hxx (revision 1c78a5d6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef ARY_CPP_C_FUNCT_HXX
25 #define ARY_CPP_C_FUNCT_HXX
26 
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 #include <ary/cpp/c_ce.hxx>
32 	// OTHER
33 #include <ary/cessentl.hxx>
34 #include <ary/cpp/c_types4cpp.hxx>
35 #include <ary/cpp/c_slntry.hxx>
36 #include <ary/cpp/c_vfflag.hxx>
37 #include <ary/cpp/c_osigna.hxx>
38 
39 
40 
41 
42 namespace ary
43 {
44 namespace cpp
45 {
46 
47 
48 
49 /** A C++ function declaration.
50 */
51 class Function : public CodeEntity
52 {
53   public:
54     enum E_ClassId { class_id = 1004 };
55 
56 						Function(
57                             const String  &     i_sLocalName,
58                             Ce_id               i_nOwner,
59                             E_Protection        i_eProtection,
60                             loc::Le_id          i_nFile,
61                             Type_id             i_nReturnType,
62                             const std::vector<S_Parameter> &
63                                                 i_parameters,
64                             E_ConVol            i_conVol,
65                             E_Virtuality        i_eVirtuality,
66                             FunctionFlags       i_aFlags,
67                             bool                i_bThrowExists,
68                             const std::vector<Type_id> &
69                                                 i_rExceptions );
70 						~Function();
71 
72 
73     // OPERATIONS
74     void                Add_TemplateParameterType(
75                             const String  &     i_sLocalName,
76                             Type_id             i_nIdAsType );
77 
78     // INQUIRY
79     const OperationSignature &
80                         Signature() const;
81     Type_id             ReturnType() const;
Protection() const82 	E_Protection        Protection() const      { return eProtection; }
Virtuality() const83 	E_Virtuality        Virtuality() const      { return eVirtuality; }
84     const FunctionFlags &
Flags() const85                         Flags() const           { return aFlags; }
86     const StringVector &
ParamInfos() const87                         ParamInfos() const      { return aParameterInfos; }
88     const std::vector<Type_id> *
Exceptions() const89                         Exceptions() const      { return pExceptions.Ptr(); }
90 
91     const List_TplParam &
TemplateParameters() const92                         TemplateParameters() const
93                                                 { return aTemplateParameterTypes; }
94     bool                IsIdentical(
95                             const Function &    i_f ) const;
96 
97   private:
98     // Interface csv::ConstProcessorClient
99     virtual void        do_Accept(
100                             csv::ProcessorIfc & io_processor ) const;
101 
102     // Interface ary::cpp::CodeEntity
103 	virtual const String  &
104                         inq_LocalName() const;
105 	virtual Cid         inq_Owner() const;
106 	virtual Lid			inq_Location() const;
107 
108     // Interface ary::cpp::CppEntity
109     virtual ClassId     get_AryClass() const;
110 
111     // Local Types
112     typedef StringVector                ParameterInfoList;
113     typedef std::vector<Type_id>        ExceptionTypeList;
114 
115     // DATA
116 	CeEssentials		aEssentials;
117     List_TplParam       aTemplateParameterTypes;
118     OperationSignature  aSignature;
119     Type_id             nReturnType;
120 	E_Protection		eProtection;
121 	E_Virtuality		eVirtuality;
122     FunctionFlags       aFlags;
123     ParameterInfoList   aParameterInfos;
124     Dyn<ExceptionTypeList>
125                         pExceptions;            //  if (NOT pExceptions) there is no throw,
126                                                 //    else, there is one, but the list still may be empty.
127 };
128 
129 
130 
131 
132 // IMPLEMENTATION
133 inline const OperationSignature &
Signature() const134 Function::Signature() const
135     { return aSignature; }
136 inline Type_id
ReturnType() const137 Function::ReturnType() const
138     { return nReturnType; }
139 
140 
141 
142 
143 }   // namespace cpp
144 }   // namespace ary
145 #endif
146