xref: /aoo41x/main/autodoc/inc/ary/cpp/c_osigna.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ARY_CPP_C_OSIGNA_HXX
29 #define ARY_CPP_C_OSIGNA_HXX
30 
31 // USED SERVICES
32 	// BASE CLASSES
33 	// OTHER
34 #include <ary/cpp/c_types4cpp.hxx>
35 
36 namespace ary
37 {
38 namespace cpp
39 {
40     class Gate;
41 }
42 }
43 
44 
45 
46 namespace ary
47 {
48 namespace cpp
49 {
50 
51 
52 /** The signature of a C++ function. That is: parameter types and
53     const/volatile modifiers.
54 */
55 class OperationSignature
56 {
57   public:
58     typedef std::vector<Type_id>	ParameterTypeList;
59 
60 						OperationSignature(
61                             ParameterTypeList   i_parameterTypes,  // Non const, because it will be swapped with aParameterTypes.
62                             E_ConVol            i_conVol );
63 
64 	bool				operator==(
65 							const OperationSignature &
66 												i_rSig ) const;
67 	bool				operator<(
68 							const OperationSignature &
69 												i_rSig ) const;
70 
71     // INQUIRY
72     const ParameterTypeList &
73                         Parameters() const;
74     E_ConVol            ConVol() const;
75 
76 	/**	Compares the signatures by length an then by ids of
77 		parameter types. So the result is not always human
78 		reconstructable.
79 		@return like in strcmp().
80 	*/
81 	int					Compare(
82 							const OperationSignature &
83 												i_rSig ) const;
84   private:
85     // DATA
86 	ParameterTypeList	aParameterTypes;
87     E_ConVol            eConVol;
88 };
89 
90 
91 
92 
93 // IMPLEMENTATION
94 inline bool
95 OperationSignature::operator==( const OperationSignature & i_rSign ) const
96 {
97     return Compare(i_rSign) == 0;
98 }
99 
100 inline bool
101 OperationSignature::operator<( const OperationSignature & i_rSign ) const
102 {
103     return Compare(i_rSign) < 0;
104 }
105 
106 inline const OperationSignature::ParameterTypeList &
107 OperationSignature::Parameters() const
108 {
109     return aParameterTypes;
110 }
111 
112 inline E_ConVol
113 OperationSignature::ConVol() const
114 {
115     return eConVol;
116 }
117 
118 
119 
120 } // namespace cpp
121 } // namespace ary
122 #endif
123