Open CASCADE Technology  7.1.0.beta
Public Member Functions

Transfer_TransientProcess Class Reference

Adds specific features to the generic definition : TransientProcess is intended to work from an InterfaceModel to a set of application objects. More...

#include <Transfer_TransientProcess.hxx>

Inheritance diagram for Transfer_TransientProcess:
Inheritance graph
[legend]

Public Member Functions

 Transfer_TransientProcess (const Standard_Integer nb=10000)
 Sets TransientProcess at initial state, with an initial size. More...
 
void SetModel (const Handle< Interface_InterfaceModel > &model)
 Sets an InterfaceModel, used by StartTrace, CheckList, queries on Integrity, to give informations significant for each norm. More...
 
Handle< Interface_InterfaceModelModel () const
 Returns the Model used for StartTrace. More...
 
void SetGraph (const Handle< Interface_HGraph > &HG)
 Sets a Graph : superseedes SetModel if already done. More...
 
Standard_Boolean HasGraph () const
 
Handle< Interface_HGraphHGraph () const
 
const Interface_GraphGraph () const
 
void SetContext (const Standard_CString name, const Handle< Standard_Transient > &ctx)
 Sets a Context : according to receiving appli, to be interpreted by the Actor. More...
 
Standard_Boolean GetContext (const Standard_CString name, const Handle< Standard_Type > &type, Handle< Standard_Transient > &ctx) const
 Returns the Context attached to a name, if set and if it is Kind of the type, else a Null Handle Returns True if OK, False if no Context. More...
 
NCollection_DataMap< TCollection_AsciiString, Handle< Standard_Transient > > & Context ()
 Returns (modifiable) the whole definition of Context Rather for internal use (ex.: preparing and setting in once) More...
 
virtual void PrintTrace (const Handle< Standard_Transient > &start, const Handle< Message_Messenger > &S) const override
 Specific printing to trace an entity : prints label and type (if model is set) More...
 
virtual Standard_Integer CheckNum (const Handle< Standard_Transient > &ent) const override
 Specific number of a starting object for check-list : Number in model. More...
 
Interface_EntityIterator TypedSharings (const Handle< Standard_Transient > &start, const Handle< Standard_Type > &type) const
 Returns the list of sharings entities, AT ANY LEVEL, which are kind of a given type. Calls TypedSharings from Graph Returns an empty list if the Graph has not been aknowledged. More...
 
Standard_Boolean IsDataLoaded (const Handle< Standard_Transient > &ent) const
 Tells if an entity is well loaded from file (even if its data fail on checking, they are present). Mostly often, answers True. Else, there was a syntactic error in the file. A non-loaded entity MAY NOT BE transferred, unless its Report (in the model) is interpreted. More...
 
Standard_Boolean IsDataFail (const Handle< Standard_Transient > &ent) const
 Tells if an entity fails on data checking (load time, syntactic, or semantic check). Normally, should answer False. It is not prudent to try transferring an entity which fails on data checking. More...
 
void PrintStats (const Standard_Integer mode, const Handle< Message_Messenger > &S) const
 Prints statistics on a given output, according mode. More...
 
Handle< TColStd_HSequenceOfTransient > RootsForTransfer ()
 
- Public Member Functions inherited from Transfer_ProcessForTransient
 Transfer_ProcessForTransient (const Standard_Integer nb=10000)
 Sets TransferProcess at initial state. Gives an Initial size (indicative) for the Map when known (default is 10000). Sets default trace file as a printer and default trace level (see Message_TraceFile). More...
 
 Transfer_ProcessForTransient (const Handle< Message_Messenger > &printer, const Standard_Integer nb=10000)
 Sets TransferProcess at initial state. Gives an Initial size (indicative) for the Map when known (default is 10000). Sets a specified printer. More...
 
void Clear ()
 Resets a TransferProcess as ready for a completely new work. Clears general data (roots) and the Map. More...
 
void Clean ()
 Rebuilds the Map and the roots to really remove Unbound items Because Unbind keeps the entity in place, even if not bound Hence, working by checking new items is meaningless if a formerly unbound item is rebound. More...
 
void Resize (const Standard_Integer nb)
 Resizes the Map as required (if a new reliable value has been determined). Acts only if <nb> is greater than actual NbMapped. More...
 
void SetActor (const Handle< Transfer_ActorOfProcessForTransient > &actor)
 Defines an Actor, which is used for automatic Transfer If already defined, the new Actor is cumulated (see SetNext from Actor) More...
 
Handle< Transfer_ActorOfProcessForTransientActor () const
 Returns the defined Actor. Returns a Null Handle if not set. More...
 
Handle< Transfer_BinderFind (const Handle< Standard_Transient > &start) const
 Returns the Binder which is linked with a starting Object It can either bring a Result (Transfer done) or none (for a pre-binding). If no Binder is linked with <start>, returns a Null Handle Considers a category number, by default 0. More...
 
Standard_Boolean IsBound (const Handle< Standard_Transient > &start) const
 Returns True if a Result (whatever its form) is Bound with a starting Object. I.e., if a Binder with a Result set, is linked with it Considers a category number, by default 0. More...
 
Standard_Boolean IsAlreadyUsed (const Handle< Standard_Transient > &start) const
 Returns True if the result of the transfer of an object is already used in other ones. If it is, Rebind cannot change it. Considers a category number, by default 0. More...
 
void Bind (const Handle< Standard_Transient > &start, const Handle< Transfer_Binder > &binder)
 Creates a Link a starting Object with a Binder. This Binder can either bring a Result (effective Binding) or none (it can be set later : pre-binding). Considers a category number, by default 0. More...
 
void Rebind (const Handle< Standard_Transient > &start, const Handle< Transfer_Binder > &binder)
 Changes the Binder linked with a starting Object for its unitary transfer. This it can be useful when the exact form of the result is known once the transfer is widely engaged. This can be done only on first transfer. Considers a category number, by default 0. More...
 
Standard_Boolean Unbind (const Handle< Standard_Transient > &start)
 Removes the Binder linked with a starting object If this Binder brings a non-empty Check, it is replaced by a VoidBinder. Also removes from the list of Roots as required. Returns True if done, False if <start> was not bound Considers a category number, by default 0. More...
 
Handle< Transfer_BinderFindElseBind (const Handle< Standard_Transient > &start)
 Returns a Binder for a starting entity, as follows : Tries to Find the already bound one If none found, creates a VoidBinder and Binds it. More...
 
void SetMessenger (const Handle< Message_Messenger > &messenger)
 Sets Messenger used for outputting messages. More...
 
Handle< Message_MessengerMessenger () const
 Returns Messenger used for outputting messages. The returned object is guaranteed to be non-null; default is Message::Messenger(). More...
 
void SetTraceLevel (const Standard_Integer tracelev)
 Sets trace level used for outputting messages: <trace> = 0 : no trace at all <trace> = 1 : handled exceptions and calls to AddError <trace> = 2 : also calls to AddWarning <trace> = 3 : also traces new Roots (uses method ErrorTrace). Default is 1 : Errors traced. More...
 
Standard_Integer TraceLevel () const
 Returns trace level used for outputting messages. More...
 
void SendFail (const Handle< Standard_Transient > &start, const Message_Msg &amsg)
 New name for AddFail (Msg) More...
 
void SendWarning (const Handle< Standard_Transient > &start, const Message_Msg &amsg)
 New name for AddWarning (Msg) More...
 
void SendMsg (const Handle< Standard_Transient > &start, const Message_Msg &amsg)
 Adds an information message Trace is filled if trace level is at least 3. More...
 
void AddFail (const Handle< Standard_Transient > &start, const Standard_CString mess, const Standard_CString orig="")
 Adds an Error message to a starting entity (to the check of its Binder of category 0, as a Fail) More...
 
void AddError (const Handle< Standard_Transient > &start, const Standard_CString mess, const Standard_CString orig="")
 (other name of AddFail, maintained for compatibility) More...
 
void AddFail (const Handle< Standard_Transient > &start, const Message_Msg &amsg)
 Adds an Error Message to a starting entity from the definition of a Msg (Original+Value) More...
 
void AddWarning (const Handle< Standard_Transient > &start, const Standard_CString mess, const Standard_CString orig="")
 Adds a Warning message to a starting entity (to the check of its Binder of category 0) More...
 
void AddWarning (const Handle< Standard_Transient > &start, const Message_Msg &amsg)
 Adds a Warning Message to a starting entity from the definition of a Msg (Original+Value) More...
 
void Mend (const Handle< Standard_Transient > &start, const Standard_CString pref="")
 
Handle< Interface_CheckCheck (const Handle< Standard_Transient > &start) const
 Returns the Check attached to a starting entity. If <start> is unknown, returns an empty Check Adds a case name to a starting entity Adds a case value to a starting entity Returns the complete case list for an entity. Null Handle if empty In the list of mapped items (between 1 and NbMapped), searches for the first item which follows <num0>(not included) and which has an attribute named <name> Attributes are brought by Binders Hence, allows such an iteration. More...
 
void BindTransient (const Handle< Standard_Transient > &start, const Handle< Standard_Transient > &res)
 Binds a starting object with a Transient Result. Uses a SimpleBinderOfTransient to work. If there is already one but with no Result set, sets its Result. Considers a category number, by default 0. More...
 
const Handle< Standard_Transient > & FindTransient (const Handle< Standard_Transient > &start) const
 Returns the Result of the Transfer of an object <start> as a Transient Result. Returns a Null Handle if there is no Transient Result Considers a category number, by default 0 Warning : Supposes that Binding is done with a SimpleBinderOfTransient. More...
 
void BindMultiple (const Handle< Standard_Transient > &start)
 Prepares an object <start> to be bound with several results. If no Binder is yet attached to <obj>, a MultipleBinder is created, empty. If a Binder is already set, it must accept Multiple Binding. Considers a category number, by default 0. More...
 
void AddMultiple (const Handle< Standard_Transient > &start, const Handle< Standard_Transient > &res)
 Adds an item to a list of results bound to a starting object. Considers a category number, by default 0, for all results. More...
 
Standard_Boolean FindTypedTransient (const Handle< Standard_Transient > &start, const Handle< Standard_Type > &atype, Handle< Standard_Transient > &val) const
 Searches for a transient result attached to a starting object, according to its type, by criterium IsKind(atype) More...
 
Standard_Boolean GetTypedTransient (const Handle< Transfer_Binder > &binder, const Handle< Standard_Type > &atype, Handle< Standard_Transient > &val) const
 Searches for a transient result recorded in a Binder, whatever this Binder is recorded or not in <me> More...
 
Standard_Integer NbMapped () const
 Returns the maximum possible value for Map Index (no result can be bound with a value greater than it) More...
 
const Handle< Standard_Transient > & Mapped (const Standard_Integer num) const
 Returns the Starting Object bound to an Index,. More...
 
Standard_Integer MapIndex (const Handle< Standard_Transient > &start) const
 Returns the Index value bound to a Starting Object, 0 if none. More...
 
Handle< Transfer_BinderMapItem (const Standard_Integer num) const
 Returns the Binder bound to an Index Considers a category number, by default 0. More...
 
void SetRoot (const Handle< Standard_Transient > &start)
 Declares <obj> (and its Result) as Root. This status will be later exploited by RootResult, see below (Result can be produced at any time) More...
 
void SetRootManagement (const Standard_Boolean stat)
 Enable (if <stat> True) or Disables (if <stat> False) Root Management. If it is set, Transfers are considered as stacked (a first Transfer commands other Transfers, and so on) and the Transfers commanded by an external caller are "Root". Remark : SetRoot can be called whatever this status, on every object. Default is set to True. More...
 
Standard_Integer NbRoots () const
 Returns the count of recorded Roots. More...
 
const Handle< Standard_Transient > & Root (const Standard_Integer num) const
 Returns a Root Entity given its number in the list (1-NbRoots) More...
 
Handle< Transfer_BinderRootItem (const Standard_Integer num) const
 Returns the Binder bound with a Root Entity given its number Considers a category number, by default 0. More...
 
Standard_Integer RootIndex (const Handle< Standard_Transient > &start) const
 Returns the index in the list of roots for a starting item, or 0 if it is not recorded as a root. More...
 
Standard_Integer NestingLevel () const
 Returns Nesting Level of Transfers (managed by methods TranscriptWith & Co). Starts to zero. If no automatic Transfer is used, it remains to zero. Zero means Root Level. More...
 
void ResetNestingLevel ()
 Resets Nesting Level of Transfers to Zero (Root Level), whatever its current value. More...
 
Standard_Boolean Recognize (const Handle< Standard_Transient > &start) const
 Tells if <start> has been recognized as good candidate for Transfer. i.e. queries the Actor and its Nexts. More...
 
Handle< Transfer_BinderTransferring (const Handle< Standard_Transient > &start)
 Performs the Transfer of a Starting Object, by calling the method TransferProduct (see below). Mapping and Roots are managed : nothing is done if a Result is already Bound, an exception is raised in case of error. More...
 
Standard_Boolean Transfer (const Handle< Standard_Transient > &start)
 Same as Transferring but does not return the Binder. Simply returns True in case of success (for user call) More...
 
void SetErrorHandle (const Standard_Boolean err)
 Allows controls if exceptions will be handled Transfer Operations <err> False : they are not handled with try {} catch {} <err> True : they are Default is False: no handling performed. More...
 
Standard_Boolean ErrorHandle () const
 Returns error handling flag. More...
 
void StartTrace (const Handle< Transfer_Binder > &binder, const Handle< Standard_Transient > &start, const Standard_Integer level, const Standard_Integer mode) const
 Method called when trace is asked Calls PrintTrace to display information relevant for starting objects (which can be redefined) <level> is Nesting Level of Transfer (0 = root) <mode> controls the way the trace is done : 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root. More...
 
Standard_Boolean IsLooping (const Standard_Integer alevel) const
 Returns True if we are surely in a DeadLoop. Evaluation is not exact, it is a "majorant" which must be computed fast. This "majorant" is : <alevel> greater than NbMapped. More...
 
Transfer_IteratorOfProcessForTransient RootResult (const Standard_Boolean withstart=Standard_False) const
 Returns, as an iterator, the log of root transfer, i.e. the created objects and Binders bound to starting roots If withstart is given True, Starting Objets are also returned. More...
 
Transfer_IteratorOfProcessForTransient CompleteResult (const Standard_Boolean withstart=Standard_False) const
 Returns, as an Iterator, the entire log of transfer (list of created objects and Binders which can bring errors) If withstart is given True, Starting Objets are also returned. More...
 
Transfer_IteratorOfProcessForTransient AbnormalResult () const
 Returns Binders which are neither "Done" nor "Initial", that is Error,Loop or Run (abnormal states at end of Transfer) Starting Objects are given in correspondance in the iterator. More...
 
Interface_CheckIterator CheckList (const Standard_Boolean erronly) const
 Returns a CheckList as a list of Check : each one is for a starting entity which have either check (warning or fail) messages are attached, or are in abnormal state : that case gives a specific message If <erronly> is True, checks with Warnings only are ignored. More...
 
Transfer_IteratorOfProcessForTransient ResultOne (const Handle< Standard_Transient > &start, const Standard_Integer level, const Standard_Boolean withstart=Standard_False) const
 Returns, as an Iterator, the log of transfer for one object <level> = 0 : this object only and if <start> is a scope owner (else, <level> is ignored) : <level> = 1 : object plus its immediate scoped ones <level> = 2 : object plus all its scoped ones. More...
 
Interface_CheckIterator CheckListOne (const Handle< Standard_Transient > &start, const Standard_Integer level, const Standard_Boolean erronly) const
 Returns a CheckList for one starting object <level> interpreted as by ResultOne If <erronly> is True, checks with Warnings only are ignored. More...
 
Standard_Boolean IsCheckListEmpty (const Handle< Standard_Transient > &start, const Standard_Integer level, const Standard_Boolean erronly) const
 Returns True if no check message is attached to a starting object. <level> interpreted as by ResultOne If <erronly> is True, checks with Warnings only are ignored. More...
 
void RemoveResult (const Handle< Standard_Transient > &start, const Standard_Integer level, const Standard_Boolean compute=Standard_True)
 Removes Results attached to (== Unbinds) a given object and, according <level> : <level> = 0 : only it <level> = 1 : it plus its immediately owned sub-results(scope) <level> = 2 : it plus all its owned sub-results(scope) More...
 
void SetProgress (const Handle< Message_ProgressIndicator > &theProgress)
 Sets Progress indicator. More...
 
Handle< Message_ProgressIndicatorGetProgress () const
 Gets Progress indicator. More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const override
 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 const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::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 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. 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...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Additional Inherited Members

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

Detailed Description

Adds specific features to the generic definition : TransientProcess is intended to work from an InterfaceModel to a set of application objects.

Hence, some informations about starting entities can be gotten from the model : for Trace, CheckList, Integrity Status

Constructor & Destructor Documentation

Transfer_TransientProcess::Transfer_TransientProcess ( const Standard_Integer  nb = 10000)

Sets TransientProcess at initial state, with an initial size.

Member Function Documentation

virtual Standard_Integer Transfer_TransientProcess::CheckNum ( const Handle< Standard_Transient > &  ent) const
overridevirtual

Specific number of a starting object for check-list : Number in model.

Reimplemented from Transfer_ProcessForTransient.

NCollection_DataMap<TCollection_AsciiString, Handle< Standard_Transient > >& Transfer_TransientProcess::Context ( )

Returns (modifiable) the whole definition of Context Rather for internal use (ex.: preparing and setting in once)

Standard_Boolean Transfer_TransientProcess::GetContext ( const Standard_CString  name,
const Handle< Standard_Type > &  type,
Handle< Standard_Transient > &  ctx 
) const

Returns the Context attached to a name, if set and if it is Kind of the type, else a Null Handle Returns True if OK, False if no Context.

const Interface_Graph& Transfer_TransientProcess::Graph ( ) const
Standard_Boolean Transfer_TransientProcess::HasGraph ( ) const
Handle< Interface_HGraph > Transfer_TransientProcess::HGraph ( ) const
Standard_Boolean Transfer_TransientProcess::IsDataFail ( const Handle< Standard_Transient > &  ent) const

Tells if an entity fails on data checking (load time, syntactic, or semantic check). Normally, should answer False. It is not prudent to try transferring an entity which fails on data checking.

Standard_Boolean Transfer_TransientProcess::IsDataLoaded ( const Handle< Standard_Transient > &  ent) const

Tells if an entity is well loaded from file (even if its data fail on checking, they are present). Mostly often, answers True. Else, there was a syntactic error in the file. A non-loaded entity MAY NOT BE transferred, unless its Report (in the model) is interpreted.

Handle< Interface_InterfaceModel > Transfer_TransientProcess::Model ( ) const

Returns the Model used for StartTrace.

void Transfer_TransientProcess::PrintStats ( const Standard_Integer  mode,
const Handle< Message_Messenger > &  S 
) const

Prints statistics on a given output, according mode.

virtual void Transfer_TransientProcess::PrintTrace ( const Handle< Standard_Transient > &  start,
const Handle< Message_Messenger > &  S 
) const
overridevirtual

Specific printing to trace an entity : prints label and type (if model is set)

Reimplemented from Transfer_ProcessForTransient.

Handle< TColStd_HSequenceOfTransient > Transfer_TransientProcess::RootsForTransfer ( )
void Transfer_TransientProcess::SetContext ( const Standard_CString  name,
const Handle< Standard_Transient > &  ctx 
)

Sets a Context : according to receiving appli, to be interpreted by the Actor.

void Transfer_TransientProcess::SetGraph ( const Handle< Interface_HGraph > &  HG)

Sets a Graph : superseedes SetModel if already done.

void Transfer_TransientProcess::SetModel ( const Handle< Interface_InterfaceModel > &  model)

Sets an InterfaceModel, used by StartTrace, CheckList, queries on Integrity, to give informations significant for each norm.

Interface_EntityIterator Transfer_TransientProcess::TypedSharings ( const Handle< Standard_Transient > &  start,
const Handle< Standard_Type > &  type 
) const

Returns the list of sharings entities, AT ANY LEVEL, which are kind of a given type. Calls TypedSharings from Graph Returns an empty list if the Graph has not been aknowledged.


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