1------------------------------------------------------------------------------ 2-- -- 3-- Matreshka Project -- 4-- -- 5-- Ada Modeling Framework -- 6-- -- 7-- Runtime Library Component -- 8-- -- 9------------------------------------------------------------------------------ 10-- -- 11-- Copyright © 2011-2012, Vadim Godunko <vgodunko@gmail.com> -- 12-- All rights reserved. -- 13-- -- 14-- Redistribution and use in source and binary forms, with or without -- 15-- modification, are permitted provided that the following conditions -- 16-- are met: -- 17-- -- 18-- * Redistributions of source code must retain the above copyright -- 19-- notice, this list of conditions and the following disclaimer. -- 20-- -- 21-- * Redistributions in binary form must reproduce the above copyright -- 22-- notice, this list of conditions and the following disclaimer in the -- 23-- documentation and/or other materials provided with the distribution. -- 24-- -- 25-- * Neither the name of the Vadim Godunko, IE nor the names of its -- 26-- contributors may be used to endorse or promote products derived from -- 27-- this software without specific prior written permission. -- 28-- -- 29-- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -- 30-- "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -- 31-- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -- 32-- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -- 33-- HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -- 34-- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED -- 35-- TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -- 36-- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -- 37-- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -- 38-- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -- 39-- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 40-- -- 41------------------------------------------------------------------------------ 42-- $Revision: 2937 $ $Date: 2012-05-01 21:07:27 +0400 (Tue, 01 May 2012) $ 43------------------------------------------------------------------------------ 44with AMF.Internals.UML_Packageable_Elements; 45with AMF.String_Collections; 46with AMF.UML.Behaviors; 47with AMF.UML.Dependencies.Collections; 48with AMF.UML.Named_Elements; 49with AMF.UML.Namespaces; 50with AMF.UML.Opaque_Expressions; 51with AMF.UML.Packages.Collections; 52with AMF.UML.Parameterable_Elements; 53with AMF.UML.Parameters; 54with AMF.UML.String_Expressions; 55with AMF.UML.Template_Parameters; 56with AMF.UML.Types; 57with AMF.Visitors; 58 59package AMF.Internals.UML_Opaque_Expressions is 60 61 type UML_Opaque_Expression_Proxy is 62 limited new AMF.Internals.UML_Packageable_Elements.UML_Packageable_Element_Proxy 63 and AMF.UML.Opaque_Expressions.UML_Opaque_Expression with null record; 64 65 overriding function Get_Behavior 66 (Self : not null access constant UML_Opaque_Expression_Proxy) 67 return AMF.UML.Behaviors.UML_Behavior_Access; 68 -- Getter of OpaqueExpression::behavior. 69 -- 70 -- Specifies the behavior of the opaque expression. 71 72 overriding procedure Set_Behavior 73 (Self : not null access UML_Opaque_Expression_Proxy; 74 To : AMF.UML.Behaviors.UML_Behavior_Access); 75 -- Setter of OpaqueExpression::behavior. 76 -- 77 -- Specifies the behavior of the opaque expression. 78 79 overriding function Get_Body 80 (Self : not null access constant UML_Opaque_Expression_Proxy) 81 return AMF.String_Collections.Sequence_Of_String; 82 -- Getter of OpaqueExpression::body. 83 -- 84 -- The text of the expression, possibly in multiple languages. 85 86 overriding function Get_Language 87 (Self : not null access constant UML_Opaque_Expression_Proxy) 88 return AMF.String_Collections.Ordered_Set_Of_String; 89 -- Getter of OpaqueExpression::language. 90 -- 91 -- Specifies the languages in which the expression is stated. The 92 -- interpretation of the expression body depends on the languages. If the 93 -- languages are unspecified, they might be implicit from the expression 94 -- body or the context. Languages are matched to body strings by order. 95 96 overriding function Get_Result 97 (Self : not null access constant UML_Opaque_Expression_Proxy) 98 return AMF.UML.Parameters.UML_Parameter_Access; 99 -- Getter of OpaqueExpression::result. 100 -- 101 -- Restricts an opaque expression to return exactly one return result. 102 -- When the invocation of the opaque expression completes, a single set of 103 -- values is returned to its owner. This association is derived from the 104 -- single return result parameter of the associated behavior. 105 106 overriding function Get_Type 107 (Self : not null access constant UML_Opaque_Expression_Proxy) 108 return AMF.UML.Types.UML_Type_Access; 109 -- Getter of TypedElement::type. 110 -- 111 -- The type of the TypedElement. 112 -- This information is derived from the return result for this Operation. 113 114 overriding procedure Set_Type 115 (Self : not null access UML_Opaque_Expression_Proxy; 116 To : AMF.UML.Types.UML_Type_Access); 117 -- Setter of TypedElement::type. 118 -- 119 -- The type of the TypedElement. 120 -- This information is derived from the return result for this Operation. 121 122 overriding function Get_Client_Dependency 123 (Self : not null access constant UML_Opaque_Expression_Proxy) 124 return AMF.UML.Dependencies.Collections.Set_Of_UML_Dependency; 125 -- Getter of NamedElement::clientDependency. 126 -- 127 -- Indicates the dependencies that reference the client. 128 129 overriding function Get_Name_Expression 130 (Self : not null access constant UML_Opaque_Expression_Proxy) 131 return AMF.UML.String_Expressions.UML_String_Expression_Access; 132 -- Getter of NamedElement::nameExpression. 133 -- 134 -- The string expression used to define the name of this named element. 135 136 overriding procedure Set_Name_Expression 137 (Self : not null access UML_Opaque_Expression_Proxy; 138 To : AMF.UML.String_Expressions.UML_String_Expression_Access); 139 -- Setter of NamedElement::nameExpression. 140 -- 141 -- The string expression used to define the name of this named element. 142 143 overriding function Get_Namespace 144 (Self : not null access constant UML_Opaque_Expression_Proxy) 145 return AMF.UML.Namespaces.UML_Namespace_Access; 146 -- Getter of NamedElement::namespace. 147 -- 148 -- Specifies the namespace that owns the NamedElement. 149 150 overriding function Get_Qualified_Name 151 (Self : not null access constant UML_Opaque_Expression_Proxy) 152 return AMF.Optional_String; 153 -- Getter of NamedElement::qualifiedName. 154 -- 155 -- A name which allows the NamedElement to be identified within a 156 -- hierarchy of nested Namespaces. It is constructed from the names of the 157 -- containing namespaces starting at the root of the hierarchy and ending 158 -- with the name of the NamedElement itself. 159 160 overriding function Get_Owning_Template_Parameter 161 (Self : not null access constant UML_Opaque_Expression_Proxy) 162 return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; 163 -- Getter of ParameterableElement::owningTemplateParameter. 164 -- 165 -- The formal template parameter that owns this element. 166 167 overriding procedure Set_Owning_Template_Parameter 168 (Self : not null access UML_Opaque_Expression_Proxy; 169 To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); 170 -- Setter of ParameterableElement::owningTemplateParameter. 171 -- 172 -- The formal template parameter that owns this element. 173 174 overriding function Get_Template_Parameter 175 (Self : not null access constant UML_Opaque_Expression_Proxy) 176 return AMF.UML.Template_Parameters.UML_Template_Parameter_Access; 177 -- Getter of ParameterableElement::templateParameter. 178 -- 179 -- The template parameter that exposes this element as a formal parameter. 180 181 overriding procedure Set_Template_Parameter 182 (Self : not null access UML_Opaque_Expression_Proxy; 183 To : AMF.UML.Template_Parameters.UML_Template_Parameter_Access); 184 -- Setter of ParameterableElement::templateParameter. 185 -- 186 -- The template parameter that exposes this element as a formal parameter. 187 188 overriding function Is_Integral 189 (Self : not null access constant UML_Opaque_Expression_Proxy) 190 return Boolean; 191 -- Operation OpaqueExpression::isIntegral. 192 -- 193 -- The query isIntegral() tells whether an expression is intended to 194 -- produce an integer. 195 196 overriding function Is_Non_Negative 197 (Self : not null access constant UML_Opaque_Expression_Proxy) 198 return Boolean; 199 -- Operation OpaqueExpression::isNonNegative. 200 -- 201 -- The query isNonNegative() tells whether an integer expression has a 202 -- non-negative value. 203 204 overriding function Is_Positive 205 (Self : not null access constant UML_Opaque_Expression_Proxy) 206 return Boolean; 207 -- Operation OpaqueExpression::isPositive. 208 -- 209 -- The query isPositive() tells whether an integer expression has a 210 -- positive value. 211 212 overriding function Result 213 (Self : not null access constant UML_Opaque_Expression_Proxy) 214 return AMF.UML.Parameters.UML_Parameter_Access; 215 -- Operation OpaqueExpression::result. 216 -- 217 -- Missing derivation for OpaqueExpression::/result : Parameter 218 219 overriding function Value 220 (Self : not null access constant UML_Opaque_Expression_Proxy) 221 return Integer; 222 -- Operation OpaqueExpression::value. 223 -- 224 -- The query value() gives an integer value for an expression intended to 225 -- produce one. 226 227 overriding function Boolean_Value 228 (Self : not null access constant UML_Opaque_Expression_Proxy) 229 return AMF.Optional_Boolean; 230 -- Operation ValueSpecification::booleanValue. 231 -- 232 -- The query booleanValue() gives a single Boolean value when one can be 233 -- computed. 234 235 overriding function Integer_Value 236 (Self : not null access constant UML_Opaque_Expression_Proxy) 237 return AMF.Optional_Integer; 238 -- Operation ValueSpecification::integerValue. 239 -- 240 -- The query integerValue() gives a single Integer value when one can be 241 -- computed. 242 243 overriding function Is_Compatible_With 244 (Self : not null access constant UML_Opaque_Expression_Proxy; 245 P : AMF.UML.Parameterable_Elements.UML_Parameterable_Element_Access) 246 return Boolean; 247 -- Operation ValueSpecification::isCompatibleWith. 248 -- 249 -- The query isCompatibleWith() determines if this parameterable element 250 -- is compatible with the specified parameterable element. By default 251 -- parameterable element P is compatible with parameterable element Q if 252 -- the kind of P is the same or a subtype as the kind of Q. In addition, 253 -- for ValueSpecification, the type must be conformant with the type of 254 -- the specified parameterable element. 255 256 overriding function Is_Computable 257 (Self : not null access constant UML_Opaque_Expression_Proxy) 258 return Boolean; 259 -- Operation ValueSpecification::isComputable. 260 -- 261 -- The query isComputable() determines whether a value specification can 262 -- be computed in a model. This operation cannot be fully defined in OCL. 263 -- A conforming implementation is expected to deliver true for this 264 -- operation for all value specifications that it can compute, and to 265 -- compute all of those for which the operation is true. A conforming 266 -- implementation is expected to be able to compute the value of all 267 -- literals. 268 269 overriding function Is_Null 270 (Self : not null access constant UML_Opaque_Expression_Proxy) 271 return Boolean; 272 -- Operation ValueSpecification::isNull. 273 -- 274 -- The query isNull() returns true when it can be computed that the value 275 -- is null. 276 277 overriding function Real_Value 278 (Self : not null access constant UML_Opaque_Expression_Proxy) 279 return AMF.Optional_Real; 280 -- Operation ValueSpecification::realValue. 281 -- 282 -- The query realValue() gives a single Real value when one can be 283 -- computed. 284 285 overriding function String_Value 286 (Self : not null access constant UML_Opaque_Expression_Proxy) 287 return AMF.Optional_String; 288 -- Operation ValueSpecification::stringValue. 289 -- 290 -- The query stringValue() gives a single String value when one can be 291 -- computed. 292 293 overriding function Unlimited_Value 294 (Self : not null access constant UML_Opaque_Expression_Proxy) 295 return AMF.Optional_Unlimited_Natural; 296 -- Operation ValueSpecification::unlimitedValue. 297 -- 298 -- The query unlimitedValue() gives a single UnlimitedNatural value when 299 -- one can be computed. 300 301 overriding function All_Owning_Packages 302 (Self : not null access constant UML_Opaque_Expression_Proxy) 303 return AMF.UML.Packages.Collections.Set_Of_UML_Package; 304 -- Operation NamedElement::allOwningPackages. 305 -- 306 -- The query allOwningPackages() returns all the directly or indirectly 307 -- owning packages. 308 309 overriding function Is_Distinguishable_From 310 (Self : not null access constant UML_Opaque_Expression_Proxy; 311 N : AMF.UML.Named_Elements.UML_Named_Element_Access; 312 Ns : AMF.UML.Namespaces.UML_Namespace_Access) 313 return Boolean; 314 -- Operation NamedElement::isDistinguishableFrom. 315 -- 316 -- The query isDistinguishableFrom() determines whether two NamedElements 317 -- may logically co-exist within a Namespace. By default, two named 318 -- elements are distinguishable if (a) they have unrelated types or (b) 319 -- they have related types but different names. 320 321 overriding function Namespace 322 (Self : not null access constant UML_Opaque_Expression_Proxy) 323 return AMF.UML.Namespaces.UML_Namespace_Access; 324 -- Operation NamedElement::namespace. 325 -- 326 -- Missing derivation for NamedElement::/namespace : Namespace 327 328 overriding function Is_Template_Parameter 329 (Self : not null access constant UML_Opaque_Expression_Proxy) 330 return Boolean; 331 -- Operation ParameterableElement::isTemplateParameter. 332 -- 333 -- The query isTemplateParameter() determines if this parameterable 334 -- element is exposed as a formal template parameter. 335 336 overriding procedure Enter_Element 337 (Self : not null access constant UML_Opaque_Expression_Proxy; 338 Visitor : in out AMF.Visitors.Abstract_Visitor'Class; 339 Control : in out AMF.Visitors.Traverse_Control); 340 -- Dispatch call to corresponding subprogram of visitor interface. 341 342 overriding procedure Leave_Element 343 (Self : not null access constant UML_Opaque_Expression_Proxy; 344 Visitor : in out AMF.Visitors.Abstract_Visitor'Class; 345 Control : in out AMF.Visitors.Traverse_Control); 346 -- Dispatch call to corresponding subprogram of visitor interface. 347 348 overriding procedure Visit_Element 349 (Self : not null access constant UML_Opaque_Expression_Proxy; 350 Iterator : in out AMF.Visitors.Abstract_Iterator'Class; 351 Visitor : in out AMF.Visitors.Abstract_Visitor'Class; 352 Control : in out AMF.Visitors.Traverse_Control); 353 -- Dispatch call to corresponding subprogram of iterator interface. 354 355end AMF.Internals.UML_Opaque_Expressions; 356