xref: /trunk/main/autodoc/source/ary/cpp/c_osigna.cxx (revision d291ea28)
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 #include <precomp.h>
23 #include <ary/cpp/c_osigna.hxx>
24 
25 
26 // NOT FULLY DEFINED SERVICES
27 
28 
29 namespace ary
30 {
31 namespace cpp
32 {
33 
34 
OperationSignature(std::vector<Type_id> i_parameterTypes,E_ConVol i_conVol)35 OperationSignature::OperationSignature( std::vector<Type_id>    i_parameterTypes,
36                                         E_ConVol                i_conVol )
37     :   aParameterTypes(i_parameterTypes),
38         eConVol(i_conVol)
39 {
40 }
41 
42 int
Compare(const OperationSignature & i_rSig) const43 OperationSignature::Compare( const OperationSignature &	i_rSig ) const
44 {
45 	if ( aParameterTypes.size() < i_rSig.aParameterTypes.size() )
46 		return -1;
47 	else if ( i_rSig.aParameterTypes.size() < aParameterTypes.size() )
48 		return 1;
49 
50 	ParameterTypeList::const_iterator iMe = aParameterTypes.begin();
51 	ParameterTypeList::const_iterator iOther = i_rSig.aParameterTypes.begin();
52 	for ( ; iMe != aParameterTypes.end(); ++iMe, ++iOther )
53 	{
54 		if ( *iMe < *iOther )
55 			return -1;
56 		else if ( *iOther < *iMe )
57 			return 1;
58 	}
59 
60 	if ( eConVol < i_rSig.eConVol )
61 		return -1;
62 	else if ( eConVol != i_rSig.eConVol )
63 		return 1;
64 
65 	return 0;
66 }
67 
68 
69 } // namespace cpp
70 } // namespace ary
71