NITE 1.5.1 - API Reference

XnVMultiProcessFlowServer Class Reference

#include <XnVMultiProcessFlowServer.h>

Inheritance diagram for XnVMultiProcessFlowServer:
Collaboration diagram for XnVMultiProcessFlowServer:

List of all members.

Public Member Functions

 XnVMultiProcessFlowServer (const XnChar *strSectionName, const XnChar *strName="XnVMultiProcessFlowServer")
 ~XnVMultiProcessFlowServer ()
XnStatus Initialize ()
void Reset ()
void Update (const XnVMultipleHands &hands)

Protected Member Functions

XnStatus WriteState ()
void OnPointCreate (const XnVHandPointContext *pContext)
void OnPointUpdate (const XnVHandPointContext *pContext)
void OnPointDestroy (XnUInt32 nID)
void OnPrimaryPointCreate (const XnVHandPointContext *pContext, const XnPoint3D &ptSessionStarter)
void OnPrimaryPointUpdate (const XnVHandPointContext *pContext)
void OnPrimaryPointDestroy (XnUInt32 nID)
void OnSessionStart (const XnPoint3D &ptPosition)
void OnSessionEnd ()
void OnFocusStartDetected (const XnChar *strFocus, const XnPoint3D &ptPosition, XnFloat fProgress)

Private Member Functions

void CheckSessionStarted ()

Private Attributes

XnUInt32 m_nWriteCount
XnVMultiprocessWriteSynchronizer * m_pWritingLock
XnVNiteMultiprocessData * m_pCurrentState
XnVIntHash * m_pIdToIndex
XnBool m_bFocusStartSinceUpdate
const XnVMultipleHandsm_pCurrentHands

Detailed Description

XnVMultiProcessFlowServer is both a XnVPointControl and a SessionListener. When placed into a NITE flow it stores the latest state it has according to events that arrive (PointCreate/Update/Destroy, SessionCreate/SessionDestroy, etc.) and calls WriteState. When WriteState() is called, it publishes the current state into a shared memory section. Clients (XnVMultiProcessFlowClient objects) which read the published state can then trigger the same events in different processes. NOTE: The object is NOT thread-safe, meaning, the WriteState and Reset methods must be called from the same thread that XnVPointListener::Update() is called on the point-listener which is connected to the server

Definition at line 30 of file XnVMultiProcessFlowServer.h.

Constructor & Destructor Documentation

XnVMultiProcessFlowServer::XnVMultiProcessFlowServer ( const XnChar *  strSectionName,
const XnChar *  strName = "XnVMultiProcessFlowServer" 

Create a XnVMultiProcessFlowServer

[in]strSectionNameThe name of the Shared Memory section to which we will write
[in]strNameName of the control, for log purposes.
XnVMultiProcessFlowServer::~XnVMultiProcessFlowServer ( )

Member Function Documentation

void XnVMultiProcessFlowServer::CheckSessionStarted ( ) [private]
XnStatus XnVMultiProcessFlowServer::Initialize ( )

Initialize the shared-memory Must be called before the first call to WriteState.

XN_STATUS_OK on successful init, XN_STATUS_* error code otherwise
void XnVMultiProcessFlowServer::OnFocusStartDetected ( const XnChar *  strFocus,
const XnPoint3D &  ptPosition,
XnFloat  fProgress 
) [protected, virtual]

Implements XnVSessionListener.

void XnVMultiProcessFlowServer::OnPointCreate ( const XnVHandPointContext pContext) [protected, virtual]

Handle a new Point Create event

[in]pContextThe context of the new Point

Reimplemented from XnVPointControl.

void XnVMultiProcessFlowServer::OnPointDestroy ( XnUInt32  nID) [protected, virtual]

Handle a existing Point Destroy event

[in]nIDThe ID of the destroyed Point

Reimplemented from XnVPointControl.

void XnVMultiProcessFlowServer::OnPointUpdate ( const XnVHandPointContext pContext) [protected, virtual]

Handle an existing Point Update event

[in]pContextThe context of the Point

Reimplemented from XnVPointControl.

void XnVMultiProcessFlowServer::OnPrimaryPointCreate ( const XnVHandPointContext pContext,
const XnPoint3D &  ptSessionStarter 
) [protected, virtual]

Handle the primary point create

[in]pContextThe context of the primary point
[in]ptSessionStarterThe point in which the session started

Reimplemented from XnVPointControl.

void XnVMultiProcessFlowServer::OnPrimaryPointDestroy ( XnUInt32  nID) [protected, virtual]

Handle the primary point destruction

[in]nIDThe ID of the last primary point

Reimplemented from XnVPointControl.

void XnVMultiProcessFlowServer::OnPrimaryPointUpdate ( const XnVHandPointContext pContext) [protected, virtual]

Handle an update of the Primary Point

[in]pContextThe context of the primary point

Reimplemented from XnVPointControl.

void XnVMultiProcessFlowServer::OnSessionEnd ( ) [protected, virtual]

Implements XnVSessionListener.

void XnVMultiProcessFlowServer::OnSessionStart ( const XnPoint3D &  ptPosition) [protected, virtual]

Implements XnVSessionListener.

void XnVMultiProcessFlowServer::Reset ( )

Reset stored state. Does not publish the state to clients. Calling WriteState() directly after calling this method will destroy the session and all points in clients. NOTE: Reset MUST be called before re-connecting a Server into a Nite flow, or undefined behavior will occur due to stale state data inside the server

void XnVMultiProcessFlowServer::Update ( const XnVMultipleHands hands) [virtual]

Handle new hands batch. Write to internal state, to be written to the shared memory.

[in]handsThe current state of the hands

Reimplemented from XnVPointControl.

XnStatus XnVMultiProcessFlowServer::WriteState ( ) [protected]

Member Data Documentation

Definition at line 83 of file XnVMultiProcessFlowServer.h.

XnVNiteMultiprocessData* XnVMultiProcessFlowServer::m_pCurrentState [private]

Definition at line 85 of file XnVMultiProcessFlowServer.h.

Definition at line 86 of file XnVMultiProcessFlowServer.h.

XnVMultiprocessWriteSynchronizer* XnVMultiProcessFlowServer::m_pWritingLock [private]

Definition at line 84 of file XnVMultiProcessFlowServer.h.

The documentation for this class was generated from the following file: