eq::Pipe Class Reference

A Pipe represents a graphics card (GPU) on a Node. More...

#include <pipe.h>

Inheritance diagram for eq::Pipe:

Inheritance graph
[legend]
Collaboration diagram for eq::Pipe:

Collaboration graph
[legend]

List of all members.

Classes

class  PipeThread
 The pipe thread.

Public Member Functions

 Pipe (Node *parent)
 Constructs a new pipe.
virtual ~Pipe ()
 Destructs the pipe.
void waitExited () const
 Wait for the pipe to be exited.
bool isRunning () const
void waitFrameFinished (const uint32_t frameNumber) const
 Wait for a frame to be finished.
void waitFrameLocal (const uint32_t frameNumber) const
 Wait for a frame to be released locally.
void startThread ()
 Start the pipe thread.
void joinThread ()
 Wait for the pipe thread to exit.
Data Access.
net::CommandQueuegetPipeThreadQueue ()
NodegetNode ()
const NodegetNode () const
ConfiggetConfig ()
const ConfiggetConfig () const
ClientPtr getClient ()
ServerPtr getServer ()
const WindowVectorgetWindows () const
const std::string & getName () const
uint32_t getTasks () const
 Return the set of tasks this pipe's channels might execute in the worst case.
bool isThreaded () const
uint32_t getCurrentFrame () const
uint32_t getFinishedFrame () const
VisitorResult accept (PipeVisitor &visitor)
 Traverse this pipe and all children using a pipe visitor.
void setPixelViewport (const eq::PixelViewport &pvp)
 Set the pipes's pixel viewport.
const PixelViewportgetPixelViewport () const
uint32_t getPort () const
 Returns the port number of this pipe.
uint32_t getDevice () const
 Returns the device number of this pipe.
WindowSystem getWindowSystem () const
 Return the window system used by this pipe.
int64_t getFrameTime () const
WGLEWContext * wglewGetContext ()
Operations
FramegetFrame (const net::ObjectVersion &frameVersion, const Eye eye)
 Get an assembly frame.
void flushFrames ()
bool isCurrent (const Window *window) const
void setCurrent (const Window *window) const
 Set the window as current window.
ViewgetView (const net::ObjectVersion &viewVersion)
Interface to and from the OSPipe, the window-system specific
pieces for a pipe.

void setOSPipe (OSPipe *pipe)
 Set the OS-specific pipe.
const OSPipegetOSPipe () const
OSPipegetOSPipe ()
Error information.
void setErrorMessage (const std::string &message)
 Set a message why the last operation failed.

Protected Member Functions

virtual void attachToSession (const uint32_t id, const uint32_t instanceID, net::Session *session)
Actions
void startFrame (const uint32_t frameNumber)
 Start a frame by unlocking all child resources.
void releaseFrame (const uint32_t frameNumber)
 Signal the completion of a frame to the parent.
void releaseFrameLocal (const uint32_t frameNumber)
 Release the local synchronization of the parent for a frame.
Callbacks
The callbacks are called by Equalizer during rendering to execute various actions.

virtual bool supportsWindowSystem (const WindowSystem system) const
 Tests wether a particular windowing system is supported by this pipe and all its windows.
virtual WindowSystem selectWindowSystem () const
 Return the window system to be used by this pipe.
virtual bool configInit (const uint32_t initID)
 Initialises this pipe.
virtual bool configExit ()
 Exit this pipe.
virtual void frameStart (const uint32_t frameID, const uint32_t frameNumber)
 Start rendering a frame.
virtual void frameFinish (const uint32_t frameID, const uint32_t frameNumber)
 Finish rendering a frame.
virtual void frameDrawFinish (const uint32_t frameID, const uint32_t frameNumber)
 Finish drawing.
Configuration.
virtual bool useMessagePump ()
 Enable or disable automatic or external OS event dispatch for the pipe thread.

Friends

class Node
class Window


Detailed Description

A Pipe represents a graphics card (GPU) on a Node.

All Pipe, Window and Channel task methods are executed in a separate eq::base::Thread, in parallel with all other pipes in the system, unless the pipe is non-threaded, in which case the tasks are executed on the Node's main thread.

Definition at line 55 of file lib/client/pipe.h.


Constructor & Destructor Documentation

eq::Pipe::Pipe ( Node parent  ) 

Constructs a new pipe.

Reimplemented in eqPly::Pipe.

Definition at line 60 of file lib/client/pipe.cpp.

References eq::Node::_addPipe(), and EQINFO.

Here is the call graph for this function:

eq::Pipe::~Pipe (  )  [virtual]

Destructs the pipe.

Reimplemented in eqPly::Pipe.

Definition at line 79 of file lib/client/pipe.cpp.

References eq::Node::_removePipe().

Here is the call graph for this function:


Member Function Documentation

uint32_t eq::Pipe::getTasks (  )  const [inline]

Return the set of tasks this pipe's channels might execute in the worst case.

It is not guaranteed that all the tasks will be actually executed during rendering.

Warning:
Not finalized, might change in the future.
Returns:
the tasks.

Definition at line 90 of file lib/client/pipe.h.

Referenced by eq::Node::frameDrawFinish(), and eq::Node::frameTasksFinish().

Here is the caller graph for this function:

VisitorResult eq::Pipe::accept ( PipeVisitor visitor  ) 

Traverse this pipe and all children using a pipe visitor.

Parameters:
visitor the visitor.
Returns:
the result of the visitor traversal.

Definition at line 114 of file lib/client/pipe.cpp.

References eq::Window::accept(), eq::TRAVERSE_CONTINUE, eq::TRAVERSE_PRUNE, eq::TRAVERSE_TERMINATE, eq::PipeVisitor::visitPost(), and eq::PipeVisitor::visitPre().

Referenced by eq::Node::accept().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Pipe::setPixelViewport ( const eq::PixelViewport pvp  )  [inline]

Set the pipes's pixel viewport.

Used from _osPipe calls

Parameters:
pvp the viewport in pixels.

Definition at line 111 of file lib/client/pipe.h.

Referenced by eq::WGLPipe::configExit(), and eq::WGLPipe::configInit().

Here is the caller graph for this function:

const PixelViewport& eq::Pipe::getPixelViewport (  )  const [inline]

Returns:
the pipe's pixel viewport

Definition at line 116 of file lib/client/pipe.h.

Referenced by eq::WGLPipe::configInit(), and eq::AGLWindow::configInitAGLFullscreen().

Here is the caller graph for this function:

uint32_t eq::Pipe::getPort (  )  const [inline]

Returns the port number of this pipe.

The port number identifies the X server for systems using the X11/GLX window system. It currently has no meaning on other systems.

Returns:
the port number of this pipe, or EQ_UNDEFINED_UINT32.

Definition at line 127 of file lib/client/pipe.h.

uint32_t eq::Pipe::getDevice (  )  const [inline]

Returns the device number of this pipe.

The device number identifies the X screen for systems using the X11/GLX window system, or the number of the virtual screen for the AGL window system. On Windows systems it identifies the graphics adapter. Normally the device identifies a GPU.

Returns:
the device number of this pipe, or EQ_UNDEFINED_UINT32.

Definition at line 140 of file lib/client/pipe.h.

Referenced by eq::GLXPipe::configInit(), eq::AGLPipe::configInit(), and eq::WGLPipe::createWGLDisplayDC().

Here is the caller graph for this function:

WindowSystem eq::Pipe::getWindowSystem (  )  const [inline]

Return the window system used by this pipe.

The return value is quaranteed to be constant for an initialized pipe, that is, the window system is determined using selectWindowSystem() before the pipe init method is executed.

Returns:
the window system used by this pipe.

Definition at line 151 of file lib/client/pipe.h.

Referenced by eq::Window::configInitOSWindow().

Here is the caller graph for this function:

int64_t eq::Pipe::getFrameTime (  )  const

Returns:
the time in ms elapsed since the frame started.

Definition at line 109 of file lib/client/pipe.cpp.

References eq::Config::getTime().

Here is the call graph for this function:

WGLEWContext * eq::Pipe::wglewGetContext (  ) 

Returns:
the generic WGL function table for the pipe.

Definition at line 450 of file lib/client/pipe.cpp.

References eq::OSPipe::wglewGetContext().

Referenced by eq::Window::wglewGetContext().

Here is the call graph for this function:

Here is the caller graph for this function:

Frame * eq::Pipe::getFrame ( const net::ObjectVersion frameVersion,
const Eye  eye 
)

Get an assembly frame.

Parameters:
frameVersion the frame's identifier and version.
eye the current eye pass.
Returns:
the frame.

For internal use only.

Definition at line 307 of file lib/client/pipe.cpp.

References eq::Frame::getDataVersion(), eq::Node::getFrameData(), eq::net::Object::getSession(), eq::net::ObjectVersion::id, eq::net::Session::mapObject(), eq::Frame::setData(), eq::net::Object::sync(), and eq::net::ObjectVersion::version.

Here is the call graph for this function:

void eq::Pipe::flushFrames (  ) 

For internal use only.

Clear the frame cache and delete all frames.

Definition at line 331 of file lib/client/pipe.cpp.

References eq::Frame::flush(), eq::net::Object::getSession(), and eq::net::Session::unmapObject().

Here is the call graph for this function:

bool eq::Pipe::isCurrent ( const Window window  )  const

Returns:
if the window is made current

Definition at line 414 of file lib/client/pipe.cpp.

Referenced by eq::Window::configExitOSWindow(), eq::Window::makeCurrent(), and eq::Window::~Window().

Here is the caller graph for this function:

void eq::Pipe::setCurrent ( const Window window  )  const

Set the window as current window.

Definition at line 421 of file lib/client/pipe.cpp.

Referenced by eq::Window::configExitOSWindow(), eq::OSWindow::makeCurrent(), and eq::Window::~Window().

Here is the caller graph for this function:

View * eq::Pipe::getView ( const net::ObjectVersion viewVersion  ) 

For internal use only.

Returns:
the view for the given identifier and version.

Definition at line 346 of file lib/client/pipe.cpp.

References eq::View::_pipe, eq::NodeFactory::createView(), eq::Global::getNodeFactory(), eq::net::Object::getSession(), eq::net::ObjectVersion::id, eq::net::Session::mapObject(), eq::net::Object::sync(), and eq::net::ObjectVersion::version.

Referenced by eq::Channel::getNativeView(), and eq::Channel::getView().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Pipe::waitExited (  )  const

Wait for the pipe to be exited.

Definition at line 455 of file lib/client/pipe.cpp.

References eq::base::Monitor< T >::waitEQ().

Here is the call graph for this function:

void eq::Pipe::waitFrameFinished ( const uint32_t  frameNumber  )  const

Wait for a frame to be finished.

Parameters:
frameNumber the frame number.
See also:
releaseFrame()

Definition at line 465 of file lib/client/pipe.cpp.

References eq::base::Monitor< T >::waitGE().

Here is the call graph for this function:

void eq::Pipe::waitFrameLocal ( const uint32_t  frameNumber  )  const

Wait for a frame to be released locally.

Parameters:
frameNumber the frame number.
See also:
releaseFrameLocal()

Definition at line 470 of file lib/client/pipe.cpp.

References eq::base::Monitor< T >::waitGE().

Referenced by eq::Node::frameDrawFinish(), and eq::Node::frameTasksFinish().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Pipe::startThread (  ) 

Start the pipe thread.

Definition at line 429 of file lib/client/pipe.cpp.

void eq::Pipe::joinThread (  ) 

Wait for the pipe thread to exit.

Definition at line 437 of file lib/client/pipe.cpp.

void eq::Pipe::setOSPipe ( OSPipe pipe  )  [inline]

Set the OS-specific pipe.

The OS-specific pipe implements the window-system-dependent part. The os-specific pipe has to be initialized.

Definition at line 225 of file lib/client/pipe.h.

Referenced by configInit().

Here is the caller graph for this function:

void eq::Pipe::setErrorMessage ( const std::string &  message  )  [inline]

Set a message why the last operation failed.

The message will be transmitted to the originator of the request, for example to Config::init when set from within the configInit method.

Parameters:
message the error message.

Definition at line 242 of file lib/client/pipe.h.

Referenced by configInit(), and eq::WGLPipe::createWGLDisplayDC().

Here is the caller graph for this function:

void eq::Pipe::startFrame ( const uint32_t  frameNumber  )  [protected]

Start a frame by unlocking all child resources.

Parameters:
frameNumber the frame to start.

Definition at line 620 of file lib/client/pipe.cpp.

References EQLOG, and eq::LOG_TASKS.

Referenced by frameStart().

Here is the caller graph for this function:

void eq::Pipe::releaseFrame ( const uint32_t  frameNumber  )  [protected]

Signal the completion of a frame to the parent.

Parameters:
frameNumber the frame to end.

Definition at line 627 of file lib/client/pipe.cpp.

References EQLOG, and eq::LOG_TASKS.

Referenced by frameFinish().

Here is the caller graph for this function:

void eq::Pipe::releaseFrameLocal ( const uint32_t  frameNumber  )  [protected]

Release the local synchronization of the parent for a frame.

The synchronization is released only for this frame, not for previous, possible yet unreleased frames.

The synchronization is released only for this frame, not for previous, possible yet unreleased frames.

Parameters:
frameNumber the frame to release.

Definition at line 634 of file lib/client/pipe.cpp.

References EQLOG, eq::base::Monitor< T >::get(), and eq::LOG_TASKS.

Referenced by frameDrawFinish(), frameFinish(), and frameStart().

Here is the call graph for this function:

Here is the caller graph for this function:

bool eq::Pipe::supportsWindowSystem ( const WindowSystem  system  )  const [protected, virtual]

Tests wether a particular windowing system is supported by this pipe and all its windows.

Parameters:
system the window system to test.
Returns:
true if the window system is supported, false if not.

Definition at line 207 of file lib/client/pipe.cpp.

References eq::WINDOW_SYSTEM_AGL, eq::WINDOW_SYSTEM_GLX, and eq::WINDOW_SYSTEM_WGL.

Referenced by eqPly::Pipe::selectWindowSystem(), and selectWindowSystem().

Here is the caller graph for this function:

WindowSystem eq::Pipe::selectWindowSystem (  )  const [protected, virtual]

Return the window system to be used by this pipe.

This function determines which of the supported windowing systems is used by this pipe instance.

Returns:
the window system currently used by this pipe.

Reimplemented in eqPly::Pipe.

Definition at line 224 of file lib/client/pipe.cpp.

References supportsWindowSystem().

Here is the call graph for this function:

bool eq::Pipe::configInit ( const uint32_t  initID  )  [protected, virtual]

Initialises this pipe.

Parameters:
initID the init identifier.

Reimplemented in eqPly::Pipe.

Definition at line 484 of file lib/client/pipe.cpp.

References eq::OSPipe::configInit(), EQERROR, EQINFO, eq::OSPipe::getErrorMessage(), setErrorMessage(), setOSPipe(), eq::WINDOW_SYSTEM_AGL, eq::WINDOW_SYSTEM_GLX, and eq::WINDOW_SYSTEM_WGL.

Referenced by eqPly::Pipe::configInit().

Here is the call graph for this function:

Here is the caller graph for this function:

void eq::Pipe::frameStart ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Start rendering a frame.

Called once at the beginning of each frame, to do per-frame updates of pipe-specific data, for example updating the rendering engine. Waits for the node to start the frame, unless the thread model is async. If the thread model is async, the local synchronization is released immediately.

This method has to call startFrame().

Parameters:
frameID the per-frame identifier.
frameNumber the frame to start.
See also:
Config::beginFrame(), Node::startFrame(), Node::waitFrameStarted()

Reimplemented in eqPly::Pipe.

Definition at line 554 of file lib/client/pipe.cpp.

References eq::ASYNC, eq::DRAW_SYNC, eq::Node::getIAttribute(), eq::Node::IATTR_THREAD_MODEL, eq::LOCAL_SYNC, releaseFrameLocal(), startFrame(), and eq::Node::waitFrameStarted().

Here is the call graph for this function:

void eq::Pipe::frameFinish ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Finish rendering a frame.

Called once at the end of each frame, to do per-frame updates of pipe-specific data, for example updating the rendering engine. Releases the local synchronization if the thread model is local_sync. Always releases the global synchronization for this pipe.

This method has to call releaseFrame().

Parameters:
frameID the per-frame identifier.
frameNumber the frame to finish.

Definition at line 597 of file lib/client/pipe.cpp.

References eq::ASYNC, eq::DRAW_SYNC, eq::Node::getIAttribute(), eq::Node::IATTR_THREAD_MODEL, eq::LOCAL_SYNC, releaseFrame(), and releaseFrameLocal().

Here is the call graph for this function:

void eq::Pipe::frameDrawFinish ( const uint32_t  frameID,
const uint32_t  frameNumber 
) [protected, virtual]

Finish drawing.

Called once per frame after the last draw operation. Releases the local synchronization if the thread model is draw_sync (the default).

Parameters:
frameID the per-frame identifier.
frameNumber the frame to finished with draw.

Definition at line 577 of file lib/client/pipe.cpp.

References eq::ASYNC, eq::DRAW_SYNC, eq::Node::getIAttribute(), eq::Node::IATTR_THREAD_MODEL, eq::LOCAL_SYNC, and releaseFrameLocal().

Here is the call graph for this function:

virtual bool eq::Pipe::useMessagePump (  )  [inline, protected, virtual]

Enable or disable automatic or external OS event dispatch for the pipe thread.

Returns:
true if Equalizer shall dispatch OS events, false if the application dispatches OS events.
See also:
Event handling documentation on website.

Definition at line 375 of file lib/client/pipe.h.

void eq::Pipe::attachToSession ( const uint32_t  id,
const uint32_t  instanceID,
net::Session session 
) [protected, virtual]

See also:
net::Object::attachToSession.

Reimplemented from eq::net::Object.

Definition at line 155 of file lib/client/pipe.cpp.

References eq::net::Dispatcher::registerCommand().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Mon Aug 10 18:58:43 2009 for Equalizer 0.9 by  doxygen 1.5.8