# class DataEndpoint

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

Full name | `TelEngine::DataEndpoint`
Definition | `#include <yatephone.h>`
Inherits | TelEngine::RefObject [public ]
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- explicit DataEndpoint (CallEndpoint* call = 0, const char* name = "audio")
- virtual void destroyed ()
- virtual void* getObject (const String& name) const
- virtual const String& toString () const
- Mutex* mutex () const
- bool connect (DataEndpoint* peer)
- bool disconnect ()
- void setSource (DataSource* source = 0)
- inline DataSource* getSource () const
- void setConsumer (DataConsumer* consumer = 0)
- inline DataConsumer* getConsumer () const
- void setPeerRecord (DataConsumer* consumer = 0)
- inline DataConsumer* getPeerRecord () const
- void setCallRecord (DataConsumer* consumer = 0)
- inline DataConsumer* getCallRecord () const
- bool clearData (DataNode* node)
- bool addSniffer (DataConsumer* sniffer)
- bool delSniffer (DataConsumer* sniffer)
- inline DataConsumer* getSniffer (const String& name)
- void clearSniffers ()
- inline DataEndpoint* getPeer () const
- inline CallEndpoint* getCall () const
- inline const String& name () const
- inline void clearCall (const CallEndpoint* call)
- virtual bool control (NamedList& params)

#### Public Static Methods

- static Mutex& commonMutex ()

#### Protected Methods

- virtual bool nativeConnect (DataEndpoint* peer)

## Detailed Description

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

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

### DataEndpoint

Creates an empty data endpoint

void destroyed ()

### destroyed

[virtual]

Endpoint destruct notification, clears source and consumer

Reimplemented from RefObject.

void* getObject (const String& name)

### getObject

[const virtual]

Get a pointer to a derived class given that class name

Parameters:

name | Name of the class we are asking for

Returns: Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from RefObject.

const String& toString ()

### toString

[const virtual]

Get a string identification of the endpoint

Returns: A reference to this endpoint's name

Reimplemented from GenObject.

Mutex* 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

Mutex& commonMutex ()

### commonMutex

[static]

Get the big mutex that serializes access to all data endpoints

Returns: A reference to the mutex

bool connect (DataEndpoint* peer)

### connect

Connect the source and consumer of the endpoint to a peer

Parameters:

peer | Pointer to the peer data endpoint

Returns: True if connected, false if incompatible source/consumer

bool disconnect ()

### disconnect

Disconnect from the connected endpoint

Returns: True if the object was deleted, false if it still exists

void setSource (DataSource* source = 0)

### setSource

Set the data source of this object

Parameters:

source | A pointer to the new source or NULL

inline DataSource* getSource ()

### getSource

[const]

Get the data source of this object

Returns: A pointer to the DataSource object or NULL

void setConsumer (DataConsumer* consumer = 0)

### setConsumer

Set the data consumer of this object

Parameters:

consumer | A pointer to the new consumer or NULL

inline DataConsumer* getConsumer ()

### getConsumer

[const]

Get the data consumer of this object

Returns: A pointer to the DataConsumer object or NULL

void setPeerRecord (DataConsumer* consumer = 0)

### setPeerRecord

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

Parameters:

consumer | A pointer to the new consumer or NULL

inline DataConsumer* getPeerRecord ()

### getPeerRecord

[const]

Get the data consumer used for recording peer generated data.

Returns: A pointer to the DataConsumer object or NULL

void setCallRecord (DataConsumer* consumer = 0)

### setCallRecord

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

Parameters:

consumer | A pointer to the new consumer or NULL

inline DataConsumer* getCallRecord ()

### getCallRecord

[const]

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

Returns: A pointer to the DataConsumer object or NULL

bool clearData (DataNode* node)

### clearData

Clear a data node from any slot of this object

Parameters:

node | Pointer to DataSource or DataConsumer to clear

Returns: True if the node was removed from at least one slot

bool addSniffer (DataConsumer* sniffer)

### addSniffer

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

Parameters:

sniffer | Pointer to the DataConsumer to add to sniffer list

Returns: True if the sniffer was added to list, false if NULL or already added

bool delSniffer (DataConsumer* sniffer)

### delSniffer

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

Parameters:

sniffer | Pointer to the DataConsumer to remove from sniffer list

Returns: True if the sniffer was removed from list

inline DataConsumer* getSniffer (const String& name)

### getSniffer

Find a sniffer by name

Parameters:

name | Name of the sniffer to find

Returns: Pointer to DataConsumer or NULL if not found

void clearSniffers ()

### clearSniffers

Removes all sniffers from the list and dereferences them

inline DataEndpoint* getPeer ()

### getPeer

[const]

Get a pointer to the peer endpoint

Returns: A pointer to the peer endpoint or NULL

inline CallEndpoint* getCall ()

### getCall

[const]

Get a pointer to the owner call

Returns: A pointer to the owner call or NULL

inline const String& name ()

### name

[const]

Get the name set in constructor

Returns: A reference to the name as hashed string

inline void clearCall (const CallEndpoint* call)

### clearCall

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

Parameters:

call | Pointer to the call endpoint that is to be cleared

bool control (NamedList& params)

### control

[virtual]

Modify data parameters

Parameters:

params | The list of parameters to change

Returns: True if processed

bool nativeConnect (DataEndpoint* peer)

### nativeConnect

[protected virtual]

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

Parameters:

peer | Pointer to the endpoint data driver

Returns: True if connected, false if failed native connection

Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.