Exemplo n.º 1
0
/** \param[in] evenData FevenData to be just worked.
  \retval RET_OK No problemo. */
long Frouter::justDoIt( FevenData* evenData)
{
// First check if the evenData as ended is work.
  if( evenData->getCurrentDestination()->getAction()->equals( &gvActionEnd)
    || evenData->getCurrentDestination()->getAction()->equals( &gvActionError)) // TODO Do a real error management
  {
    setFreeEvenData( evenData);
    return RET_OK;
  }
  else
    return Fport::justDoIt( evenData);
}
Exemplo n.º 2
0
/** \retval RET_OK No problemo, room created.
  \retval RET_NOINFOS No configuration informations to process. */
long Frouter::createRoom()
{
  FclassInfos classInfo;
  FconditionLink conditionLink;
  FstringHash strH;

  Fport* port;

  resetCurrent();
  if( !gotoChildren())
  {
// --------------------------------------------------
// IMPORT PORTS
// --------------------------------------------------
    IMPORT_PORTS( XML_ROOM, "", Frouter)
    IMPORT_PORTS( XML_BOARD, "", FevenBoard)

// --------------------------------------------------
// IMPORTS a default evenData
// --------------------------------------------------
    setFreeEvenData( new FevenData());							

// --------------------------------------------------
// IMPORT DATAS to enable an easy creation of evenData instances
// --------------------------------------------------

// --------------------------------------------------
// IMPORT YOUR OWN PORTS
// --------------------------------------------------

		
// --------------------------------------------------
// --------------------------------------------------

// --------------------------------------------------
// IMPORT LINK VALUES BETWEEN evenData, evenDoor AND ports
// --------------------------------------------------
    if( !Find( XML_LNK, false))
    {
      do {
        pushCurrent();
        getLinkInfos( &conditionLink);
        if( conditionLink.source.getLen())
        {
          strH.setString( conditionLink.source.getString());
          port = ( Fport*) listHash.Search( &strH);
          if( port)
          {
            FevenData* data = getFreeEvenData();

            // Set the value to transmit to the door
            data->setData( XML_LNKSOURCE, conditionLink.source.getString());
            data->setData( XML_LNKTYPE, conditionLink.typeFields.getString());
            data->setData( XML_LNKVALUE, conditionLink.value.getString());
            data->setData( XML_LNKFIELDS, conditionLink.fields.getString());
            data->setData( XML_LNKDEST, conditionLink.destination.getString());

            // Set the SYSTEM action
            data->setPortAction( ACT_SYS_ADDDEST, conditionLink.source.getString());

            // Send to the evenDoor
            sendEvenDataSys( data, port);
          }
        }
        popCurrent();
      }while( FindNext( XML_LNK, false) == RET_OK);
    }
    return RET_OK;
  }
  else
    return RET_NOINFOS;
}
Exemplo n.º 3
0
Arquivo: fport.cpp Projeto: evenja/cpp
/** \param[in] evenData FevenData to be just worked in system jobs.
   \retval RET_OK No problemo. */
long Fport::justDoItSys( FevenData* evenData)
{
  setFreeEvenData( evenData);
  return RET_OK;
}