Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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). 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)
 
 Interface_Check (const occ::handle< Standard_Transient > &anentity)
 Defines a Check on an Entity.
 
void SendFail (const Message_Msg &amsg)
 New name for AddFail (Msg)
 
void AddFail (const occ::handle< TCollection_HAsciiString > &amess)
 Records a new Fail message.
 
void AddFail (const occ::handle< TCollection_HAsciiString > &amess, const occ::handle< TCollection_HAsciiString > &orig)
 Records a new Fail message under two forms : final,original.
 
void AddFail (const char *const amess, const char *const 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 AddFail (const Message_Msg &amsg)
 Records a new Fail from the definition of a Msg (Original+Value)
 
bool HasFailed () const
 Returns True if Check brings at least one Fail Message.
 
int NbFails () const
 Returns count of recorded Fails.
 
const occ::handle< TCollection_HAsciiString > & Fail (const int num, const bool final=true) const
 Returns Fail Message as a String Final form by default, Original form if <final> is False.
 
const charCFail (const int num, const bool final=true) const
 Same as above, but returns a CString (to be printed ...) Final form by default, Original form if <final> is False.
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > Fails (const bool final=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 SendWarning (const Message_Msg &amsg)
 New name for AddWarning.
 
void AddWarning (const occ::handle< TCollection_HAsciiString > &amess)
 Records a new Warning message.
 
void AddWarning (const occ::handle< TCollection_HAsciiString > &amess, const occ::handle< TCollection_HAsciiString > &orig)
 Records a new Warning message under two forms : final,original.
 
void AddWarning (const char *const amess, const char *const 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 AddWarning (const Message_Msg &amsg)
 Records a new Warning from the definition of a Msg (Original+Value)
 
bool HasWarnings () const
 Returns True if Check brings at least one Warning Message.
 
int NbWarnings () const
 Returns count of recorded Warning messages.
 
const occ::handle< TCollection_HAsciiString > & Warning (const int num, const bool final=true) const
 Returns Warning message as a String Final form by default, Original form if <final> is False.
 
const charCWarning (const int num, const bool final=true) const
 Same as above, but returns a CString (to be printed ...) Final form by default, Original form if <final> is False.
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > Warnings (const bool final=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.
 
void SendMsg (const Message_Msg &amsg)
 Records an information message This does not change the status of the Check.
 
int NbInfoMsgs () const
 Returns the count of recorded information messages.
 
const occ::handle< TCollection_HAsciiString > & InfoMsg (const int num, const bool final=true) const
 Returns information message as a String.
 
const charCInfoMsg (const int num, const bool final=true) const
 Same as above, but returns a CString (to be printed ...) Final form by default, Original form if <final> is False.
 
occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > InfoMsgs (const bool final=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.
 
Interface_CheckStatus Status () const
 Returns the Check Status : OK, Warning or Fail.
 
bool Complies (const Interface_CheckStatus status) const
 Tells if Check Status complies with a given one (i.e. also status for query)
 
bool Complies (const occ::handle< TCollection_HAsciiString > &mess, const int 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)
 
bool HasEntity () const
 Returns True if a Check is devoted to an entity; else, it is global (for InterfaceModel's storing of global error messages)
 
const occ::handle< Standard_Transient > & Entity () const
 Returns the entity on which the Check has been defined.
 
void Clear ()
 Clears a check, in order to receive information from transfer (Messages and Entity)
 
void ClearFails ()
 Clears the Fail Messages (for instance to keep only Warnings)
 
void ClearWarnings ()
 Clears the Warning Messages (for instance to keep only Fails)
 
void ClearInfoMsgs ()
 Clears the Info Messages.
 
bool Remove (const occ::handle< TCollection_HAsciiString > &mess, const int 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.
 
bool Mend (const char *const pref, const int 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.
 
void SetEntity (const occ::handle< Standard_Transient > &anentity)
 Receives an entity result of a Transfer.
 
void GetEntity (const occ::handle< Standard_Transient > &anentity)
 same as SetEntity (old form kept for compatibility) Warning : Does nothing if Entity field is not yet clear
 
void GetMessages (const occ::handle< Interface_Check > &other)
 Copies messages stored in another Check, cumulating Does not regard other's Entity. Used to cumulate messages.
 
void GetAsWarning (const occ::handle< Interface_Check > &other, const bool 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 Print (Standard_OStream &S, const int level, const int 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.
 
void Trace (const int level=-1, const int 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)
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::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.
 
bool IsKind (const char *const 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.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

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() [1/2]

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() [2/2]

Interface_Check::Interface_Check ( const occ::handle< Standard_Transient > & anentity)

Defines a Check on an Entity.

Member Function Documentation

◆ AddFail() [1/4]

void Interface_Check::AddFail ( const char *const amess,
const char *const 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>

◆ AddFail() [2/4]

void Interface_Check::AddFail ( const Message_Msg & amsg)

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

◆ AddFail() [3/4]

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

Records a new Fail message.

◆ AddFail() [4/4]

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

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

◆ AddWarning() [1/4]

void Interface_Check::AddWarning ( const char *const amess,
const char *const 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>

◆ AddWarning() [2/4]

void Interface_Check::AddWarning ( const Message_Msg & amsg)

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

◆ AddWarning() [3/4]

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

Records a new Warning message.

◆ AddWarning() [4/4]

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

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

◆ CFail()

const char * Interface_Check::CFail ( const int num,
const bool final = true ) const

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

◆ CInfoMsg()

const char * Interface_Check::CInfoMsg ( const int num,
const bool final = true ) const

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

◆ Clear()

void Interface_Check::Clear ( )

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

◆ ClearFails()

void Interface_Check::ClearFails ( )

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

◆ ClearInfoMsgs()

void Interface_Check::ClearInfoMsgs ( )

Clears the Info Messages.

◆ ClearWarnings()

void Interface_Check::ClearWarnings ( )

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

◆ Complies() [1/2]

bool Interface_Check::Complies ( const Interface_CheckStatus status) const

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

◆ Complies() [2/2]

bool Interface_Check::Complies ( const occ::handle< TCollection_HAsciiString > & mess,
const int 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)

◆ CWarning()

const char * Interface_Check::CWarning ( const int num,
const bool final = true ) const

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

◆ Entity()

const occ::handle< Standard_Transient > & Interface_Check::Entity ( ) const

Returns the entity on which the Check has been defined.

◆ Fail()

const occ::handle< TCollection_HAsciiString > & Interface_Check::Fail ( const int num,
const bool final = true ) const

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

◆ Fails()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > Interface_Check::Fails ( const bool final = 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.

◆ GetAsWarning()

void Interface_Check::GetAsWarning ( const occ::handle< Interface_Check > & other,
const bool 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.

◆ GetEntity()

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

same as SetEntity (old form kept for compatibility) Warning : Does nothing if Entity field is not yet clear

◆ GetMessages()

void Interface_Check::GetMessages ( const occ::handle< Interface_Check > & other)

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

◆ HasEntity()

bool 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)

◆ HasFailed()

bool Interface_Check::HasFailed ( ) const

Returns True if Check brings at least one Fail Message.

◆ HasWarnings()

bool Interface_Check::HasWarnings ( ) const

Returns True if Check brings at least one Warning Message.

◆ InfoMsg()

const occ::handle< TCollection_HAsciiString > & Interface_Check::InfoMsg ( const int num,
const bool final = true ) const

Returns information message as a String.

◆ InfoMsgs()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > Interface_Check::InfoMsgs ( const bool final = 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.

◆ Mend()

bool Interface_Check::Mend ( const char *const pref,
const int 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.

◆ NbFails()

int Interface_Check::NbFails ( ) const

Returns count of recorded Fails.

◆ NbInfoMsgs()

int Interface_Check::NbInfoMsgs ( ) const

Returns the count of recorded information messages.

◆ NbWarnings()

int Interface_Check::NbWarnings ( ) const

Returns count of recorded Warning messages.

◆ Print()

void Interface_Check::Print ( Standard_OStream & S,
const int level,
const int 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.

◆ Remove()

bool Interface_Check::Remove ( const occ::handle< TCollection_HAsciiString > & mess,
const int 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.

◆ SendFail()

void Interface_Check::SendFail ( const Message_Msg & amsg)

New name for AddFail (Msg)

◆ SendMsg()

void Interface_Check::SendMsg ( const Message_Msg & amsg)

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

◆ SendWarning()

void Interface_Check::SendWarning ( const Message_Msg & amsg)

New name for AddWarning.

◆ SetEntity()

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

Receives an entity result of a Transfer.

◆ Status()

Interface_CheckStatus Interface_Check::Status ( ) const

Returns the Check Status : OK, Warning or Fail.

◆ Trace()

void Interface_Check::Trace ( const int level = -1,
const int 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)

◆ Warning()

const occ::handle< TCollection_HAsciiString > & Interface_Check::Warning ( const int num,
const bool final = true ) const

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

◆ Warnings()

occ::handle< NCollection_HSequence< occ::handle< TCollection_HAsciiString > > > Interface_Check::Warnings ( const bool final = 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: