1*d291ea28SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*d291ea28SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*d291ea28SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*d291ea28SAndrew Rist * distributed with this work for additional information 6*d291ea28SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*d291ea28SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*d291ea28SAndrew Rist * "License"); you may not use this file except in compliance 9*d291ea28SAndrew Rist * with the License. You may obtain a copy of the License at 10*d291ea28SAndrew Rist * 11*d291ea28SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*d291ea28SAndrew Rist * 13*d291ea28SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*d291ea28SAndrew Rist * software distributed under the License is distributed on an 15*d291ea28SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*d291ea28SAndrew Rist * KIND, either express or implied. See the License for the 17*d291ea28SAndrew Rist * specific language governing permissions and limitations 18*d291ea28SAndrew Rist * under the License. 19*d291ea28SAndrew Rist * 20*d291ea28SAndrew Rist *************************************************************/ 21cdf0e10cSrcweir 22cdf0e10cSrcweir #include <precomp.h> 23cdf0e10cSrcweir #include <ary/cpp/c_osigna.hxx> 24cdf0e10cSrcweir 25cdf0e10cSrcweir 26cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES 27cdf0e10cSrcweir 28cdf0e10cSrcweir 29cdf0e10cSrcweir namespace ary 30cdf0e10cSrcweir { 31cdf0e10cSrcweir namespace cpp 32cdf0e10cSrcweir { 33cdf0e10cSrcweir 34cdf0e10cSrcweir OperationSignature(std::vector<Type_id> i_parameterTypes,E_ConVol i_conVol)35cdf0e10cSrcweirOperationSignature::OperationSignature( std::vector<Type_id> i_parameterTypes, 36cdf0e10cSrcweir E_ConVol i_conVol ) 37cdf0e10cSrcweir : aParameterTypes(i_parameterTypes), 38cdf0e10cSrcweir eConVol(i_conVol) 39cdf0e10cSrcweir { 40cdf0e10cSrcweir } 41cdf0e10cSrcweir 42cdf0e10cSrcweir int Compare(const OperationSignature & i_rSig) const43cdf0e10cSrcweirOperationSignature::Compare( const OperationSignature & i_rSig ) const 44cdf0e10cSrcweir { 45cdf0e10cSrcweir if ( aParameterTypes.size() < i_rSig.aParameterTypes.size() ) 46cdf0e10cSrcweir return -1; 47cdf0e10cSrcweir else if ( i_rSig.aParameterTypes.size() < aParameterTypes.size() ) 48cdf0e10cSrcweir return 1; 49cdf0e10cSrcweir 50cdf0e10cSrcweir ParameterTypeList::const_iterator iMe = aParameterTypes.begin(); 51cdf0e10cSrcweir ParameterTypeList::const_iterator iOther = i_rSig.aParameterTypes.begin(); 52cdf0e10cSrcweir for ( ; iMe != aParameterTypes.end(); ++iMe, ++iOther ) 53cdf0e10cSrcweir { 54cdf0e10cSrcweir if ( *iMe < *iOther ) 55cdf0e10cSrcweir return -1; 56cdf0e10cSrcweir else if ( *iOther < *iMe ) 57cdf0e10cSrcweir return 1; 58cdf0e10cSrcweir } 59cdf0e10cSrcweir 60cdf0e10cSrcweir if ( eConVol < i_rSig.eConVol ) 61cdf0e10cSrcweir return -1; 62cdf0e10cSrcweir else if ( eConVol != i_rSig.eConVol ) 63cdf0e10cSrcweir return 1; 64cdf0e10cSrcweir 65cdf0e10cSrcweir return 0; 66cdf0e10cSrcweir } 67cdf0e10cSrcweir 68cdf0e10cSrcweir 69cdf0e10cSrcweir } // namespace cpp 70cdf0e10cSrcweir } // namespace ary 71