0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- prepar...
[occt.git] / src / Interface / Interface_TypedValue.hxx
CommitLineData
42cf5bc1 1// Created on: 1998-02-23
2// Created by: Christian CAILLET
3// Copyright (c) 1998-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _Interface_TypedValue_HeaderFile
18#define _Interface_TypedValue_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <TCollection_AsciiString.hxx>
24#include <Standard_Type.hxx>
25#include <TColStd_HArray1OfAsciiString.hxx>
26#include <MoniTool_TypedValue.hxx>
27#include <Standard_CString.hxx>
28#include <Interface_ParamType.hxx>
29#include <MoniTool_ValueType.hxx>
42cf5bc1 30class TCollection_HAsciiString;
31class Standard_Transient;
32class Interface_InterfaceError;
33
34
35class Interface_TypedValue;
36DEFINE_STANDARD_HANDLE(Interface_TypedValue, MoniTool_TypedValue)
37
38//! Now strictly equivalent to TypedValue from MoniTool,
39//! except for ParamType which remains for compatibility reasons
40//!
41//! This class allows to dynamically manage .. typed values, i.e.
42//! values which have an alphanumeric expression, but with
43//! controls. Such as "must be an Integer" or "Enumerative Text"
44//! etc
45//!
46//! Hence, a TypedValue brings a specification (type + constraints
47//! if any) and a value. Its basic form is a string, it can be
48//! specified as integer or real or enumerative string, then
49//! queried as such.
50//! Its string content, which is a Handle(HAsciiString) can be
51//! shared by other data structures, hence gives a direct on line
52//! access to its value.
53class Interface_TypedValue : public MoniTool_TypedValue
54{
55
56public:
57
58
59 //! Creates a TypedValue, with a name
60 //!
61 //! type gives the type of the parameter, default is free text
62 //! Also available : Integer, Real, Enum, Entity (i.e. Object)
63 //! More precise specifications, titles, can be given to the
64 //! TypedValue once created
65 //!
66 //! init gives an initial value. If it is not given, the
67 //! TypedValue begins as "not set", its value is empty
68 Standard_EXPORT Interface_TypedValue(const Standard_CString name, const Interface_ParamType type = Interface_ParamText, const Standard_CString init = "");
69
70 //! Returns the type
71 //! I.E. calls ValueType then makes correspondance between
72 //! ParamType from Interface (which remains for compatibility
73 //! reasons) and ValueType from MoniTool
74 Standard_EXPORT Interface_ParamType Type() const;
75
76 //! Correspondance ParamType from Interface to
77 //! ValueType from MoniTool
78 Standard_EXPORT static MoniTool_ValueType ParamTypeToValueType (const Interface_ParamType typ);
79
80 //! Correspondance ParamType from Interface to
81 //! ValueType from MoniTool
82 Standard_EXPORT static Interface_ParamType ValueTypeToParamType (const MoniTool_ValueType typ);
83
84
85
86
92efcf78 87 DEFINE_STANDARD_RTTIEXT(Interface_TypedValue,MoniTool_TypedValue)
42cf5bc1 88
89protected:
90
91
92
93
94private:
95
96
97 TCollection_AsciiString thename;
98 TCollection_AsciiString thedef;
99 TCollection_AsciiString thelabel;
100 Handle(Standard_Type) theotyp;
101 TCollection_AsciiString theunidef;
102 Handle(TColStd_HArray1OfAsciiString) theenums;
997e128f 103 NCollection_DataMap<TCollection_AsciiString, Standard_Integer> theeadds;
42cf5bc1 104 TCollection_AsciiString thesatisn;
105 Handle(TCollection_HAsciiString) thehval;
106 Handle(Standard_Transient) theoval;
107
108
109};
110
111
112
113
114
115
116
117#endif // _Interface_TypedValue_HeaderFile