Introduction Manual Class Reference Header Reference

ZCom_Interpolate< T, SIZE > Class Template Reference

Inheritance diagram for ZCom_Interpolate< T, SIZE >:

Inheritance graph
[legend]
Collaboration diagram for ZCom_Interpolate< T, SIZE >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename T, int SIZE>
class ZCom_Interpolate< T, SIZE >

Interpolator template replicating numeric data and interpolating it between updates.


Public Member Functions

ZCOM_TAPI TYPE getRecVal (zU8 _idx) const
 Get last received value.
ZCOM_TAPI TYPE * getRecValPtr (zU8 _idx)
 Get a pointer to the received value.
ZCOM_TAPI zU8 getSize () const
 Get size of array.
ZCOM_TAPI TYPE getValue (zU8 _idx)
 Get value from array.
ZCOM_TAPI void * peekData ()
 Peeking implementation.
ZCOM_TAPI void setRecVal (zU8 _idx, TYPE _val)
 Overwrite the received value.
ZCOM_TAPI void setValue (TYPE *_val)
 Update complete array.
ZCOM_TAPI void setValue (zU8 _idx, TYPE _val)
 Set value in array.
ZCOM_TAPI ZCom_Interpolate (TYPE *_data, zU8 _bits, zU8 _flags, zU8 _rules, TYPE _treshold, TYPE *_dst=NULL, zU8 _intercept_id=0, zS16 _mindelay=-1, zS16 _maxdelay=-1, zFloat _ipolfac=0.4f)
 constructor, builds the replicatorsetup automatically
ZCOM_TAPI ZCom_Interpolate (TYPE *_data, ZCom_RSetupInterpolate< TYPE > *_setup)
 constructor, taking a ZCom_ReplicatorSetup pointer

Protected Attributes

zU8 m_flags
 Additional replicator flags. ZCom_Replicator() c'tor will set this to 0. (ZCOM_REPLICATOR_*).
ZCom_ReplicatorSetupm_setup
 pointing to an instance of the setup class - all replication parameters are stored here


Constructor & Destructor Documentation

template<typename T, int SIZE>
ZCOM_TAPI ZCom_Interpolate< T, SIZE >::ZCom_Interpolate TYPE *  _data,
ZCom_RSetupInterpolate< TYPE > *  _setup
 

constructor, taking a ZCom_ReplicatorSetup pointer

template<typename T, int SIZE>
ZCOM_TAPI ZCom_Interpolate< T, SIZE >::ZCom_Interpolate TYPE *  _data,
zU8  _bits,
zU8  _flags,
zU8  _rules,
TYPE  _treshold,
TYPE *  _dst = NULL,
zU8  _intercept_id = 0,
zS16  _mindelay = -1,
zS16  _maxdelay = -1,
zFloat  _ipolfac = 0.4f
 

constructor, builds the replicatorsetup automatically


Member Function Documentation

template<typename T, int SIZE>
ZCOM_TAPI void* ZCom_Interpolate< T, SIZE >::peekData  )  [virtual]
 

Peeking implementation.

Returns:
T* array of size getSize().

Implements ZCom_Replicator.

template<typename T, int SIZE>
ZCOM_TAPI TYPE ZCom_Interpolate< T, SIZE >::getValue zU8  _idx  )  [inline]
 

Get value from array.

Parameters:
_idx Array index.
Returns:
Value at array index.

template<typename T, int SIZE>
ZCOM_TAPI void ZCom_Interpolate< T, SIZE >::setValue zU8  _idx,
TYPE  _val
[inline]
 

Set value in array.

Parameters:
_idx Array index.
_val New value.

template<typename T, int SIZE>
ZCOM_TAPI void ZCom_Interpolate< T, SIZE >::setValue TYPE *  _val  )  [inline]
 

Update complete array.

Parameters:
_val Ptr to array of new values.

template<typename T, int SIZE>
ZCOM_TAPI zU8 ZCom_Interpolate< T, SIZE >::getSize  )  const [inline]
 

Get size of array.

Returns:
Size of array.

template<typename T, int SIZE>
ZCOM_TAPI TYPE ZCom_Interpolate< T, SIZE >::getRecVal zU8  _idx  )  const [inline]
 

Get last received value.

Returns:
The value last received from the network.
This is the value currently used as interpolation target.

template<typename T, int SIZE>
ZCOM_TAPI TYPE* ZCom_Interpolate< T, SIZE >::getRecValPtr zU8  _idx  )  [inline]
 

Get a pointer to the received value.

Returns:
Pointer to the variable always holding the last received value.
This can be used to manipulate the received value.

template<typename T, int SIZE>
ZCOM_TAPI void ZCom_Interpolate< T, SIZE >::setRecVal zU8  _idx,
TYPE  _val
[inline]
 

Overwrite the received value.

Parameters:
_idx Index in array.
_val The new value.

void* ZCom_Replicator::operator new size_t  _size  )  [inherited]
 

Overloaded memory operator ensuring that always Zoidcom's new gets called.

Attention:
Don't overload this unless you are 100% sure what you are doing.

void ZCom_Replicator::operator delete void *  _p  )  [inherited]
 

Overloaded memory operator ensuring that always Zoidcom's delete gets called.

Attention:
Don't overload this unless you are 100% sure what you are doing.

ZCom_BitStream* ZCom_Replicator::getPeekStream  )  const [protected, inherited]
 

Get stream currently processed for peeking the data.

Returns:
Pointer to current ZCom_BitStream.
As you might have noticed, peekData() does not have a ZCom_BitStream parameter. That's the case because peekData() must be called from inside ZCom_NodeReplicationInterceptor::inPreUpdateItem(), and this interceptor callback has no access to the currently processed stream. Use this method to get a pointer to the currently processed stream instead.

This will only return a valid result when called from inside the above mentioned interceptor callback.

void ZCom_Replicator::peekDataStore void *  _ptr  )  [protected, inherited]
 

Store pointer to allocated peekbuffer, so it can be deleted again.

Parameters:
_ptr Pointer to the allocated memory.
The pointer will get stored in a global Thread Local Storage, so that multiple ZCom_Controls can safely operate simultaneously in different threads. When a replicator's peekData() makes use of this method, expect to get a call to clearPeekData() sometime soon, which is supposed to free the allocated memory again.

When you call peekDataStore() more than once with a pointer != NULL, clearPeekData() will get called automatically.

Thread Local Storage means, there is one variable for each thread of the program. Replicators could as well declare a member variable used for that purpose instead, but that would waste a lot of memory when peeking interceptors are not used.

void* ZCom_Replicator::peekDataRetrieve  )  [protected, inherited]
 

Retrieve the peekbuffer pointer currently stored.

Returns:
Pointer previously stored with peekDataStore().


Member Data Documentation

zU8 ZCom_Replicator::m_flags [protected, inherited]
 

Additional replicator flags. ZCom_Replicator() c'tor will set this to 0. (ZCOM_REPLICATOR_*).

ZCom_ReplicatorSetup* ZCom_Replicator::m_setup [protected, inherited]
 

pointing to an instance of the setup class - all replication parameters are stored here


This file is part of the documentation for Zoidcom. Documentation copyright © 2004-2008 by Jörg Rüppel. Generated on Sat Aug 16 15:26:50 2008 for Zoidcom by doxygen 1.4.6-NO