Changeset 16737


Ignore:
Timestamp:
06/05/13 22:15:43 (12 years ago)
Author:
tbretz
Message:
Implement a way to check if the (Log) Message Queue is empty. Only then the Boot message of the ReadlineColor (MCP) is printed... just cosmetics for startup.
Location:
trunk/FACT++/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Main.h

    r16093 r16737  
    200200        // Hopefully checking the readline (see Threed) should fix
    201201        // that -- difficult to test.)
    202         while (io_service.GetCurrentState()<StateMachineImp::kSM_Ready && !shell.IsStopped())
     202        while ((io_service.GetCurrentState()<StateMachineImp::kSM_Ready ||
     203                !io_service.MessageQueueEmpty()) && !shell.IsStopped())
    203204            usleep(1);
    204205
     
    212213            shell.Execute(*it, args);
    213214
     215        cout << "==============="<< endl;
     216
    214217        // Run the shell if no immediate exit was requested
    215218        if (!conf.Get<bool>("quit"))
  • trunk/FACT++/src/MessageDim.h

    r16479 r16737  
    2323
    2424    void SetDebug(bool b=true) { fDebug=b; }
     25
     26    bool MessageQueueEmpty() const { return fMsgQueue.empty(); }
    2527};
    2628
  • trunk/FACT++/src/MessageImp.h

    r14497 r16737  
    6969    std::ostream &operator()() const { return fOut; }
    7070    std::ostream &Out() const { return fOut; }
     71
     72    virtual bool MessageQueueEmpty() const { return true; }
    7173};
    7274
  • trunk/FACT++/src/StateMachineDim.h

    r16537 r16737  
    100100
    101101    bool AddStateName(const int state, const std::string &name, const std::string &doc="");
     102
     103    bool MessageQueueEmpty() const { return DimLog::fLog.MessageQueueEmpty(); }
    102104};
    103105
Note: See TracChangeset for help on using the changeset viewer.