Beispiel #1
0
/**
 * <p>INTERNAL USE ONLY. This method is called by {@link -pool} to pool the
 * statistics blocks contained in <code>idSrc</code> and store the result in
 * <code>idPool</code>. The operation is controlled through the pooling mode
 * flag <code>nMode</code> as follows:</p>
 *
 * <ul>
 *   <li>nMode=0: Pool sum data, <code>idPool</code> will be overwritten</li>
 *   <li>nMode=1: Pool min data</li>
 *   <li>nMode=2: Pool max data</li>
 * </ul>
 *
 * <h3>Remarks</h3>
 * <ul>
 *   <li>In order to pool raw statistics data, there are three calls
 *     (<code>nMode</code>=0,1 and 2) necessary. The first call of these
 *     <em>must</em> be the one with <code>nMode</code>=0!</li>
 *   <li>There are NO checks performed</li>
 * </ul>
 *
 * @param idPool
 *          Pooled raw statistics data block
 * @param idSrc
 *          Raw statistics data blocks to be pooled
 * @param nMode
 *          Pooling mode, see above
 */
void CGEN_SPRIVATE CStatistics_PoolInt(CData* idPool, CData* idSrc, INT32 nMode)
{
  CData* idAux      = NULL;                                                     /* Auxilary data instance #1         */

  if (nMode==0)                                                                 /* Sum aggregation mode              */
  {                                                                             /* >>                                */
    ISETOPTION(idPool,"/block");                                                /*   Switch target to block mode     */
    CData_Aggregate(idPool,idSrc,NULL,CMPLX(0),"sum");                          /*   Aggregate (sum up)              */
    IRESETOPTIONS(idPool);                                                      /*   Switch target to normal mode    */
  }                                                                             /* <<                                */
  else if (nMode==1 || nMode==2)                                                /* Extrama aggregation modes         */
  {                                                                             /* >>                                */
    ICREATEEX(CData,idAux,"CStatistics_Pool_int.~idAux",NULL);                  /*   Create auxilary data instance #1*/
    ISETOPTION(idAux,"/block");                                                 /*   Switch target to block mode     */
    CData_Aggregate(idAux,idSrc,NULL,CMPLX(0),nMode==1?"min":"max");            /*   Aggregate (minimum or maximum)  */
    dlp_memmove(CData_XAddr(idPool,nMode,0),CData_XAddr(idAux,nMode,0),         /*   Copy aggregated min. or max. ...*/
      CData_GetRecLen(idAux));                                                  /*   | ... to target                 */
    IRESETOPTIONS(idAux);                                                       /*   Switch target to normal mode    */
    IDESTROY(idAux);                                                            /*   Destroy auxilary data inst. #1  */
  }                                                                             /* <<                                */
  else                                                                          /* Unknown mode                      */
    DLPASSERT(FMSG("Invalid internal pooling mode"));                           /*   Not so good ...                 */
}
Beispiel #2
0
INT16 CDlpFile_OnFlistChanged(CDlpObject* __this)
{
	GET_THIS_VIRTUAL_RV(CDlpFile,NOT_EXEC);
	{
    CData_Reset(_this->m_idFlistData, TRUE);
    if(dlp_strlen(_this->m_lpsFlist))
    {
      ISETOPTION(_this,"/strings");
      CDlpFile_Import(_this,_this->m_lpsFlist,"ascii",_this->m_idFlistData);
      IRESETOPTIONS(_this);
      _this->m_nLen = CData_GetNRecs(AS(CData,_this->m_idFlistData));
    }
    else _this->m_nLen = 0;
    _this->m_nNfile = -1;
	}

	return O_K;
}