Open CASCADE Technology 6.6.0
Public Member Functions | Static Public Member Functions
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 informations 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 :
More...

#include <Interface_STAT.hxx>

Public Member Functions

 Interface_STAT (const Standard_CString 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

void Internals (Handle< TCollection_HAsciiString > &tit, Standard_Real &total, Handle< TColStd_HSequenceOfAsciiString > &phn, Handle< TColStd_HSequenceOfReal > &phw, Handle< TColStd_HSequenceOfInteger > &phdeb, Handle< TColStd_HSequenceOfInteger > &phfin, Handle< TColStd_HSequenceOfReal > &stw) const
 Returns fields in once, without copying them, used for copy
when starting

void AddPhase (const Standard_Real weight, const Standard_CString name="")
 Adds a new phase to the description.
The first one after Create replaces the default unique one

void AddStep (const Standard_Real 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

void Description (Standard_Integer &nbphases, Standard_Real &total, Standard_CString &title) const
 Returns global description (cumulated weights of all phases,
count of phases,1 for default, and title)

void Phase (const Standard_Integer num, Standard_Integer &n0step, Standard_Integer &nbstep, Standard_Real &weight, Standard_CString &name) const
 Returns description of a phase, given its rank
(n0 for first step, count of steps, default gives one;
weight, name)

Standard_Real Step (const Standard_Integer 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)

void Start (const Standard_Integer items, const Standard_Integer 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 Standard_Integer items, const Standard_CString 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 Standard_Integer items, const Standard_Integer cycles=1)
 Commands to resume the preceeding 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 Standard_Integer items, const Standard_Integer 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 Standard_Integer items)
 Commands to resume the preceeding 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 preceeding 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 Standard_Integer 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 Standard_CString Where (const Standard_Boolean phase=Standard_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 Standard_Integer Percent (const Standard_Boolean phase=Standard_False)
 Returns the advancement as a percentage :
<phase> True : inside the current phase
<phase> False (D) : relative to the whole process


Detailed Description


Constructor & Destructor Documentation

Interface_STAT::Interface_STAT ( const Standard_CString  title = "")
Interface_STAT::Interface_STAT ( const Interface_STAT other)

Member Function Documentation

void Interface_STAT::AddPhase ( const Standard_Real  weight,
const Standard_CString  name = "" 
)
void Interface_STAT::AddStep ( const Standard_Real  weight = 1)
void Interface_STAT::Description ( Standard_Integer nbphases,
Standard_Real total,
Standard_CString title 
) const
static void Interface_STAT::End ( ) [static]
void Interface_STAT::Internals ( Handle< TCollection_HAsciiString > &  tit,
Standard_Real total,
Handle< TColStd_HSequenceOfAsciiString > &  phn,
Handle< TColStd_HSequenceOfReal > &  phw,
Handle< TColStd_HSequenceOfInteger > &  phdeb,
Handle< TColStd_HSequenceOfInteger > &  phfin,
Handle< TColStd_HSequenceOfReal > &  stw 
) const
static void Interface_STAT::NextCycle ( const Standard_Integer  items) [static]
static void Interface_STAT::NextItem ( const Standard_Integer  nbitems = 1) [static]
static void Interface_STAT::NextPhase ( const Standard_Integer  items,
const Standard_Integer  cycles = 1 
) [static]
static void Interface_STAT::NextStep ( ) [static]
static Standard_Integer Interface_STAT::Percent ( const Standard_Boolean  phase = Standard_False) [static]
void Interface_STAT::Phase ( const Standard_Integer  num,
Standard_Integer n0step,
Standard_Integer nbstep,
Standard_Real weight,
Standard_CString name 
) const
static void Interface_STAT::SetPhase ( const Standard_Integer  items,
const Standard_Integer  cycles = 1 
) [static]
void Interface_STAT::Start ( const Standard_Integer  items,
const Standard_Integer  cycles = 1 
) const
static void Interface_STAT::StartCount ( const Standard_Integer  items,
const Standard_CString  title = "" 
) [static]
Standard_Real Interface_STAT::Step ( const Standard_Integer  num) const
static Standard_CString Interface_STAT::Where ( const Standard_Boolean  phase = Standard_True) [static]

The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines