Open CASCADE Technology  6.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions
Interface_Check Class Reference

Defines a Check, as a list of Fail or Warning Messages under
a literal form, which can be empty. A Check can also bring an
Entity, which is the Entity to which the messages apply
(this Entity may be any Transient Object).

Messages can be stored in two forms : the definitive form
(the only one by default), and another form, the original
form, which can be different if it contains values to be
inserted (integers, reals, strings)
The original form can be more suitable for some operations
such as counting messages
More...

#include <Interface_Check.hxx>

Inheritance diagram for Interface_Check:
Inheritance graph
[legend]

Public Member Functions

 Interface_Check ()
 Allows definition of a Sequence. Used also for Global Check
of an InterfaceModel (which stores global messages for file)
More...
 
 Interface_Check (const Handle< Standard_Transient > &anentity)
 Defines a Check on an Entity
More...
 
void SendFail (const Message_Msg &amsg)
 New name for AddFail (Msg)
More...
 
void AddFail (const Handle< TCollection_HAsciiString > &amess)
 Records a new Fail message
More...
 
void AddFail (const Handle< TCollection_HAsciiString > &amess, const Handle< TCollection_HAsciiString > &orig)
 Records a new Fail message under two forms : final,original
More...
 
void AddFail (const Standard_CString amess, const Standard_CString orig="")
 Records a new Fail message given as "error text" directly
If <orig> is given, a distinct original form is recorded
else (D), the original form equates <amess>
More...
 
void AddFail (const Message_Msg &amsg)
 Records a new Fail from the definition of a Msg (Original+Value)
More...
 
Standard_Boolean HasFailed () const
 Returns True if Check brings at least one Fail Message
More...
 
Standard_Integer NbFails () const
 Returns count of recorded Fails
More...
 
const
Handle_TCollection_HAsciiString & 
Fail (const Standard_Integer num, const Standard_Boolean final=Standard_True) const
 Returns Fail Message as a String
Final form by default, Original form if <final> is False
More...
 
Standard_CString CFail (const Standard_Integer num, const Standard_Boolean final=Standard_True) const
 Same as above, but returns a CString (to be printed ...)
Final form by default, Original form if <final> is False
More...
 
Handle_TColStd_HSequenceOfHAsciiString Fails (const Standard_Boolean final=Standard_True) const
 Returns the list of Fails, for a frontal-engine logic
Final forms by default, Original forms if <final> is False
Can be empty
More...
 
void SendWarning (const Message_Msg &amsg)
 New name for AddWarning
More...
 
void AddWarning (const Handle< TCollection_HAsciiString > &amess)
 Records a new Warning message
More...
 
void AddWarning (const Handle< TCollection_HAsciiString > &amess, const Handle< TCollection_HAsciiString > &orig)
 Records a new Warning message under two forms : final,original
More...
 
void AddWarning (const Standard_CString amess, const Standard_CString orig="")
 Records a Warning message given as "warning message" directly
If <orig> is given, a distinct original form is recorded
else (D), the original form equates <amess>
More...
 
void AddWarning (const Message_Msg &amsg)
 Records a new Warning from the definition of a Msg (Original+Value)
More...
 
Standard_Boolean HasWarnings () const
 Returns True if Check brings at least one Warning Message
More...
 
Standard_Integer NbWarnings () const
 Returns count of recorded Warning messages
More...
 
const
Handle_TCollection_HAsciiString & 
Warning (const Standard_Integer num, const Standard_Boolean final=Standard_True) const
 Returns Warning message as a String
Final form by default, Original form if <final> is False
More...
 
Standard_CString CWarning (const Standard_Integer num, const Standard_Boolean final=Standard_True) const
 Same as above, but returns a CString (to be printed ...)
Final form by default, Original form if <final> is False
More...
 
Handle_TColStd_HSequenceOfHAsciiString Warnings (const Standard_Boolean final=Standard_True) const
 Returns the list of Warnings, for a frontal-engine logic
Final forms by default, Original forms if <final> is False
Can be empty
More...
 
void SendMsg (const Message_Msg &amsg)
 Records an information message
This does not change the status of the Check
More...
 
Standard_Integer NbInfoMsgs () const
 Returns the count of recorded information messages
More...
 
const
Handle_TCollection_HAsciiString & 
InfoMsg (const Standard_Integer num, const Standard_Boolean final=Standard_True) const
 Returns information message as a String
More...
 
Standard_CString CInfoMsg (const Standard_Integer num, const Standard_Boolean final=Standard_True) const
 Same as above, but returns a CString (to be printed ...)
Final form by default, Original form if <final> is False
More...
 
Handle_TColStd_HSequenceOfHAsciiString InfoMsgs (const Standard_Boolean final=Standard_True) const
 Returns the list of Info Msg, for a frontal-engine logic
Final forms by default, Original forms if <final> is False
Can be empty
More...
 
Interface_CheckStatus Status () const
 Returns the Check Status : OK, Warning or Fail
More...
 
Standard_Boolean Complies (const Interface_CheckStatus status) const
 Tells if Check Status complies with a given one
(i.e. also status for query)
More...
 
Standard_Boolean Complies (const Handle< TCollection_HAsciiString > &mess, const Standard_Integer incl, const Interface_CheckStatus status) const
 Tells if a message is brought by a Check, as follows :
<incl> = 0 : <mess> exactly matches one of the messages
<incl> < 0 : <mess> is contained by one of the messages
<incl> > 0 : <mess> contains one of the messages
For <status> : for CheckWarning and CheckFail, considers only
resp. Warning or Check messages. for CheckAny, considers all
other values are ignored (answer will be false)
More...
 
Standard_Boolean HasEntity () const
 Returns True if a Check is devoted to an entity; else, it is
global (for InterfaceModel's storing of global error messages)
More...
 
const Handle_Standard_Transient & Entity () const
 Returns the entity on which the Check has been defined
More...
 
void Clear ()
 Clears a check, in order to receive informations from transfer
(Messages and Entity)
More...
 
void ClearFails ()
 Clears the Fail Messages (for instance to keep only Warnings)
More...
 
void ClearWarnings ()
 Clears the Warning Messages (for instance to keep only Fails)
More...
 
void ClearInfoMsgs ()
 Clears the Info Messages
More...
 
Standard_Boolean Remove (const Handle< TCollection_HAsciiString > &mess, const Standard_Integer incl, const Interface_CheckStatus status)
 Removes the messages which comply with <mess>, as follows :
<incl> = 0 : <mess> exactly matches one of the messages
<incl> < 0 : <mess> is contained by one of the messages
<incl> > 0 : <mess> contains one of the messages
For <status> : for CheckWarning and CheckFail, considers only
resp. Warning or Check messages. for CheckAny, considers all
other values are ignored (nothing is done)
Returns True if at least one message has been removed, False else
More...
 
Standard_Boolean Mend (const Standard_CString pref, const Standard_Integer num=0)
 Mends messages, according <pref> and <num>
According to <num>, works on the whole list of Fails if = 0(D)
or only one Fail message, given its rank
If <pref> is empty, converts Fail(s) to Warning(s)
Else, does the conversion but prefixes the new Warning(s) but
<pref> followed by a semi-column
Some reserved values of <pref> are :
"FM" : standard prefix "Mended" (can be translated)
"CF" : clears Fail(s)
"CW" : clears Warning(s) : here, <num> refers to Warning list
"CA" : clears all messages : here, <num> is ignored
More...
 
void SetEntity (const Handle< Standard_Transient > &anentity)
 Receives an entity result of a Transfer
More...
 
void GetEntity (const Handle< Standard_Transient > &anentity)
 
 same as SetEntity (old form kept for compatibility) <br>

Warning : Does nothing if Entity field is not yet clear
More...

 
void GetMessages (const Handle< Interface_Check > &other)
 Copies messages stored in another Check, cumulating
Does not regard other's Entity. Used to cumulate messages
More...
 
void GetAsWarning (const Handle< Interface_Check > &other, const Standard_Boolean failsonly)
 Copies messages converted into Warning messages
If failsonly is true, only Fails are taken, and converted
else, Warnings are taken too. Does not regard Entity
Used to keep Fail messages as Warning, after a recovery
More...
 
void Print (const Handle< Message_Messenger > &S, const Standard_Integer level, const Standard_Integer final=1) const
 Prints the messages of the check to an Messenger
<level> = 1 : only fails
<level> = 2 : fails and warnings
<level> = 3 : all (fails, warnings, info msg)
<final> : if positive (D) prints final values of messages
if negative, prints originals
if null, prints both forms
More...
 
void Trace (const Standard_Integer level=-1, const Standard_Integer final=1) const
 Prints the messages of the check to the default trace file
By default, according to the default standard level
Else, according level (see method Print)
More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void ShallowDump (Standard_OStream &) const
 
virtual const
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const Handle_Standard_Type &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const Handle_Standard_Type &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Detailed Description

Defines a Check, as a list of Fail or Warning Messages under
a literal form, which can be empty. A Check can also bring an
Entity, which is the Entity to which the messages apply
(this Entity may be any Transient Object).

Messages can be stored in two forms : the definitive form
(the only one by default), and another form, the original
form, which can be different if it contains values to be
inserted (integers, reals, strings)
The original form can be more suitable for some operations
such as counting messages

Constructor & Destructor Documentation

Interface_Check::Interface_Check ( )

Allows definition of a Sequence. Used also for Global Check
of an InterfaceModel (which stores global messages for file)

Interface_Check::Interface_Check ( const Handle< Standard_Transient > &  anentity)

Defines a Check on an Entity

Member Function Documentation

void Interface_Check::AddFail ( const Handle< TCollection_HAsciiString > &  amess)

Records a new Fail message

void Interface_Check::AddFail ( const Handle< TCollection_HAsciiString > &  amess,
const Handle< TCollection_HAsciiString > &  orig 
)

Records a new Fail message under two forms : final,original

void Interface_Check::AddFail ( const Standard_CString  amess,
const Standard_CString  orig = "" 
)

Records a new Fail message given as "error text" directly
If <orig> is given, a distinct original form is recorded
else (D), the original form equates <amess>

void Interface_Check::AddFail ( const Message_Msg amsg)

Records a new Fail from the definition of a Msg (Original+Value)

void Interface_Check::AddWarning ( const Handle< TCollection_HAsciiString > &  amess)

Records a new Warning message

void Interface_Check::AddWarning ( const Handle< TCollection_HAsciiString > &  amess,
const Handle< TCollection_HAsciiString > &  orig 
)

Records a new Warning message under two forms : final,original

void Interface_Check::AddWarning ( const Standard_CString  amess,
const Standard_CString  orig = "" 
)

Records a Warning message given as "warning message" directly
If <orig> is given, a distinct original form is recorded
else (D), the original form equates <amess>

void Interface_Check::AddWarning ( const Message_Msg amsg)

Records a new Warning from the definition of a Msg (Original+Value)

Standard_CString Interface_Check::CFail ( const Standard_Integer  num,
const Standard_Boolean  final = Standard_True 
) const

Same as above, but returns a CString (to be printed ...)
Final form by default, Original form if <final> is False

Standard_CString Interface_Check::CInfoMsg ( const Standard_Integer  num,
const Standard_Boolean  final = Standard_True 
) const

Same as above, but returns a CString (to be printed ...)
Final form by default, Original form if <final> is False

void Interface_Check::Clear ( )

Clears a check, in order to receive informations from transfer
(Messages and Entity)

void Interface_Check::ClearFails ( )

Clears the Fail Messages (for instance to keep only Warnings)

void Interface_Check::ClearInfoMsgs ( )

Clears the Info Messages

void Interface_Check::ClearWarnings ( )

Clears the Warning Messages (for instance to keep only Fails)

Standard_Boolean Interface_Check::Complies ( const Interface_CheckStatus  status) const

Tells if Check Status complies with a given one
(i.e. also status for query)

Standard_Boolean Interface_Check::Complies ( const Handle< TCollection_HAsciiString > &  mess,
const Standard_Integer  incl,
const Interface_CheckStatus  status 
) const

Tells if a message is brought by a Check, as follows :
<incl> = 0 : <mess> exactly matches one of the messages
<incl> < 0 : <mess> is contained by one of the messages
<incl> > 0 : <mess> contains one of the messages
For <status> : for CheckWarning and CheckFail, considers only
resp. Warning or Check messages. for CheckAny, considers all
other values are ignored (answer will be false)

Standard_CString Interface_Check::CWarning ( const Standard_Integer  num,
const Standard_Boolean  final = Standard_True 
) const

Same as above, but returns a CString (to be printed ...)
Final form by default, Original form if <final> is False

const Handle_Standard_Transient& Interface_Check::Entity ( ) const

Returns the entity on which the Check has been defined

const Handle_TCollection_HAsciiString& Interface_Check::Fail ( const Standard_Integer  num,
const Standard_Boolean  final = Standard_True 
) const

Returns Fail Message as a String
Final form by default, Original form if <final> is False

Handle_TColStd_HSequenceOfHAsciiString Interface_Check::Fails ( const Standard_Boolean  final = Standard_True) const

Returns the list of Fails, for a frontal-engine logic
Final forms by default, Original forms if <final> is False
Can be empty

void Interface_Check::GetAsWarning ( const Handle< Interface_Check > &  other,
const Standard_Boolean  failsonly 
)

Copies messages converted into Warning messages
If failsonly is true, only Fails are taken, and converted
else, Warnings are taken too. Does not regard Entity
Used to keep Fail messages as Warning, after a recovery

void Interface_Check::GetEntity ( const Handle< Standard_Transient > &  anentity)

 same as SetEntity (old form kept for compatibility) <br>

Warning : Does nothing if Entity field is not yet clear

void Interface_Check::GetMessages ( const Handle< Interface_Check > &  other)

Copies messages stored in another Check, cumulating
Does not regard other's Entity. Used to cumulate messages

Standard_Boolean Interface_Check::HasEntity ( ) const

Returns True if a Check is devoted to an entity; else, it is
global (for InterfaceModel's storing of global error messages)

Standard_Boolean Interface_Check::HasFailed ( ) const

Returns True if Check brings at least one Fail Message

Standard_Boolean Interface_Check::HasWarnings ( ) const

Returns True if Check brings at least one Warning Message

const Handle_TCollection_HAsciiString& Interface_Check::InfoMsg ( const Standard_Integer  num,
const Standard_Boolean  final = Standard_True 
) const

Returns information message as a String

Handle_TColStd_HSequenceOfHAsciiString Interface_Check::InfoMsgs ( const Standard_Boolean  final = Standard_True) const

Returns the list of Info Msg, for a frontal-engine logic
Final forms by default, Original forms if <final> is False
Can be empty

Standard_Boolean Interface_Check::Mend ( const Standard_CString  pref,
const Standard_Integer  num = 0 
)

Mends messages, according <pref> and <num>
According to <num>, works on the whole list of Fails if = 0(D)
or only one Fail message, given its rank
If <pref> is empty, converts Fail(s) to Warning(s)
Else, does the conversion but prefixes the new Warning(s) but
<pref> followed by a semi-column
Some reserved values of <pref> are :
"FM" : standard prefix "Mended" (can be translated)
"CF" : clears Fail(s)
"CW" : clears Warning(s) : here, <num> refers to Warning list
"CA" : clears all messages : here, <num> is ignored

Standard_Integer Interface_Check::NbFails ( ) const

Returns count of recorded Fails

Standard_Integer Interface_Check::NbInfoMsgs ( ) const

Returns the count of recorded information messages

Standard_Integer Interface_Check::NbWarnings ( ) const

Returns count of recorded Warning messages

void Interface_Check::Print ( const Handle< Message_Messenger > &  S,
const Standard_Integer  level,
const Standard_Integer  final = 1 
) const

Prints the messages of the check to an Messenger
<level> = 1 : only fails
<level> = 2 : fails and warnings
<level> = 3 : all (fails, warnings, info msg)
<final> : if positive (D) prints final values of messages
if negative, prints originals
if null, prints both forms

Standard_Boolean Interface_Check::Remove ( const Handle< TCollection_HAsciiString > &  mess,
const Standard_Integer  incl,
const Interface_CheckStatus  status 
)

Removes the messages which comply with <mess>, as follows :
<incl> = 0 : <mess> exactly matches one of the messages
<incl> < 0 : <mess> is contained by one of the messages
<incl> > 0 : <mess> contains one of the messages
For <status> : for CheckWarning and CheckFail, considers only
resp. Warning or Check messages. for CheckAny, considers all
other values are ignored (nothing is done)
Returns True if at least one message has been removed, False else

void Interface_Check::SendFail ( const Message_Msg amsg)

New name for AddFail (Msg)

void Interface_Check::SendMsg ( const Message_Msg amsg)

Records an information message
This does not change the status of the Check

void Interface_Check::SendWarning ( const Message_Msg amsg)

New name for AddWarning

void Interface_Check::SetEntity ( const Handle< Standard_Transient > &  anentity)

Receives an entity result of a Transfer

Interface_CheckStatus Interface_Check::Status ( ) const

Returns the Check Status : OK, Warning or Fail

void Interface_Check::Trace ( const Standard_Integer  level = -1,
const Standard_Integer  final = 1 
) const

Prints the messages of the check to the default trace file
By default, according to the default standard level
Else, according level (see method Print)

const Handle_TCollection_HAsciiString& Interface_Check::Warning ( const Standard_Integer  num,
const Standard_Boolean  final = Standard_True 
) const

Returns Warning message as a String
Final form by default, Original form if <final> is False

Handle_TColStd_HSequenceOfHAsciiString Interface_Check::Warnings ( const Standard_Boolean  final = Standard_True) const

Returns the list of Warnings, for a frontal-engine logic
Final forms by default, Original forms if <final> is False
Can be empty


The documentation for this class was generated from the following file: