Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

XnVMultiProcessFlowServer Class Reference

#include <XnVMultiProcessFlowServer.h>

Inheritance diagram for XnVMultiProcessFlowServer:
Inheritance graph
[legend]
Collaboration diagram for XnVMultiProcessFlowServer:
Collaboration graph
[legend]

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_IdToIndex
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 29 of file XnVMultiProcessFlowServer.h.


Constructor & Destructor Documentation

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

Create a XnVMultiProcessFlowServer

Parameters:
[in] strSectionName The name of the Shared Memory section to which we will write
[in] strName Name 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.

Returns:
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]
void XnVMultiProcessFlowServer::OnPointDestroy ( XnUInt32  nID  )  [protected]
void XnVMultiProcessFlowServer::OnPointUpdate ( const XnVHandPointContext pContext  )  [protected]
void XnVMultiProcessFlowServer::OnPrimaryPointCreate ( const XnVHandPointContext pContext,
const XnPoint3D &  ptSessionStarter 
) [protected]
void XnVMultiProcessFlowServer::OnPrimaryPointDestroy ( XnUInt32  nID  )  [protected]
void XnVMultiProcessFlowServer::OnPrimaryPointUpdate ( const XnVHandPointContext pContext  )  [protected]
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  ) 

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

Parameters:
[in] hands The current state of the hands
XnStatus XnVMultiProcessFlowServer::WriteState (  )  [protected]

Member Data Documentation

Definition at line 86 of file XnVMultiProcessFlowServer.h.

Definition at line 85 of file XnVMultiProcessFlowServer.h.

Definition at line 82 of file XnVMultiProcessFlowServer.h.

Definition at line 88 of file XnVMultiProcessFlowServer.h.

XnVNiteMultiprocessData* XnVMultiProcessFlowServer::m_pCurrentState [private]

Definition at line 84 of file XnVMultiProcessFlowServer.h.

XnVMultiprocessWriteSynchronizer* XnVMultiProcessFlowServer::m_pWritingLock [private]

Definition at line 83 of file XnVMultiProcessFlowServer.h.


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