Open CASCADE Technology 6.6.0
Public Member Functions
MoniTool_OptValue Class Reference

This class allows two kinds of use

As an object, a OptValue can be put in any operator or
algorithm ... to use an Option of a Profile, by recording
its value, hence avoiding to query the Profile eachtime

This object brings a value which can be set as coming from a
Profile, with a configuration name and for an Option name
This value is evaluated then returned immediately

As a class, it can be redefined to work on a dedicated
Profile, provided by such or such specific way (as static
context for instance)

To change configuration, etc... can be done by querying and
editing the Profile

#include <MoniTool_OptValue.hxx>

Public Member Functions

 MoniTool_OptValue (const Standard_CString opt="")
 Creates an OptValue on a given Option
This allows to use "shortcut" method to set the value

WARNING : loading is not done at creation time. It must be
done explicitly by call to Load

The reason comes from C++ : the Profile being virtual, and
intended to be redefined in sub-classes, must not be used in
the constructor. A separate method, called on the object
already created with its true type, must be called after

void Clear ()
 Clears the Value of the OptValue

void SetValue (const Handle< MoniTool_Profile > &prof, const Standard_CString opt, const Standard_Boolean fast=Standard_True)
 Sets the value as coming from the Profile, according to an
Option name. Access as Fast or regular
If no value is available, the former one remains : can be
cleared by call to Clear

virtual Handle_MoniTool_Profile Prof () const
 Returns the Profile which can be used by Short Cut methods
Defaults returns a Null Handle, can be redefined
For instance, to return a static used as dictionary or context

void Load (const Standard_Boolean fast=Standard_True)
 Sets the value from the Profile returned by method Prof,
and Option Name given at creation time.
FastValue by default, else Value

Does not check if already loaded : reloads anyway
IsLoaded allows to test

Standard_Boolean IsLoaded () const
 Says if the OptValue is already loaded (i.e. Value defined)

void Value (Handle< Standard_Transient > &val) const
 Returns the Value set by, either SetConf or SetValue
Can be Null ... (if not set or not properly set)

Returned as Argument, hence avoiding DownCast
Warning : type is not controlled

virtual void Delete ()
virtual ~MoniTool_OptValue ()

Constructor & Destructor Documentation

MoniTool_OptValue::MoniTool_OptValue ( const Standard_CString  opt = "")
virtual MoniTool_OptValue::~MoniTool_OptValue ( ) [inline, virtual]

Member Function Documentation

void MoniTool_OptValue::Clear ( )
virtual void MoniTool_OptValue::Delete ( ) [virtual]
Standard_Boolean MoniTool_OptValue::IsLoaded ( ) const
void MoniTool_OptValue::Load ( const Standard_Boolean  fast = Standard_True)
virtual Handle_MoniTool_Profile MoniTool_OptValue::Prof ( ) const [virtual]
void MoniTool_OptValue::SetValue ( const Handle< MoniTool_Profile > &  prof,
const Standard_CString  opt,
const Standard_Boolean  fast = Standard_True 
)
void MoniTool_OptValue::Value ( Handle< Standard_Transient > &  val) const

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines