Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef ARY_IDL_I_TYPE_HXX
21 : #define ARY_IDL_I_TYPE_HXX
22 :
23 : // USED SERVICES
24 : #include <ary/entity.hxx>
25 : #include <ary/idl/i_types4idl.hxx>
26 :
27 :
28 :
29 :
30 : namespace ary
31 : {
32 : namespace idl
33 : {
34 : class Gate;
35 :
36 :
37 : /** Abstract base for all secondary productions of types
38 : */
39 : class Type_2s
40 : {
41 : public:
42 0 : virtual ~Type_2s() {}
43 :
44 : static DYN Type_2s *
45 : Create_(
46 : ClassId i_nCeId );
47 : };
48 :
49 :
50 : /** Base of all IDL types.
51 :
52 : Type represents the occurrence of a type as base,
53 : parameter, return type or element type in UNO IDL code.
54 : Some of them relate to a ->CodeEntity, but
55 : the ->Type "MyInterface" is something different than
56 : the ->CodeEntity "MyInterface".
57 :
58 : This is a storage base class, where more special
59 : classes are derived from.
60 : */
61 8791 : class Type : public ary::Entity
62 : {
63 : public:
64 : typedef Type_2s secondary_productions;
65 :
66 : // LIFECYCLE
67 3696 : virtual ~Type() {}
68 :
69 : // INQUIRY
70 51407 : Type_id TypeId() const { return Type_id(Id()); }
71 :
72 : /** Does NOT clear the output-parameters.
73 :
74 : @attention
75 : If this is a sequence, the text of the first non-sequence, enclosed type
76 : is returned.
77 : */
78 : void Get_Text(
79 : StringVector & o_module,
80 : String & o_name,
81 : Ce_id & o_nRelatedCe,
82 : int & o_nSequenceCount,
83 : const Gate & i_rGate ) const;
84 : const std::vector<Type_id> *
85 : TemplateParameters() const;
86 : const Type & FirstEnclosedNonSequenceType( /// @return *this, if this is not a ->Sequence.
87 : const Gate & i_rGate ) const;
88 :
89 : private:
90 : virtual void inq_Get_Text(
91 : StringVector & o_module,
92 : String & o_name,
93 : Ce_id & o_nRelatedCe,
94 : int & o_nSequemceCount,
95 : const Gate & i_rGate ) const = 0;
96 : virtual const std::vector<Type_id> *
97 : inq_TemplateParameters() const;
98 : virtual const Type &
99 : inq_FirstEnclosedNonSequenceType(
100 : const Gate & i_rGate ) const;
101 : };
102 :
103 :
104 :
105 :
106 : // IMPLEMENTATION
107 : inline void
108 37971 : Type::Get_Text( StringVector & o_module,
109 : String & o_name,
110 : Ce_id & o_nRelatedCe,
111 : int & o_nSequenceCount,
112 : const Gate & i_rGate ) const
113 : {
114 37971 : inq_Get_Text(o_module,o_name,o_nRelatedCe,o_nSequenceCount,i_rGate);
115 37971 : }
116 :
117 : inline const std::vector<Type_id> *
118 19633 : Type::TemplateParameters() const
119 : {
120 19633 : return inq_TemplateParameters();
121 : }
122 :
123 : inline const Type &
124 16589 : Type::FirstEnclosedNonSequenceType(const Gate & i_rGate) const
125 : {
126 16589 : return inq_FirstEnclosedNonSequenceType(i_rGate);
127 : }
128 :
129 :
130 :
131 :
132 : } // namespace idl
133 : } // namespace ary
134 : #endif
135 :
136 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|