1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <MoniTool_OptValue.hxx>
16 #include <MoniTool_Profile.hxx>
17 #include <Standard_Transient.hxx>
19 MoniTool_OptValue::MoniTool_OptValue (const Standard_CString opt)
22 // CKY: NO CALL TO A VIRTUAL METHOD WITHIN THE CONSTRUCTOR
23 // Explicite Load must be done after creation
26 void MoniTool_OptValue::Clear ()
29 void MoniTool_OptValue::SetValue
30 (const Handle(MoniTool_Profile)& prof,
31 const Standard_CString opt, const Standard_Boolean fast)
33 if (prof.IsNull()) return;
34 if (!opt || opt[0] == '\0') return;
35 Handle(Standard_Transient) val;
36 if (fast) prof->FastValue (opt,val);
37 else prof->Value (opt,val);
38 if (!val.IsNull()) theval = val;
42 Standard_Boolean MoniTool_OptValue::IsLoaded () const
43 { return (!theval.IsNull()); }
45 Handle(MoniTool_Profile) MoniTool_OptValue::Prof () const
47 Handle(MoniTool_Profile) prof;
51 void MoniTool_OptValue::Load (const Standard_Boolean fast)
52 { SetValue (Prof(),theopt.ToCString(),fast); }
55 void MoniTool_OptValue::Value (Handle(Standard_Transient)& val) const
58 //=======================================================================
59 //function : ~MoniTool_OptValue
61 //=======================================================================
63 MoniTool_OptValue::~MoniTool_OptValue()