OCCT3D OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    Interface_STAT Class Reference

    This class manages statistics to be queried asynchronously. Way of use : An operator describes a STAT form then fills it according to its progression. This produces a state of advancement of the process. This state can then be queried asynchronously : typically it is summarised as a percentage. There are also an identification of the current state, and information on processed volume. More...

    #include <Interface_STAT.hxx>

    Public Member Functions

     Interface_STAT (const char *const title="")
     Creates a STAT form. At start, one default phase is defined, with one default step. Then, it suffises to start with a count of items (and cycles if several) then record items, to have a queryable report.
     Interface_STAT (const Interface_STAT &other)
     used when starting
    Interface_STAToperator= (const Interface_STAT &theOther)
     Assignment.
    void Internals (occ::handle< TCollection_HAsciiString > &tit, double &total, occ::handle< NCollection_HSequence< TCollection_AsciiString > > &phn, occ::handle< NCollection_HSequence< double > > &phw, occ::handle< NCollection_HSequence< int > > &phdeb, occ::handle< NCollection_HSequence< int > > &phfin, occ::handle< NCollection_HSequence< double > > &stw) const
     Returns fields in once, without copying them, used for copy when starting.
    void AddPhase (const double weightweight, const char *const namename="")
     Adds a new phase to the description. The first one after Create replaces the default unique one.
    void AddStep (const double weightweight=1)
     Adds a new step for the last added phase, the default unique one if no AddPhase has already been added Warning : AddStep before the first AddPhase are cancelled.
    void Description (int &nbphases, double &total, const char *&title) const
     Returns global description (cumulated weights of all phases, count of phases,1 for default, and title).
    void Phase (const int numnum, int &n0step, int &nbstep, double &weightweight, const char *&namename) const
     Returns description of a phase, given its rank (n0 for first step, count of steps, default gives one; weight, name).
    double Step (const int numnum) const
     Returns weight of a Step, related to the cumul given for the phase. <num> is given by <n0step> + i, i between 1 and <nbsteps> (default gives n0step < 0 then weight is one).
    void Start (const int items, const int cycles=1) const
     Starts a STAT on its first phase (or its default one) <items> gives the total count of items, <cycles> the count of cycles If <cycles> is more than one, the first Cycle must then be started by NextCycle (NextStep/NextItem are ignored). If it is one, NextItem/NextStep can then be called.

    Static Public Member Functions

    static void StartCount (const int items, const char *const title="")
     Starts a default STAT, with no phase, no step, ready to just count items. <items> gives the total count of items Hence, NextItem is available to directly count.
    static void NextPhase (const int items, const int cycles=1)
     Commands to resume the preceding phase and start a new one <items> and <cycles> as for Start, but for this new phase Ignored if count of phases is already passed If <cycles> is more than one, the first Cycle must then be started by NextCycle (NextStep/NextItem are ignored). If it is one, NextItem/NextStep can then be called.
    static void SetPhase (const int items, const int cycles=1)
     Changes the parameters of the phase to start To be used before first counting (i.e. just after NextPhase) Can be used by an operator which has to reajust counts on run.
    static void NextCycle (const int items)
     Commands to resume the preceding cycle and start a new one, with a count of items Ignored if count of cycles is already passed Then, first step is started (or default one) NextItem can be called for the first step, or NextStep to pass to the next one.
    static void NextStep ()
     Commands to resume the preceding step of the cycle Ignored if count of steps is already passed NextItem can be called for this step, NextStep passes to next.
    static void NextItem (const int nbitems=1)
     Commands to add an item in the current step of the current cycle of the current phase By default, one item per call, can be overpassed Ignored if count of items of this cycle is already passed.
    static void End ()
     Commands to declare the process ended (hence, advancement is forced to 100 %).
    static const char * Where (const bool phase=true)
     Returns an identification of the STAT : <phase> True (D) : the name of the current phase <phase> False : the title of the current STAT.
    static int Percent (const bool phase=false)
     Returns the advancement as a percentage : <phase> True : inside the current phase <phase> False (D) : relative to the whole process.

    Detailed Description

    This class manages statistics to be queried asynchronously. Way of use : An operator describes a STAT form then fills it according to its progression. This produces a state of advancement of the process. This state can then be queried asynchronously : typically it is summarised as a percentage. There are also an identification of the current state, and information on processed volume.

    A STAT form can be described once for all (as static). It describes the stream of the process (see later), in terms of phases, cycles, steps, with estimated weights. But it brings no current data.

    One STAT at a time is active for filling and querying. It is used to control phasing, weighting ... Specific data for execution are given when running on active STAT : counts of items ... Data for query are then recorded and can be accessed at any time, asynchronously.

    A STAT is organised as follows :

    • it can be split into PHASES (by default, there is none, and all process takes place in one "default" phase)
    • each phase is identified by a name and is attached a weight -> the sum of the weights is used to compute relative weights
    • for each phase, or for the unique default phase if none : – the process works on a list of ITEMS – by default, all the items are processed in once – but this list can be split into CYCLES, each one takes a sub-list : the weight of each cycle is related to its count of items – a cycle can be split into STEPS, by default there are none then one "default step" is considered – each step is attached a weight -> the sum of the weights of steps is used to compute relative weights of the steps in each cycle -> all the cycles of a phase have the same organisation

    Hence, when defining the STAT form, the phases have to be described. If no weight is precisely known, give 1. for all... No phase description will give only one "default" phase For each phase, a typical cycle can be described by its steps. Here too, for no weight precisely known, give 1. for all...

    For executing, activate a STAT to begin count. Give counts of items and cycles for the first phase (for the unique default one if no phasing is described) Else, give count of items and cycles for each new phase. Class methods allow also to set next cycle (given count of items), next step in cycle (if more then one), next item in step.

    Constructor & Destructor Documentation

    ◆ Interface_STAT() [1/2]

    Interface_STAT::Interface_STAT ( const char *const title = "")

    Creates a STAT form. At start, one default phase is defined, with one default step. Then, it suffises to start with a count of items (and cycles if several) then record items, to have a queryable report.

    ◆ Interface_STAT() [2/2]

    Interface_STAT::Interface_STAT ( const Interface_STAT & other)

    used when starting

    Member Function Documentation

    ◆ AddPhase()

    void Interface_STAT::AddPhase ( const double weight,
    const char *const name = "" )

    Adds a new phase to the description. The first one after Create replaces the default unique one.

    ◆ AddStep()

    void Interface_STAT::AddStep ( const double weight = 1)

    Adds a new step for the last added phase, the default unique one if no AddPhase has already been added Warning : AddStep before the first AddPhase are cancelled.

    ◆ Description()

    void Interface_STAT::Description ( int & nbphases,
    double & total,
    const char *& title ) const

    Returns global description (cumulated weights of all phases, count of phases,1 for default, and title).

    ◆ End()

    void Interface_STAT::End ( )
    static

    Commands to declare the process ended (hence, advancement is forced to 100 %).

    ◆ Internals()

    void Interface_STAT::Internals ( occ::handle< TCollection_HAsciiString > & tit,
    double & total,
    occ::handle< NCollection_HSequence< TCollection_AsciiString > > & phn,
    occ::handle< NCollection_HSequence< double > > & phw,
    occ::handle< NCollection_HSequence< int > > & phdeb,
    occ::handle< NCollection_HSequence< int > > & phfin,
    occ::handle< NCollection_HSequence< double > > & stw ) const

    Returns fields in once, without copying them, used for copy when starting.

    ◆ NextCycle()

    void Interface_STAT::NextCycle ( const int items)
    static

    Commands to resume the preceding cycle and start a new one, with a count of items Ignored if count of cycles is already passed Then, first step is started (or default one) NextItem can be called for the first step, or NextStep to pass to the next one.

    ◆ NextItem()

    void Interface_STAT::NextItem ( const int nbitems = 1)
    static

    Commands to add an item in the current step of the current cycle of the current phase By default, one item per call, can be overpassed Ignored if count of items of this cycle is already passed.

    ◆ NextPhase()

    void Interface_STAT::NextPhase ( const int items,
    const int cycles = 1 )
    static

    Commands to resume the preceding phase and start a new one <items> and <cycles> as for Start, but for this new phase Ignored if count of phases is already passed If <cycles> is more than one, the first Cycle must then be started by NextCycle (NextStep/NextItem are ignored). If it is one, NextItem/NextStep can then be called.

    ◆ NextStep()

    void Interface_STAT::NextStep ( )
    static

    Commands to resume the preceding step of the cycle Ignored if count of steps is already passed NextItem can be called for this step, NextStep passes to next.

    ◆ operator=()

    Interface_STAT & Interface_STAT::operator= ( const Interface_STAT & theOther)
    inline

    Assignment.

    ◆ Percent()

    int Interface_STAT::Percent ( const bool phase = false)
    static

    Returns the advancement as a percentage : <phase> True : inside the current phase <phase> False (D) : relative to the whole process.

    ◆ Phase()

    void Interface_STAT::Phase ( const int num,
    int & n0step,
    int & nbstep,
    double & weight,
    const char *& name ) const

    Returns description of a phase, given its rank (n0 for first step, count of steps, default gives one; weight, name).

    ◆ SetPhase()

    void Interface_STAT::SetPhase ( const int items,
    const int cycles = 1 )
    static

    Changes the parameters of the phase to start To be used before first counting (i.e. just after NextPhase) Can be used by an operator which has to reajust counts on run.

    ◆ Start()

    void Interface_STAT::Start ( const int items,
    const int cycles = 1 ) const

    Starts a STAT on its first phase (or its default one) <items> gives the total count of items, <cycles> the count of cycles If <cycles> is more than one, the first Cycle must then be started by NextCycle (NextStep/NextItem are ignored). If it is one, NextItem/NextStep can then be called.

    ◆ StartCount()

    void Interface_STAT::StartCount ( const int items,
    const char *const title = "" )
    static

    Starts a default STAT, with no phase, no step, ready to just count items. <items> gives the total count of items Hence, NextItem is available to directly count.

    ◆ Step()

    double Interface_STAT::Step ( const int num) const

    Returns weight of a Step, related to the cumul given for the phase. <num> is given by <n0step> + i, i between 1 and <nbsteps> (default gives n0step < 0 then weight is one).

    ◆ Where()

    const char * Interface_STAT::Where ( const bool phase = true)
    static

    Returns an identification of the STAT : <phase> True (D) : the name of the current phase <phase> False : the title of the current STAT.


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