Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Bug List

The example below creates a single button which when clicked exits the Xt event loop.

//
// Tests the Xt event loop as a separate thread.
//
#include <spectrodaq.h>
#include <CXtEventLoop.h>
#include <XMPushbutton.h>
#include <iostream.h>
class CXMApplication : public CXtEventLoop
{
  XMPushButton* m_pButton;
protected:
  virtual void SetupWidgetTree(Widget top)
  {
    cerr << "Setting up widget tree\n";
    cerr.flush();
    m_pButton = new XMPushButton("Exit",
                                 top,
                                 CXMApplication::Exit,
                                 (XtPointer)this);
    m_pButton->Manage();
    cerr << "Widget Tree set up.\n";
    cerr.flush();
  }
public:
  CXMApplication() :
    m_pButton(0)
  {
    cerr << "Motif app constructed\n";
    cerr.flush();
  }

private:
  static void  Exit(XMWidget* pMyWidget, XtPointer cd, XtPointer reason)
  {
    CXMApplication* pMe = (CXMApplication*)cd;
    delete pMe->m_pButton;
    pMe->exit();
  }

};

class Main : public DAQROCNode
{
  int operator()(int argc, char** argv)
  {
    CXMApplication app;
    DAQThreadId   tid = daq_dispatcher.Dispatch(app);
    DAQStatus     stat;

    Join(tid, &stat);
    cerr << "Motif gui thread exited: " << stat.GetStatusCode() << endl;
    return 0;
  }
};

static Main myApp;
Member CBinding::STD (string) ItemToString(T Item)
Should invent a bad type exception and throw it.

Member CBinding::VariableType (T item)
Really should invent a bad type exception and throw it instead

Member CEventLoop::~CEventLoop ()
There is no good way to enforce that CDuplicateSingleton's don't result in spurious clears of the instance pointer.

Member CSocket::Write (void *pBuffer, size_t nBytes)
There's not a good way to handle failures on the second or later call to write(2). Since we'd like to indicate that part of the write completed before an error occured. The current assumption is that a followup write will produce the same error. Perhaps the best long term thing to do is to define a CTCPSocketIOError which will include as data the number of bytes written along with a CErrnoException which describes why the write actually failed??

Member CThreadRecursiveMutex::UnLock ()
Status returns from lock and unlock are not checked.

Member CXtEventLoop::setFallbackResources (char **resources)
May want to do a copy in instead of pointer copy.

Member FALSE
Perhaps global syncronization of (3) calls should be conditionalized so that this module can be used in a non spectrodaq environment too.

Generated on Thu Jan 6 16:58:46 2005 for Spectrodaq External Event Framework by  doxygen 1.3.9.1