All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Member Functions
GpCoreTools::EventStream Class Reference

Brief description of class still missing. More...

#include <EventStream.h>

Inheritance diagram for GpCoreTools::EventStream:
GpCoreTools::Stream

List of all members.

Public Member Functions

virtual void event (short type)
 EventStream ()
virtual short eventTypes ()
void send (Event *event)
 ~EventStream ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

Description of constructor still missing

References GpCoreTools::Stream::setFileDescriptor(), and TRACE.

    : Stream()
{
  TRACE;
  socketpair(AF_UNIX, SOCK_STREAM, 0, _sockets);
  setFileDescriptor(_sockets[0]);
}

Description of destructor still missing

References GpCoreTools::Stream::close(), and TRACE.

{
  TRACE;
  if(_sockets[1]) {
    ::close(_sockets[1]);
  }
}

Member Function Documentation

void GpCoreTools::EventStream::event ( short  type) [virtual]

Implements GpCoreTools::Stream.

References GpCoreTools::EventLoop::addEvent(), GpCoreTools::EventLoop::instance(), TRACE, and GpCoreTools::Log::write().

{
  TRACE;
  if(type & POLLIN) {
    Event * event;
    if(::read(_sockets[0], (char *)&event, sizeof(Event *))==sizeof(Event *)) {
      EventLoop::instance()->addEvent(event);
    } else {
      Log::write(6, "uncomplete event pointer");
    }
  }
  if(type & POLLRDHUP) {
    assert(false);
  }
}
virtual short GpCoreTools::EventStream::eventTypes ( ) [inline, virtual]

Implements GpCoreTools::Stream.

{return POLLIN | POLLRDHUP;}

References UNUSED.

Referenced by GpCoreTools::EventLoop::addTimer(), and GpCoreTools::EventLoop::terminate().

{
  UNUSED(::write(_sockets[1], (const char *)&event, sizeof(Event *)));
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines