Exemplo n.º 1
0
UtlBoolean MprRecorder::handleMessage(MpFlowGraphMsg& rMsg)
{
   OsSysLog::add(FAC_MP, PRI_DEBUG, "MprRecorder::handleMessage(%d)\n", rMsg.getMsg());
   switch (rMsg.getMsg())
   {
   case SETUP:
      {
      //params:  Int1 = file descriptor,
      //         Int2 = time to record in millisecs,
      //         Ptr1 = OsEvent pointer
         int file = rMsg.getInt1();
         int iMSec = rMsg.getInt2();
         OsProtectedEvent* pEvent = (OsProtectedEvent*) rMsg.getPtr1();
         int silenceLength = (int) (intptr_t) rMsg.getPtr2();
         return handleSetup(file, iMSec, silenceLength, pEvent);
      }
      break;

   case BEGIN:
      return handleBegin();
      break;

   case STOP:
      return handleStop();
      break;
   }
   return MpResource::handleMessage(rMsg);
}
Exemplo n.º 2
0
void WorksheetSubStreamHandler::handleRecord(Record* record)
{
    if (!record) return;

    const unsigned type = record->rtti();

    if (type == BottomMarginRecord::id)
        handleBottomMargin(static_cast<BottomMarginRecord*>(record));
    else if (type == BoolErrRecord::id)
        handleBoolErr(static_cast<BoolErrRecord*>(record));
    else if (type == BlankRecord::id)
        handleBlank(static_cast<BlankRecord*>(record));
    else if (type == CalcModeRecord::id)
        handleCalcMode(static_cast<CalcModeRecord*>(record));
    else if (type == ColInfoRecord::id)
        handleColInfo(static_cast<ColInfoRecord*>(record));
    else if (type == DataTableRecord::id)
        handleDataTable(static_cast<DataTableRecord*>(record));
    else if (type == FormulaRecord::id)
        handleFormula(static_cast<FormulaRecord*>(record));
    else if (type == FooterRecord::id)
        handleFooter(static_cast<FooterRecord*>(record));
    else if (type == HeaderRecord::id)
        handleHeader(static_cast<HeaderRecord*>(record));
    else if (type == LabelRecord::id)
        handleLabel(static_cast<LabelRecord*>(record));
    else if (type == LabelSSTRecord::id)
        handleLabelSST(static_cast<LabelSSTRecord*>(record));
    else if (type == LeftMarginRecord::id)
        handleLeftMargin(static_cast<LeftMarginRecord*>(record));
    else if (type == MergedCellsRecord::id)
        handleMergedCells(static_cast<MergedCellsRecord*>(record));
    else if (type == MulBlankRecord::id)
        handleMulBlank(static_cast<MulBlankRecord*>(record));
    else if (type == MulRKRecord::id)
        handleMulRK(static_cast<MulRKRecord*>(record));
    else if (type == NumberRecord::id)
        handleNumber(static_cast<NumberRecord*>(record));
    else if (type == RightMarginRecord::id)
        handleRightMargin(static_cast<RightMarginRecord*>(record));
    else if (type == RKRecord::id)
        handleRK(static_cast<RKRecord*>(record));
    else if (type == RowRecord::id)
        handleRow(static_cast<RowRecord*>(record));
    else if (type == RStringRecord::id)
        handleRString(static_cast<RStringRecord*>(record));
    else if (type == SharedFormulaRecord::id)
        handleSharedFormula(static_cast<SharedFormulaRecord*>(record));
    else if (type == StringRecord::id)
        handleString(static_cast<StringRecord*>(record));
    else if (type == TopMarginRecord::id)
        handleTopMargin(static_cast<TopMarginRecord*>(record));
    else if (type == HLinkRecord::id)
        handleHLink(static_cast<HLinkRecord*>(record));
    else if (type == NoteRecord::id)
        handleNote(static_cast<NoteRecord*>(record));
    else if (type == ObjRecord::id)
        handleObj(static_cast<ObjRecord*>(record));
    else if (type == TxORecord::id)
        handleTxO(static_cast<TxORecord*>(record));
    else if (type == BOFRecord::id)
        handleBOF(static_cast<BOFRecord*>(record));
    else if (type == DefaultRowHeightRecord::id)
        handleDefaultRowHeight(static_cast<DefaultRowHeightRecord*>(record));
    else if (type == DefaultColWidthRecord::id)
        handleDefaultColWidth(static_cast<DefaultColWidthRecord*>(record));
    else if (type == SetupRecord::id)
        handleSetup(static_cast<SetupRecord*>(record));
    else if (type == HCenterRecord::id)
        handleHCenter(static_cast<HCenterRecord*>(record));
    else if (type == VCenterRecord::id)
        handleVCenter(static_cast<VCenterRecord*>(record));
    else if (type == ZoomLevelRecord::id)
        handleZoomLevel(static_cast<ZoomLevelRecord*>(record));
    else if (type == 0xA) {} //EofRecord
    else if (type == DimensionRecord::id)
        handleDimension(static_cast<DimensionRecord*>(record));
    else if (type == MsoDrawingRecord::id)
        handleMsoDrawing(static_cast<MsoDrawingRecord*>(record));
    else if (type == Window2Record::id)
        handleWindow2(static_cast<Window2Record*>(record));
    else if (type == PasswordRecord::id)
        handlePassword(static_cast<PasswordRecord*>(record));
    else if (type == BkHimRecord::id)
        handleBkHim(static_cast<BkHimRecord*>(record));
    else if (type == VerticalPageBreaksRecord::id)
        handleVerticalPageBreaksRecord(static_cast<VerticalPageBreaksRecord*>(record));
    else if (type == HorizontalPageBreaksRecord::id)
        handleHorizontalPageBreaksRecord(static_cast<HorizontalPageBreaksRecord*>(record));
    else if (type == CondFmtRecord::id)
        handleCondFmtRecord(static_cast<CondFmtRecord*>(record));
    else if (type == CFRecord::id)
        handleCFRecord(static_cast<CFRecord*>(record));
    else {
        //std::cout << "Unhandled worksheet record with type=" << type << " name=" << record->name() << std::endl;
    }
}
void XMLProtocolParser::processElement(tinyxml2::XMLElement *curChild)
{
    const char *val = curChild->Value();
    std::string str(val);

    if (str.compare("Referee") == 0)
    {
        handleReferee(curChild);
    }
    else if (str.compare("StageChange") == 0)
    {
        handleStageChange(curChild);
    }
    else if (str.compare("GameStart") == 0)
    {
        handleGameStart(curChild);
    }
    else if (str.compare("GameStop") == 0)
    {
        handleGameStop(curChild);
    }
    else if (str.compare("KickOff") == 0)
    {
        handleKickOff(curChild);
    }
    else if (str.compare("DroppedBall") == 0)
    {
        handleDroppedBall(curChild);
    }
    else if (str.compare("FreeKick") == 0)
    {
        handleFreeKick(curChild);
    }
    else if (str.compare("GoalKick") == 0)
    {
        handleGoalKick(curChild);
    }
    else if (str.compare("ThrowIn") == 0)
    {
        handleThrowIn(curChild);
    }
    else if (str.compare("Corner") == 0)
    {
        handleCornerKick(curChild);
    }
    else if (str.compare("Penalty") == 0)
    {
        handlePenalty(curChild);
    }
    else if (str.compare("Parking") == 0)
    {
        handleParking(curChild);
    }
    else if (str.compare("RefboxEvent") == 0)
    {
        // DO NOTHING THIS CUZ OF --> <RefboxEvent xmlns="http://www.robocup.org/MSL/refbox/protocol2010">
    }
    else if (str.compare("GameInfo") == 0)
    {
        this->gameData->setGoals(GameData::Side::CYAN, 0);
        this->gameData->setGoals(GameData::Side::MAGENTA, 0);
        handleGameInfo(curChild);
    }
    else if (str.compare("TeamData") == 0)
    {
        handleTeamData(curChild);
    }
    else if (str.compare("Setup") == 0)
    {
        handleSetup(curChild);
    }
    else if (str.compare("Player") == 0)
    {
        handlePlayer(curChild);
    }
    else if (str.compare("PlayerOut") == 0)
    {
        handlePlayerOut(curChild);
    }
    else if (str.compare("PlayerIn") == 0)
    {
        handlePlayerIn(curChild);
    }
    else if (str.compare("GoalAwarded") == 0)
    {
        handleGoalAwarded(curChild);
    }
    else if (str.compare("CardAwarded") == 0)
    {
        handleCardAwarded(curChild);
    }
    else if (str.compare("Goals") == 0)
    {
        handleGoals(curChild);
    }
    else if (str.compare("Cards") == 0)
    {
        //                      Nothing to, comes with team data
    }
    else if (str.compare("PlayersOut") == 0)
    {
        //                      Currently ignored
    }
    else
    {
        std::cerr << "RQTREFBOX: CANNOT PARSE-> " << val << std::endl;
    }
}