Yate
Public Member Functions | Static Public Member Functions | Protected Member Functions

DataEndpoint Class Reference

A data transfer endpoint capable of sending and/or receiving data. More...

#include <yatephone.h>

Inheritance diagram for DataEndpoint:
RefObject GenObject

List of all members.

Public Member Functions

 DataEndpoint (CallEndpoint *call=0, const char *name="audio")
virtual void destroyed ()
virtual void * getObject (const String &name) const
virtual const StringtoString () const
Mutexmutex () const
bool connect (DataEndpoint *peer)
bool disconnect ()
void setSource (DataSource *source=0)
DataSourcegetSource () const
void setConsumer (DataConsumer *consumer=0)
DataConsumergetConsumer () const
void setPeerRecord (DataConsumer *consumer=0)
DataConsumergetPeerRecord () const
void setCallRecord (DataConsumer *consumer=0)
DataConsumergetCallRecord () const
bool clearData (DataNode *node)
bool addSniffer (DataConsumer *sniffer)
bool delSniffer (DataConsumer *sniffer)
DataConsumergetSniffer (const String &name)
void clearSniffers ()
DataEndpointgetPeer () const
CallEndpointgetCall () const
const Stringname () const
void clearCall (const CallEndpoint *call)
virtual bool control (NamedList &params)

Static Public Member Functions

static MutexcommonMutex ()

Protected Member Functions

virtual bool nativeConnect (DataEndpoint *peer)

Detailed Description

A data transfer endpoint capable of sending and/or receiving data.

The DataEndpoint holds an endpoint capable of performing unidirectional or bidirectional data transfers


Constructor & Destructor Documentation

DataEndpoint ( CallEndpoint call = 0,
const char *  name = "audio" 
)

Creates an empty data endpoint


Member Function Documentation

bool addSniffer ( DataConsumer sniffer)

Adds a data consumer to the list of sniffers of the local call data

Parameters:
snifferPointer to the DataConsumer to add to sniffer list
Returns:
True if the sniffer was added to list, false if NULL or already added
void clearCall ( const CallEndpoint call) [inline]

Clear the owner call endpoint. Works only if the caller provides the correct owner pointer

Parameters:
callPointer to the call endpoint that is to be cleared
bool clearData ( DataNode node)

Clear a data node from any slot of this object

Parameters:
nodePointer to DataSource or DataConsumer to clear
Returns:
True if the node was removed from at least one slot
void clearSniffers ( )

Removes all sniffers from the list and dereferences them

static Mutex& commonMutex ( ) [static]

Get the big mutex that serializes access to all data endpoints

Returns:
A reference to the mutex
bool connect ( DataEndpoint peer)

Connect the source and consumer of the endpoint to a peer

Parameters:
peerPointer to the peer data endpoint
Returns:
True if connected, false if incompatible source/consumer
virtual bool control ( NamedList params) [virtual]

Modify data parameters

Parameters:
paramsThe list of parameters to change
Returns:
True if processed
bool delSniffer ( DataConsumer sniffer)

Remove a data consumer from the list of sniffers of the local call data

Parameters:
snifferPointer to the DataConsumer to remove from sniffer list
Returns:
True if the sniffer was removed from list
virtual void destroyed ( ) [virtual]

Endpoint destruct notification, clears source and consumer

Reimplemented from RefObject.

bool disconnect ( )

Disconnect from the connected endpoint

Returns:
True if the object was deleted, false if it still exists
CallEndpoint* getCall ( ) const [inline]

Get a pointer to the owner call

Returns:
A pointer to the owner call or NULL
DataConsumer* getCallRecord ( ) const [inline]

Get the data consumer used for recording local call generated data.

Returns:
A pointer to the DataConsumer object or NULL
DataConsumer* getConsumer ( ) const [inline]

Get the data consumer of this object

Returns:
A pointer to the DataConsumer object or NULL
virtual void* getObject ( const String name) const [virtual]

Get a pointer to a derived class given that class name

Parameters:
nameName of the class we are asking for
Returns:
Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from GenObject.

DataEndpoint* getPeer ( ) const [inline]

Get a pointer to the peer endpoint

Returns:
A pointer to the peer endpoint or NULL
DataConsumer* getPeerRecord ( ) const [inline]

Get the data consumer used for recording peer generated data.

Returns:
A pointer to the DataConsumer object or NULL
DataConsumer* getSniffer ( const String name) [inline]

Find a sniffer by name

Parameters:
nameName of the sniffer to find
Returns:
Pointer to DataConsumer or NULL if not found
DataSource* getSource ( ) const [inline]

Get the data source of this object

Returns:
A pointer to the DataSource object or NULL
Mutex* mutex ( ) const

Get the mutex that serializes access to this data endpoint, if any

Returns:
Pointer to the call's mutex object or NULL
const String& name ( ) const [inline]

Get the name set in constructor

Returns:
A reference to the name as hashed string
virtual bool nativeConnect ( DataEndpoint peer) [inline, protected, virtual]

Attempt to connect the endpoint to a peer of the same type

Parameters:
peerPointer to the endpoint data driver
Returns:
True if connected, false if failed native connection
void setCallRecord ( DataConsumer consumer = 0)

Set the data consumer for recording local call generated data This will be connected to the local data source.

Parameters:
consumerA pointer to the new consumer or NULL
void setConsumer ( DataConsumer consumer = 0)

Set the data consumer of this object

Parameters:
consumerA pointer to the new consumer or NULL
void setPeerRecord ( DataConsumer consumer = 0)

Set the data consumer for recording peer generated data. This will be connected to the peer data source.

Parameters:
consumerA pointer to the new consumer or NULL
void setSource ( DataSource source = 0)

Set the data source of this object

Parameters:
sourceA pointer to the new source or NULL
virtual const String& toString ( ) const [virtual]

Get a string identification of the endpoint

Returns:
A reference to this endpoint's name

Reimplemented from GenObject.


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