mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0026595: Lost some comments in OCCT-code after cdl elimination
Recovered comments for instance classes from CDL generic classes.
This commit is contained in:
@@ -47,20 +47,51 @@ public:
|
||||
|
||||
Standard_EXPORT Transfer_ActorOfProcessForFinder();
|
||||
|
||||
//! Prerequesite for Transfer : the method Transfer is
|
||||
//! called on a starting object only if Recognize has
|
||||
//! returned True on it
|
||||
//! This allows to define a list of Actors, each one
|
||||
//! processing a definite kind of data
|
||||
//! TransferProcess calls Recognize on each one before
|
||||
//! calling Transfer. But even if Recognize has returned
|
||||
//! True, Transfer can reject by returning a Null Binder
|
||||
//! (afterwards rejection), the next actor is then invoked
|
||||
//!
|
||||
//! The provided default returns True, can be redefined
|
||||
Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! Specific action of Transfer. The Result is stored in
|
||||
//! the returned Binder, or a Null Handle for "No result"
|
||||
//! (Default defined as doing nothing; should be deffered)
|
||||
//! "mutable" allows the Actor to record intermediate
|
||||
//! information, in addition to those of TransferProcess
|
||||
Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& start, const Handle(Transfer_ProcessForFinder)& TP);
|
||||
|
||||
//! Prepares and Returns a Binder for a Transient Result
|
||||
//! Returns a Null Handle if <res> is itself Null
|
||||
Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult (const Handle(Standard_Transient)& res) const;
|
||||
|
||||
//! Returns a Binder for No Result, i.e. a Null Handle
|
||||
Standard_EXPORT Handle(Transfer_Binder) NullResult() const;
|
||||
|
||||
//! If <mode> is True, commands an Actor to be set at the
|
||||
//! end of the list of Actors (see SetNext)
|
||||
//! If it is False (creation default), each add Actor is
|
||||
//! set at the beginning of the list
|
||||
//! This allows to define default Actors (which are Last)
|
||||
Standard_EXPORT void SetLast (const Standard_Boolean mode = Standard_True);
|
||||
|
||||
//! Returns the Last status (see SetLast).
|
||||
Standard_EXPORT Standard_Boolean IsLast() const;
|
||||
|
||||
//! Defines a Next Actor : it can then be asked to work if
|
||||
//! <me> produces no result for a given type of Object.
|
||||
//! If Next is already set and is not "Last", calls
|
||||
//! SetNext on it. If Next defined and "Last", the new
|
||||
//! actor is added before it in the list
|
||||
Standard_EXPORT void SetNext (const Handle(Transfer_ActorOfProcessForFinder)& next);
|
||||
|
||||
//! Returns the Actor defined as Next, or a Null Handle
|
||||
Standard_EXPORT Handle(Transfer_ActorOfProcessForFinder) Next() const;
|
||||
|
||||
|
||||
|
@@ -46,20 +46,51 @@ public:
|
||||
|
||||
Standard_EXPORT Transfer_ActorOfProcessForTransient();
|
||||
|
||||
//! Prerequesite for Transfer : the method Transfer is
|
||||
//! called on a starting object only if Recognize has
|
||||
//! returned True on it
|
||||
//! This allows to define a list of Actors, each one
|
||||
//! processing a definite kind of data
|
||||
//! TransferProcess calls Recognize on each one before
|
||||
//! calling Transfer. But even if Recognize has returned
|
||||
//! True, Transfer can reject by returning a Null Binder
|
||||
//! (afterwards rejection), the next actor is then invoked
|
||||
//!
|
||||
//! The provided default returns True, can be redefined
|
||||
Standard_EXPORT virtual Standard_Boolean Recognize (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! Specific action of Transfer. The Result is stored in
|
||||
//! the returned Binder, or a Null Handle for "No result"
|
||||
//! (Default defined as doing nothing; should be deffered)
|
||||
//! "mutable" allows the Actor to record intermediate
|
||||
//! information, in addition to those of TransferProcess
|
||||
Standard_EXPORT virtual Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start, const Handle(Transfer_ProcessForTransient)& TP);
|
||||
|
||||
//! Prepares and Returns a Binder for a Transient Result
|
||||
//! Returns a Null Handle if <res> is itself Null
|
||||
Standard_EXPORT Handle(Transfer_SimpleBinderOfTransient) TransientResult (const Handle(Standard_Transient)& res) const;
|
||||
|
||||
//! Returns a Binder for No Result, i.e. a Null Handle
|
||||
Standard_EXPORT Handle(Transfer_Binder) NullResult() const;
|
||||
|
||||
//! If <mode> is True, commands an Actor to be set at the
|
||||
//! end of the list of Actors (see SetNext)
|
||||
//! If it is False (creation default), each add Actor is
|
||||
//! set at the beginning of the list
|
||||
//! This allows to define default Actors (which are Last)
|
||||
Standard_EXPORT void SetLast (const Standard_Boolean mode = Standard_True);
|
||||
|
||||
//! Returns the Last status (see SetLast).
|
||||
Standard_EXPORT Standard_Boolean IsLast() const;
|
||||
|
||||
//! Defines a Next Actor : it can then be asked to work if
|
||||
//! <me> produces no result for a given type of Object.
|
||||
//! If Next is already set and is not "Last", calls
|
||||
//! SetNext on it. If Next defined and "Last", the new
|
||||
//! actor is added before it in the list
|
||||
Standard_EXPORT void SetNext (const Handle(Transfer_ActorOfProcessForTransient)& next);
|
||||
|
||||
//! Returns the Actor defined as Next, or a Null Handle
|
||||
Standard_EXPORT Handle(Transfer_ActorOfProcessForTransient) Next() const;
|
||||
|
||||
|
||||
|
@@ -42,16 +42,33 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty Iterator
|
||||
//! if withstarts is True, each Binder to be iterated will
|
||||
//! be associated to its corresponding Starting Object
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForFinder(const Standard_Boolean withstarts);
|
||||
|
||||
//! Adds a Binder to the iteration list (construction)
|
||||
//! with no corresponding Starting Object
|
||||
//! (note that Result is brought by Binder)
|
||||
Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder);
|
||||
|
||||
//! Adds a Binder to the iteration list, associated with
|
||||
//! its corresponding Starting Object "start"
|
||||
//! Starting Object is ignored if not required at
|
||||
//! Creation time
|
||||
Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder, const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! After having added all items, keeps or rejects items
|
||||
//! which are attached to starting data given by <only>
|
||||
//! <keep> = True (D) : keeps. <keep> = False : rejects
|
||||
//! Does nothing if <withstarts> was False
|
||||
Standard_EXPORT void Filter (const Handle(Transfer_HSequenceOfFinder)& list, const Standard_Boolean keep = Standard_True);
|
||||
|
||||
//! Returns True if Starting Object is available
|
||||
//! (defined at Creation Time)
|
||||
Standard_EXPORT Standard_Boolean HasStarting() const;
|
||||
|
||||
//! Returns corresponding Starting Object
|
||||
Standard_EXPORT const Handle(Transfer_Finder)& Starting() const;
|
||||
|
||||
|
||||
|
@@ -42,16 +42,33 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Creates an empty Iterator
|
||||
//! if withstarts is True, each Binder to be iterated will
|
||||
//! be associated to its corresponding Starting Object
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForTransient(const Standard_Boolean withstarts);
|
||||
|
||||
//! Adds a Binder to the iteration list (construction)
|
||||
//! with no corresponding Starting Object
|
||||
//! (note that Result is brought by Binder)
|
||||
Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder);
|
||||
|
||||
//! Adds a Binder to the iteration list, associated with
|
||||
//! its corresponding Starting Object "start"
|
||||
//! Starting Object is ignored if not required at
|
||||
//! Creation time
|
||||
Standard_EXPORT void Add (const Handle(Transfer_Binder)& binder, const Handle(Standard_Transient)& start);
|
||||
|
||||
//! After having added all items, keeps or rejects items
|
||||
//! which are attached to starting data given by <only>
|
||||
//! <keep> = True (D) : keeps. <keep> = False : rejects
|
||||
//! Does nothing if <withstarts> was False
|
||||
Standard_EXPORT void Filter (const Handle(TColStd_HSequenceOfTransient)& list, const Standard_Boolean keep = Standard_True);
|
||||
|
||||
//! Returns True if Starting Object is available
|
||||
//! (defined at Creation Time)
|
||||
Standard_EXPORT Standard_Boolean HasStarting() const;
|
||||
|
||||
//! Returns corresponding Starting Object
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Starting() const;
|
||||
|
||||
|
||||
|
@@ -55,134 +55,356 @@ class Transfer_ProcessForFinder : public MMgt_TShared
|
||||
public:
|
||||
|
||||
|
||||
//! 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).
|
||||
Standard_EXPORT Transfer_ProcessForFinder(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.
|
||||
Standard_EXPORT Transfer_ProcessForFinder(const Handle(Message_Messenger)& printer, const Standard_Integer nb = 10000);
|
||||
|
||||
//! Resets a TransferProcess as ready for a completely new work.
|
||||
//! Clears general data (roots) and the Map
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void Clean();
|
||||
|
||||
//! Resizes the Map as required (if a new reliable value has been
|
||||
//! determined). Acts only if <nb> is greater than actual NbMapped
|
||||
Standard_EXPORT void Resize (const Standard_Integer nb);
|
||||
|
||||
//! Defines an Actor, which is used for automatic Transfer
|
||||
//! If already defined, the new Actor is cumulated
|
||||
//! (see SetNext from Actor)
|
||||
Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfProcessForFinder)& actor);
|
||||
|
||||
//! Returns the defined Actor. Returns a Null Handle if
|
||||
//! not set.
|
||||
Standard_EXPORT Handle(Transfer_ActorOfProcessForFinder) Actor() 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
|
||||
Standard_EXPORT Handle(Transfer_Binder) Find (const Handle(Transfer_Finder)& 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
|
||||
Standard_EXPORT Standard_Boolean IsBound (const Handle(Transfer_Finder)& 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
|
||||
Standard_EXPORT Standard_Boolean IsAlreadyUsed (const Handle(Transfer_Finder)& start) const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void Bind (const Handle(Transfer_Finder)& 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
|
||||
Standard_EXPORT void Rebind (const Handle(Transfer_Finder)& start, const Handle(Transfer_Binder)& binder);
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT Standard_Boolean Unbind (const Handle(Transfer_Finder)& 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
|
||||
Standard_EXPORT Handle(Transfer_Binder) FindElseBind (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! Sets Messenger used for outputting messages.
|
||||
Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger);
|
||||
|
||||
//! Returns Messenger used for outputting messages.
|
||||
//! The returned object is guaranteed to be non-null;
|
||||
//! default is Message::Messenger().
|
||||
Standard_EXPORT Handle(Message_Messenger) Messenger() const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev);
|
||||
|
||||
//! Returns trace level used for outputting messages.
|
||||
Standard_EXPORT Standard_Integer TraceLevel() const;
|
||||
|
||||
//! New name for AddFail (Msg)
|
||||
Standard_EXPORT void SendFail (const Handle(Transfer_Finder)& start, const Message_Msg& amsg);
|
||||
|
||||
//! New name for AddWarning (Msg)
|
||||
Standard_EXPORT void SendWarning (const Handle(Transfer_Finder)& start, const Message_Msg& amsg);
|
||||
|
||||
//! Adds an information message
|
||||
//! Trace is filled if trace level is at least 3
|
||||
Standard_EXPORT void SendMsg (const Handle(Transfer_Finder)& start, const Message_Msg& amsg);
|
||||
|
||||
//! Adds an Error message to a starting entity (to the check of
|
||||
//! its Binder of category 0, as a Fail)
|
||||
Standard_EXPORT void AddFail (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = "");
|
||||
|
||||
//! (other name of AddFail, maintained for compatibility)
|
||||
Standard_EXPORT void AddError (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = "");
|
||||
|
||||
//! Adds an Error Message to a starting entity from the definition
|
||||
//! of a Msg (Original+Value)
|
||||
Standard_EXPORT void AddFail (const Handle(Transfer_Finder)& start, const Message_Msg& amsg);
|
||||
|
||||
//! Adds a Warning message to a starting entity (to the check of
|
||||
//! its Binder of category 0)
|
||||
Standard_EXPORT void AddWarning (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = "");
|
||||
|
||||
//! Adds a Warning Message to a starting entity from the definition
|
||||
//! of a Msg (Original+Value)
|
||||
Standard_EXPORT void AddWarning (const Handle(Transfer_Finder)& start, const Message_Msg& amsg);
|
||||
|
||||
Standard_EXPORT void Mend (const Handle(Transfer_Finder)& start, const Standard_CString pref = "");
|
||||
|
||||
//! 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
|
||||
//!
|
||||
//! for (num = TP->NextItemWithAttribute(name,0);
|
||||
//! num > 0;
|
||||
//! num = TP->NextItemWithAttribute(name,num) {
|
||||
//! .. process mapped item <num>
|
||||
//! }
|
||||
//! Returns the type of an Attribute attached to binders
|
||||
//! If this name gives no Attribute, returns ParamVoid
|
||||
//! If this name gives several different types, returns ParamMisc
|
||||
//! Else, returns the effective type (ParamInteger, ParamReal,
|
||||
//! ParamIdent, or ParamText)
|
||||
//! Returns the list of recorded Attribute Names, as a Dictionary
|
||||
//! of Integer : each value gives the count of items which bring
|
||||
//! this attribute name
|
||||
//! By default, considers all the attribute names
|
||||
//! If <rootname> is given, considers only the attribute names
|
||||
//! which begin by <rootname>
|
||||
Standard_EXPORT Handle(Interface_Check) Check (const Handle(Transfer_Finder)& start) const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void BindTransient (const Handle(Transfer_Finder)& start, const Handle(Standard_Transient)& res);
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT const Handle(Standard_Transient)& FindTransient (const Handle(Transfer_Finder)& start) const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void BindMultiple (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! Adds an item to a list of results bound to a starting object.
|
||||
//! Considers a category number, by default 0, for all results
|
||||
Standard_EXPORT void AddMultiple (const Handle(Transfer_Finder)& start, const Handle(Standard_Transient)& res);
|
||||
|
||||
//! Searches for a transient result attached to a starting object,
|
||||
//! according to its type, by criterium IsKind(atype)
|
||||
//!
|
||||
//! In case of multiple result, explores the list and gives in
|
||||
//! <val> the first transient result IsKind(atype)
|
||||
//! Returns True and fills <val> if found
|
||||
//! Else, returns False (<val> is not touched, not even nullified)
|
||||
//!
|
||||
//! This syntactic form avoids to do DownCast : if a result is
|
||||
//! found with the good type, it is loaded in <val> and can be
|
||||
//! immediately used, well initialised
|
||||
Standard_EXPORT Standard_Boolean FindTypedTransient (const Handle(Transfer_Finder)& start, 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>
|
||||
//!
|
||||
//! This is strictly equivalent to the class method GetTypedResult
|
||||
//! from class SimpleBinderOfTransient, but is just lighter to call
|
||||
//!
|
||||
//! Apart from this, works as FindTypedTransient
|
||||
Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const;
|
||||
|
||||
//! Returns the maximum possible value for Map Index
|
||||
//! (no result can be bound with a value greater than it)
|
||||
Standard_EXPORT Standard_Integer NbMapped() const;
|
||||
|
||||
//! Returns the Starting Object bound to an Index,
|
||||
Standard_EXPORT const Handle(Transfer_Finder)& Mapped (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the Index value bound to a Starting Object, 0 if none
|
||||
Standard_EXPORT Standard_Integer MapIndex (const Handle(Transfer_Finder)& start) const;
|
||||
|
||||
//! Returns the Binder bound to an Index
|
||||
//! Considers a category number, by default 0
|
||||
Standard_EXPORT Handle(Transfer_Binder) MapItem (const Standard_Integer num) const;
|
||||
|
||||
//! Declares <obj> (and its Result) as Root. This status will be
|
||||
//! later exploited by RootResult, see below (Result can be
|
||||
//! produced at any time)
|
||||
Standard_EXPORT void SetRoot (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT void SetRootManagement (const Standard_Boolean stat);
|
||||
|
||||
//! Returns the count of recorded Roots
|
||||
Standard_EXPORT Standard_Integer NbRoots() const;
|
||||
|
||||
//! Returns a Root Entity given its number in the list (1-NbRoots)
|
||||
Standard_EXPORT const Handle(Transfer_Finder)& Root (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the Binder bound with a Root Entity given its number
|
||||
//! Considers a category number, by default 0
|
||||
Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the index in the list of roots for a starting item,
|
||||
//! or 0 if it is not recorded as a root
|
||||
Standard_EXPORT Standard_Integer RootIndex (const Handle(Transfer_Finder)& start) 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.
|
||||
Standard_EXPORT Standard_Integer NestingLevel() const;
|
||||
|
||||
//! Resets Nesting Level of Transfers to Zero (Root Level),
|
||||
//! whatever its current value.
|
||||
Standard_EXPORT void ResetNestingLevel();
|
||||
|
||||
//! Tells if <start> has been recognized as good candidate for
|
||||
//! Transfer. i.e. queries the Actor and its Nexts
|
||||
Standard_EXPORT Standard_Boolean Recognize (const Handle(Transfer_Finder)& start) const;
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! Same as Transferring but does not return the Binder.
|
||||
//! Simply returns True in case of success (for user call)
|
||||
Standard_EXPORT Standard_Boolean Transfer (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void SetErrorHandle (const Standard_Boolean err);
|
||||
|
||||
//! Returns error handling flag
|
||||
Standard_EXPORT Standard_Boolean ErrorHandle() 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
|
||||
Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Integer mode) const;
|
||||
|
||||
//! Prints a short information on a starting object. By default
|
||||
//! prints its Dynamic Type. Can be redefined
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, const Handle(Message_Messenger)& S) 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.
|
||||
Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer alevel) 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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForFinder RootResult (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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForFinder CompleteResult (const Standard_Boolean withstart = Standard_False) 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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForFinder AbnormalResult() 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
|
||||
Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) 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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForFinder ResultOne (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean withstart = Standard_False) const;
|
||||
|
||||
//! Returns a CheckList for one starting object
|
||||
//! <level> interpreted as by ResultOne
|
||||
//! If <erronly> is True, checks with Warnings only are ignored
|
||||
Standard_EXPORT Interface_CheckIterator CheckListOne (const Handle(Transfer_Finder)& 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
|
||||
Standard_EXPORT Standard_Boolean IsCheckListEmpty (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean erronly) const;
|
||||
|
||||
//! 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)
|
||||
Standard_EXPORT void RemoveResult (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean compute = Standard_True);
|
||||
|
||||
//! Computes a number to be associated to a starting object in
|
||||
//! a check or a check-list
|
||||
//! By default, returns 0; can be redefined
|
||||
Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Transfer_Finder)& start) const;
|
||||
|
||||
//! Sets Progress indicator
|
||||
Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress);
|
||||
|
||||
//! Gets Progress indicator
|
||||
Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const;
|
||||
|
||||
|
||||
@@ -198,8 +420,18 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
//! Same as Find but stores the last access to the map, for a
|
||||
//! faster access on next calls (as Bind does too)
|
||||
//! Considers a category number, by default 0
|
||||
//! C++ : return const &
|
||||
Standard_EXPORT Handle(Transfer_Binder) FindAndMask (const Handle(Transfer_Finder)& start);
|
||||
|
||||
//! Internal action of Transfer, called by Transferring, with or
|
||||
//! without ErrorHandle. It invokes the Actor to work (set by
|
||||
//! SetActor), and tries its Nexts if no result is produced,
|
||||
//! until a Non Null Binder is produced.
|
||||
//! But keep in mind that a Null Binder can allways be returned
|
||||
//! if a Starting Entity has not been recognized at all.
|
||||
Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Transfer_Finder)& start);
|
||||
|
||||
Standard_Boolean theerrh;
|
||||
|
@@ -59,134 +59,356 @@ class Transfer_ProcessForTransient : public MMgt_TShared
|
||||
public:
|
||||
|
||||
|
||||
//! 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).
|
||||
Standard_EXPORT 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 a specified printer.
|
||||
Standard_EXPORT Transfer_ProcessForTransient(const Handle(Message_Messenger)& printer, const Standard_Integer nb = 10000);
|
||||
|
||||
//! Resets a TransferProcess as ready for a completely new work.
|
||||
//! Clears general data (roots) and the Map
|
||||
Standard_EXPORT void Clear();
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void Clean();
|
||||
|
||||
//! Resizes the Map as required (if a new reliable value has been
|
||||
//! determined). Acts only if <nb> is greater than actual NbMapped
|
||||
Standard_EXPORT void Resize (const Standard_Integer nb);
|
||||
|
||||
//! Defines an Actor, which is used for automatic Transfer
|
||||
//! If already defined, the new Actor is cumulated
|
||||
//! (see SetNext from Actor)
|
||||
Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfProcessForTransient)& actor);
|
||||
|
||||
//! Returns the defined Actor. Returns a Null Handle if
|
||||
//! not set.
|
||||
Standard_EXPORT Handle(Transfer_ActorOfProcessForTransient) Actor() 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
|
||||
Standard_EXPORT Handle(Transfer_Binder) Find (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
|
||||
Standard_EXPORT Standard_Boolean IsBound (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
|
||||
Standard_EXPORT Standard_Boolean IsAlreadyUsed (const Handle(Standard_Transient)& start) const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void Bind (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
|
||||
Standard_EXPORT void Rebind (const Handle(Standard_Transient)& start, const Handle(Transfer_Binder)& binder);
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT Standard_Boolean Unbind (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
|
||||
Standard_EXPORT Handle(Transfer_Binder) FindElseBind (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! Sets Messenger used for outputting messages.
|
||||
Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger);
|
||||
|
||||
//! Returns Messenger used for outputting messages.
|
||||
//! The returned object is guaranteed to be non-null;
|
||||
//! default is Message::Messenger().
|
||||
Standard_EXPORT Handle(Message_Messenger) Messenger() const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev);
|
||||
|
||||
//! Returns trace level used for outputting messages.
|
||||
Standard_EXPORT Standard_Integer TraceLevel() const;
|
||||
|
||||
//! New name for AddFail (Msg)
|
||||
Standard_EXPORT void SendFail (const Handle(Standard_Transient)& start, const Message_Msg& amsg);
|
||||
|
||||
//! New name for AddWarning (Msg)
|
||||
Standard_EXPORT void SendWarning (const Handle(Standard_Transient)& start, const Message_Msg& amsg);
|
||||
|
||||
//! Adds an information message
|
||||
//! Trace is filled if trace level is at least 3
|
||||
Standard_EXPORT void SendMsg (const Handle(Standard_Transient)& start, const Message_Msg& amsg);
|
||||
|
||||
//! Adds an Error message to a starting entity (to the check of
|
||||
//! its Binder of category 0, as a Fail)
|
||||
Standard_EXPORT void AddFail (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = "");
|
||||
|
||||
//! (other name of AddFail, maintained for compatibility)
|
||||
Standard_EXPORT void AddError (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = "");
|
||||
|
||||
//! Adds an Error Message to a starting entity from the definition
|
||||
//! of a Msg (Original+Value)
|
||||
Standard_EXPORT void AddFail (const Handle(Standard_Transient)& start, const Message_Msg& amsg);
|
||||
|
||||
//! Adds a Warning message to a starting entity (to the check of
|
||||
//! its Binder of category 0)
|
||||
Standard_EXPORT void AddWarning (const Handle(Standard_Transient)& start, const Standard_CString mess, const Standard_CString orig = "");
|
||||
|
||||
//! Adds a Warning Message to a starting entity from the definition
|
||||
//! of a Msg (Original+Value)
|
||||
Standard_EXPORT void AddWarning (const Handle(Standard_Transient)& start, const Message_Msg& amsg);
|
||||
|
||||
Standard_EXPORT void Mend (const Handle(Standard_Transient)& start, const Standard_CString pref = "");
|
||||
|
||||
//! 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
|
||||
//!
|
||||
//! for (num = TP->NextItemWithAttribute(name,0);
|
||||
//! num > 0;
|
||||
//! num = TP->NextItemWithAttribute(name,num) {
|
||||
//! .. process mapped item <num>
|
||||
//! }
|
||||
//! Returns the type of an Attribute attached to binders
|
||||
//! If this name gives no Attribute, returns ParamVoid
|
||||
//! If this name gives several different types, returns ParamMisc
|
||||
//! Else, returns the effective type (ParamInteger, ParamReal,
|
||||
//! ParamIdent, or ParamText)
|
||||
//! Returns the list of recorded Attribute Names, as a Dictionary
|
||||
//! of Integer : each value gives the count of items which bring
|
||||
//! this attribute name
|
||||
//! By default, considers all the attribute names
|
||||
//! If <rootname> is given, considers only the attribute names
|
||||
//! which begin by <rootname>
|
||||
Standard_EXPORT Handle(Interface_Check) Check (const Handle(Standard_Transient)& start) const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void BindTransient (const Handle(Standard_Transient)& start, const Handle(Standard_Transient)& res);
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT const Handle(Standard_Transient)& FindTransient (const Handle(Standard_Transient)& start) const;
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void BindMultiple (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! Adds an item to a list of results bound to a starting object.
|
||||
//! Considers a category number, by default 0, for all results
|
||||
Standard_EXPORT void AddMultiple (const Handle(Standard_Transient)& start, const Handle(Standard_Transient)& res);
|
||||
|
||||
//! Searches for a transient result attached to a starting object,
|
||||
//! according to its type, by criterium IsKind(atype)
|
||||
//!
|
||||
//! In case of multiple result, explores the list and gives in
|
||||
//! <val> the first transient result IsKind(atype)
|
||||
//! Returns True and fills <val> if found
|
||||
//! Else, returns False (<val> is not touched, not even nullified)
|
||||
//!
|
||||
//! This syntactic form avoids to do DownCast : if a result is
|
||||
//! found with the good type, it is loaded in <val> and can be
|
||||
//! immediately used, well initialised
|
||||
Standard_EXPORT Standard_Boolean FindTypedTransient (const Handle(Standard_Transient)& start, 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>
|
||||
//!
|
||||
//! This is strictly equivalent to the class method GetTypedResult
|
||||
//! from class SimpleBinderOfTransient, but is just lighter to call
|
||||
//!
|
||||
//! Apart from this, works as FindTypedTransient
|
||||
Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const;
|
||||
|
||||
//! Returns the maximum possible value for Map Index
|
||||
//! (no result can be bound with a value greater than it)
|
||||
Standard_EXPORT Standard_Integer NbMapped() const;
|
||||
|
||||
//! Returns the Starting Object bound to an Index,
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Mapped (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the Index value bound to a Starting Object, 0 if none
|
||||
Standard_EXPORT Standard_Integer MapIndex (const Handle(Standard_Transient)& start) const;
|
||||
|
||||
//! Returns the Binder bound to an Index
|
||||
//! Considers a category number, by default 0
|
||||
Standard_EXPORT Handle(Transfer_Binder) MapItem (const Standard_Integer num) const;
|
||||
|
||||
//! Declares <obj> (and its Result) as Root. This status will be
|
||||
//! later exploited by RootResult, see below (Result can be
|
||||
//! produced at any time)
|
||||
Standard_EXPORT void SetRoot (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT void SetRootManagement (const Standard_Boolean stat);
|
||||
|
||||
//! Returns the count of recorded Roots
|
||||
Standard_EXPORT Standard_Integer NbRoots() const;
|
||||
|
||||
//! Returns a Root Entity given its number in the list (1-NbRoots)
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Root (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the Binder bound with a Root Entity given its number
|
||||
//! Considers a category number, by default 0
|
||||
Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer num) const;
|
||||
|
||||
//! Returns the index in the list of roots for a starting item,
|
||||
//! or 0 if it is not recorded as a root
|
||||
Standard_EXPORT Standard_Integer RootIndex (const Handle(Standard_Transient)& start) 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.
|
||||
Standard_EXPORT Standard_Integer NestingLevel() const;
|
||||
|
||||
//! Resets Nesting Level of Transfers to Zero (Root Level),
|
||||
//! whatever its current value.
|
||||
Standard_EXPORT void ResetNestingLevel();
|
||||
|
||||
//! Tells if <start> has been recognized as good candidate for
|
||||
//! Transfer. i.e. queries the Actor and its Nexts
|
||||
Standard_EXPORT Standard_Boolean Recognize (const Handle(Standard_Transient)& start) const;
|
||||
|
||||
//! 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.
|
||||
Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! Same as Transferring but does not return the Binder.
|
||||
//! Simply returns True in case of success (for user call)
|
||||
Standard_EXPORT Standard_Boolean Transfer (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! 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
|
||||
Standard_EXPORT void SetErrorHandle (const Standard_Boolean err);
|
||||
|
||||
//! Returns error handling flag
|
||||
Standard_EXPORT Standard_Boolean ErrorHandle() 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
|
||||
Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Integer mode) const;
|
||||
|
||||
//! Prints a short information on a starting object. By default
|
||||
//! prints its Dynamic Type. Can be redefined
|
||||
Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) 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.
|
||||
Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer alevel) 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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForTransient RootResult (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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForTransient CompleteResult (const Standard_Boolean withstart = Standard_False) 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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForTransient AbnormalResult() 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
|
||||
Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) 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
|
||||
Standard_EXPORT Transfer_IteratorOfProcessForTransient ResultOne (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean withstart = Standard_False) const;
|
||||
|
||||
//! Returns a CheckList for one starting object
|
||||
//! <level> interpreted as by ResultOne
|
||||
//! If <erronly> is True, checks with Warnings only are ignored
|
||||
Standard_EXPORT Interface_CheckIterator CheckListOne (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
|
||||
Standard_EXPORT Standard_Boolean IsCheckListEmpty (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean erronly) const;
|
||||
|
||||
//! 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)
|
||||
Standard_EXPORT void RemoveResult (const Handle(Standard_Transient)& start, const Standard_Integer level, const Standard_Boolean compute = Standard_True);
|
||||
|
||||
//! Computes a number to be associated to a starting object in
|
||||
//! a check or a check-list
|
||||
//! By default, returns 0; can be redefined
|
||||
Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& start) const;
|
||||
|
||||
//! Sets Progress indicator
|
||||
Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress);
|
||||
|
||||
//! Gets Progress indicator
|
||||
Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const;
|
||||
|
||||
|
||||
@@ -202,8 +424,18 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
//! Same as Find but stores the last access to the map, for a
|
||||
//! faster access on next calls (as Bind does too)
|
||||
//! Considers a category number, by default 0
|
||||
//! C++ : return const &
|
||||
Standard_EXPORT Handle(Transfer_Binder) FindAndMask (const Handle(Standard_Transient)& start);
|
||||
|
||||
//! Internal action of Transfer, called by Transferring, with or
|
||||
//! without ErrorHandle. It invokes the Actor to work (set by
|
||||
//! SetActor), and tries its Nexts if no result is produced,
|
||||
//! until a Non Null Binder is produced.
|
||||
//! But keep in mind that a Null Binder can allways be returned
|
||||
//! if a Starting Entity has not been recognized at all.
|
||||
Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Standard_Transient)& start);
|
||||
|
||||
Standard_Boolean theerrh;
|
||||
|
@@ -42,52 +42,105 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an IndexedDataMap with NbBuckets
|
||||
//! (defaulted to 1) buckets.
|
||||
//! Note that the map will be automatically redimensioned
|
||||
//! during its use if the number of entries becomes too large.
|
||||
//! Use:
|
||||
//! - the function Add to add an entry (key, item, index) in the map,
|
||||
//! - operator() to read an item from an index, or to
|
||||
//! assign a new value to this item,
|
||||
//! - the function FindFromKey or ChangeFromKey to
|
||||
//! read an item from a key, or to assign a new value to this item,
|
||||
//! - the function RemoveLast to remove the last entry from the map,
|
||||
//! - and other available edition and querying functions.
|
||||
Standard_EXPORT Transfer_TransferMapOfProcessForFinder(const Standard_Integer NbBuckets = 1);
|
||||
|
||||
//! Replace the content of this map by the content of
|
||||
//! the map <Other>.
|
||||
Standard_EXPORT Transfer_TransferMapOfProcessForFinder& Assign (const Transfer_TransferMapOfProcessForFinder& Other);
|
||||
Transfer_TransferMapOfProcessForFinder& operator = (const Transfer_TransferMapOfProcessForFinder& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
//! Changes the number of buckets of <me> to be
|
||||
//! <NbBuckets>. The entries (key + item + index) already
|
||||
//! stored in this map are maintained.
|
||||
Standard_EXPORT void ReSize (const Standard_Integer NbBuckets);
|
||||
|
||||
//! Removes all keys in the map.
|
||||
Standard_EXPORT void Clear();
|
||||
~Transfer_TransferMapOfProcessForFinder()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
//! Adds the Key <K> to the Map <me>. Returns the
|
||||
//! index of the Key. The key is new in the map if
|
||||
//! Extent has been incremented. The Item <I> is
|
||||
//! stored with the key. If the key was already in the
|
||||
//! map the previous item is not replaced by <I>.
|
||||
Standard_EXPORT Standard_Integer Add (const Handle(Transfer_Finder)& K, const Handle(Transfer_Binder)& I);
|
||||
|
||||
//! Substitutes the Key at index <I> with <K>. <I>
|
||||
//! must be a valid index, <K> must be a new key. <T>
|
||||
//! becomes the Item stored with <K>.
|
||||
//! Trigger: Raises OutOfRange if I < 1 or I > Extent.
|
||||
//! Raises DomainError if Contains(K).
|
||||
Standard_EXPORT void Substitute (const Standard_Integer I, const Handle(Transfer_Finder)& K, const Handle(Transfer_Binder)& T);
|
||||
|
||||
//! Removes the last key entered in the map, i.e the
|
||||
//! key of index Extent().
|
||||
//! I must be a valid index and K must be a new key.
|
||||
//! Exceptions
|
||||
//! - Standard_OutOfRange if the index I is less than 1 or
|
||||
//! greater than the number of entries in this map.
|
||||
//! - Standard_DomainError if the key K is already in this map.
|
||||
Standard_EXPORT void RemoveLast();
|
||||
|
||||
//! Returns True if the key <K> is stored in the map <me>.
|
||||
Standard_EXPORT Standard_Boolean Contains (const Handle(Transfer_Finder)& K) const;
|
||||
|
||||
//! Returns the Key of index <I>.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if I is less than 1 or greater than
|
||||
//! the number of entries in this map.
|
||||
Standard_EXPORT const Handle(Transfer_Finder)& FindKey (const Standard_Integer I) const;
|
||||
|
||||
//! Returns the Item of index <I>.
|
||||
Standard_EXPORT const Handle(Transfer_Binder)& FindFromIndex (const Standard_Integer I) const;
|
||||
const Handle(Transfer_Binder)& operator () (const Standard_Integer I) const
|
||||
{
|
||||
return FindFromIndex(I);
|
||||
}
|
||||
|
||||
//! Returns the Item of index <I>. The Item can be
|
||||
//! modified with the syntax aMap(Index) = newItem.
|
||||
Standard_EXPORT Handle(Transfer_Binder)& ChangeFromIndex (const Standard_Integer I);
|
||||
Handle(Transfer_Binder)& operator () (const Standard_Integer I)
|
||||
{
|
||||
return ChangeFromIndex(I);
|
||||
}
|
||||
|
||||
//! Returns the index of the key <K>.
|
||||
//! Returns 0 if K is not in the map.
|
||||
Standard_EXPORT Standard_Integer FindIndex (const Handle(Transfer_Finder)& K) const;
|
||||
|
||||
//! Returns the Item of the key <K>
|
||||
//! Trigger: Raises NoSuchObject if K is not in the map.
|
||||
Standard_EXPORT const Handle(Transfer_Binder)& FindFromKey (const Handle(Transfer_Finder)& K) const;
|
||||
|
||||
//! Returns the Item of the key <K>
|
||||
//! Trigger: Raises NoSuchObject if K is not in the map.
|
||||
Standard_EXPORT Handle(Transfer_Binder)& ChangeFromKey (const Handle(Transfer_Finder)& K);
|
||||
|
||||
//! Returns the address of Item of the key <K>
|
||||
//! or NULL if K is not in the map.
|
||||
Standard_EXPORT Standard_Address FindFromKey1 (const Handle(Transfer_Finder)& K) const;
|
||||
|
||||
//! Returns the address of Item of the key <K>
|
||||
//! or NULL if K is not in the map.
|
||||
Standard_EXPORT Standard_Address ChangeFromKey1 (const Handle(Transfer_Finder)& K);
|
||||
|
||||
|
||||
@@ -102,6 +155,10 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
//! As copying Map is an expensive operation it is
|
||||
//! incorrect to do it implicitly. This constructor
|
||||
//! will raise an error if the Map is not empty. To copy the
|
||||
//! content of a Map use the Assign method (operator =).
|
||||
Standard_EXPORT Transfer_TransferMapOfProcessForFinder(const Transfer_TransferMapOfProcessForFinder& Other);
|
||||
|
||||
|
||||
|
@@ -42,52 +42,105 @@ public:
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
|
||||
//! Constructs an IndexedDataMap with NbBuckets
|
||||
//! (defaulted to 1) buckets.
|
||||
//! Note that the map will be automatically redimensioned
|
||||
//! during its use if the number of entries becomes too large.
|
||||
//! Use:
|
||||
//! - the function Add to add an entry (key, item, index) in the map,
|
||||
//! - operator() to read an item from an index, or to
|
||||
//! assign a new value to this item,
|
||||
//! - the function FindFromKey or ChangeFromKey to
|
||||
//! read an item from a key, or to assign a new value to this item,
|
||||
//! - the function RemoveLast to remove the last entry from the map,
|
||||
//! - and other available edition and querying functions.
|
||||
Standard_EXPORT Transfer_TransferMapOfProcessForTransient(const Standard_Integer NbBuckets = 1);
|
||||
|
||||
//! Replace the content of this map by the content of
|
||||
//! the map <Other>.
|
||||
Standard_EXPORT Transfer_TransferMapOfProcessForTransient& Assign (const Transfer_TransferMapOfProcessForTransient& Other);
|
||||
Transfer_TransferMapOfProcessForTransient& operator = (const Transfer_TransferMapOfProcessForTransient& Other)
|
||||
{
|
||||
return Assign(Other);
|
||||
}
|
||||
|
||||
//! Changes the number of buckets of <me> to be
|
||||
//! <NbBuckets>. The entries (key + item + index) already
|
||||
//! stored in this map are maintained.
|
||||
Standard_EXPORT void ReSize (const Standard_Integer NbBuckets);
|
||||
|
||||
//! Removes all keys in the map.
|
||||
Standard_EXPORT void Clear();
|
||||
~Transfer_TransferMapOfProcessForTransient()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
//! Adds the Key <K> to the Map <me>. Returns the
|
||||
//! index of the Key. The key is new in the map if
|
||||
//! Extent has been incremented. The Item <I> is
|
||||
//! stored with the key. If the key was already in the
|
||||
//! map the previous item is not replaced by <I>.
|
||||
Standard_EXPORT Standard_Integer Add (const Handle(Standard_Transient)& K, const Handle(Transfer_Binder)& I);
|
||||
|
||||
//! Substitutes the Key at index <I> with <K>. <I>
|
||||
//! must be a valid index, <K> must be a new key. <T>
|
||||
//! becomes the Item stored with <K>.
|
||||
//! Trigger: Raises OutOfRange if I < 1 or I > Extent.
|
||||
//! Raises DomainError if Contains(K).
|
||||
Standard_EXPORT void Substitute (const Standard_Integer I, const Handle(Standard_Transient)& K, const Handle(Transfer_Binder)& T);
|
||||
|
||||
//! Removes the last key entered in the map, i.e the
|
||||
//! key of index Extent().
|
||||
//! I must be a valid index and K must be a new key.
|
||||
//! Exceptions
|
||||
//! - Standard_OutOfRange if the index I is less than 1 or
|
||||
//! greater than the number of entries in this map.
|
||||
//! - Standard_DomainError if the key K is already in this map.
|
||||
Standard_EXPORT void RemoveLast();
|
||||
|
||||
//! Returns True if the key <K> is stored in the map <me>.
|
||||
Standard_EXPORT Standard_Boolean Contains (const Handle(Standard_Transient)& K) const;
|
||||
|
||||
//! Returns the Key of index <I>.
|
||||
//! Exceptions
|
||||
//! Standard_OutOfRange if I is less than 1 or greater than
|
||||
//! the number of entries in this map.
|
||||
Standard_EXPORT const Handle(Standard_Transient)& FindKey (const Standard_Integer I) const;
|
||||
|
||||
//! Returns the Item of index <I>.
|
||||
Standard_EXPORT const Handle(Transfer_Binder)& FindFromIndex (const Standard_Integer I) const;
|
||||
const Handle(Transfer_Binder)& operator () (const Standard_Integer I) const
|
||||
{
|
||||
return FindFromIndex(I);
|
||||
}
|
||||
|
||||
//! Returns the Item of index <I>. The Item can be
|
||||
//! modified with the syntax aMap(Index) = newItem.
|
||||
Standard_EXPORT Handle(Transfer_Binder)& ChangeFromIndex (const Standard_Integer I);
|
||||
Handle(Transfer_Binder)& operator () (const Standard_Integer I)
|
||||
{
|
||||
return ChangeFromIndex(I);
|
||||
}
|
||||
|
||||
//! Returns the index of the key <K>.
|
||||
//! Returns 0 if K is not in the map.
|
||||
Standard_EXPORT Standard_Integer FindIndex (const Handle(Standard_Transient)& K) const;
|
||||
|
||||
//! Returns the Item of the key <K>
|
||||
//! Trigger: Raises NoSuchObject if K is not in the map.
|
||||
Standard_EXPORT const Handle(Transfer_Binder)& FindFromKey (const Handle(Standard_Transient)& K) const;
|
||||
|
||||
//! Returns the Item of the key <K>
|
||||
//! Trigger: Raises NoSuchObject if K is not in the map.
|
||||
Standard_EXPORT Handle(Transfer_Binder)& ChangeFromKey (const Handle(Standard_Transient)& K);
|
||||
|
||||
//! Returns the address of Item of the key <K>
|
||||
//! or NULL if K is not in the map.
|
||||
Standard_EXPORT Standard_Address FindFromKey1 (const Handle(Standard_Transient)& K) const;
|
||||
|
||||
//! Returns the address of Item of the key <K>
|
||||
//! or NULL if K is not in the map.
|
||||
Standard_EXPORT Standard_Address ChangeFromKey1 (const Handle(Standard_Transient)& K);
|
||||
|
||||
|
||||
@@ -102,6 +155,10 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
//! As copying Map is an expensive operation it is
|
||||
//! incorrect to do it implicitly. This constructor
|
||||
//! will raise an error if the Map is not empty. To copy the
|
||||
//! content of a Map use the Assign method (operator =).
|
||||
Standard_EXPORT Transfer_TransferMapOfProcessForTransient(const Transfer_TransferMapOfProcessForTransient& Other);
|
||||
|
||||
|
||||
|
@@ -40,14 +40,25 @@ class Transfer_TransientMapper : public Transfer_Finder
|
||||
public:
|
||||
|
||||
|
||||
//! Creates a Mapper with a Value. This Value can then not be
|
||||
//! changed. It is used by the Hasher to compute the HashCode,
|
||||
//! which will then be stored for an immediate reading.
|
||||
Standard_EXPORT Transfer_TransientMapper(const Handle(Standard_Transient)& akey);
|
||||
|
||||
//! Returns the contained value
|
||||
Standard_EXPORT const Handle(Standard_Transient)& Value() const;
|
||||
|
||||
//! Specific testof equallity : defined as False if <other> has
|
||||
//! not the same true Type, else contents are compared (by
|
||||
//! C++ operator ==)
|
||||
Standard_EXPORT Standard_Boolean Equates (const Handle(Transfer_Finder)& other) const;
|
||||
|
||||
//! Returns the Type of the Value. By default, returns the
|
||||
//! DynamicType of <me>, but can be redefined
|
||||
Standard_EXPORT virtual Handle(Standard_Type) ValueType() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the name of the Type of the Value. Default is name
|
||||
//! of ValueType, unless it is for a non-handled object
|
||||
Standard_EXPORT virtual Standard_CString ValueTypeName() const Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user