1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
-- File: Interface_TypedValue.cdl
-- Created: Mon Feb 23 12:32:29 1998
-- Author: Christian CAILLET
-- <cky@fidox>
---Copyright: Matra Datavision 1995
class TypedValue from Interface inherits TypedValue from MoniTool
---Purpose : Now strictly equivalent to TypedValue from MoniTool,
-- except for ParamType which remains for compatibility reasons
--
-- This class allows to dynamically manage .. typed values, i.e.
-- values which have an alphanumeric expression, but with
-- controls. Such as "must be an Integer" or "Enumerative Text"
-- etc
--
-- Hence, a TypedValue brings a specification (type + constraints
-- if any) and a value. Its basic form is a string, it can be
-- specified as integer or real or enumerative string, then
-- queried as such.
-- Its string content, which is a Handle(HAsciiString) can be
-- shared by other data structures, hence gives a direct on line
-- access to its value.
uses CString, Type from Standard,
AsciiString from TCollection, HAsciiString from TCollection,
HSequenceOfAsciiString from TColStd, HArray1OfAsciiString from TColStd,
HSequenceOfHAsciiString from TColStd,
DictionaryOfInteger from Dico,
ParamType from Interface , ValueType from MoniTool,
ValueSatisfies from Interface, ValueInterpret from Interface
raises InterfaceError
is
Create (name : CString;
type : ParamType from Interface = Interface_ParamText;
init : CString = "") returns mutable TypedValue;
---Purpose : Creates a TypedValue, with a name
--
-- type gives the type of the parameter, default is free text
-- Also available : Integer, Real, Enum, Entity (i.e. Object)
-- More precise specifications, titles, can be given to the
-- TypedValue once created
--
-- init gives an initial value. If it is not given, the
-- TypedValue begins as "not set", its value is empty
Type (me) returns ParamType from Interface;
---Purpose : Returns the type
-- I.E. calls ValueType then makes correspondance between
-- ParamType from Interface (which remains for compatibility
-- reasons) and ValueType from MoniTool
ParamTypeToValueType (myclass; typ : ParamType from Interface)
returns ValueType from MoniTool;
---Purpose : Correspondance ParamType from Interface to
-- ValueType from MoniTool
ValueTypeToParamType (myclass; typ : ValueType from MoniTool)
returns ParamType from Interface;
---Purpose : Correspondance ParamType from Interface to
-- ValueType from MoniTool
fields
thename : AsciiString;
thedef : AsciiString;
thelabel : AsciiString;
thetype : ParamType from Interface;
theotyp : Type from Standard; -- for object
thelims : Integer; -- status for integer/enum/real limits
themaxlen : Integer;
theintlow : Integer;
theintup : Integer;
therealow : Real;
therealup : Real;
theunidef : AsciiString;
theenums : HArray1OfAsciiString from TColStd;
theeadds : DictionaryOfInteger;
theinterp : ValueInterpret;
thesatisf : ValueSatisfies;
thesatisn : AsciiString;
theival : Integer;
thehval : HAsciiString from TCollection;
theoval : Transient;
end Static;
|