Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# DatagramSink Class Reference

This class defines the abstract interface to sending datagrams to any target, whether it be into a file or across the net. More...

Inheritance diagram for DatagramSink:

List of all members.

## Public Member Functions
bool | copyDatagram (SubfileInfo result, Filename const filename)
| Copies the file data from the entire indicated file (via the vfs) as the next datagram.
bool | copyDatagram (SubfileInfo result, SubfileInfo const source)
| Copies the file data from the range of the indicated file (outside of the vfs) as the next datagram.
| flush ()
FileReference const | getFile ()
| Returns the FileReference that provides the target for these datagrams, if any, or NULL if the datagrams do not written to a file on disk.
Filename const | getFilename ()
| Returns the filename that provides the target for these datagrams, if any, or empty string if the datagrams do not get written to a file on disk.
int | getFilePos ()
| Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined.
bool | isError ()
bool | putDatagram (Datagram const data)

## Detailed Description

This class defines the abstract interface to sending datagrams to any target, whether it be into a file or across the net.

## Member Function Documentation

bool copyDatagram | ( | SubfileInfo | result,
|  | Filename const | filename
| ) |  |

Copies the file data from the entire indicated file (via the vfs) as the next datagram.

This is intended to support potentially very large datagrams.

Returns true on success, false on failure or if this method is unimplemented. On true, fills "result" with the information that references the copied file, if possible.

bool copyDatagram | ( | SubfileInfo | result,
|  | SubfileInfo const | source
| ) |  |

Copies the file data from the range of the indicated file (outside of the vfs) as the next datagram.

This is intended to support potentially very large datagrams.

Returns true on success, false on failure or if this method is unimplemented. On true, fills "result" with the information that references the copied file, if possible.

flush | ( |  | ) |

Reimplemented in DatagramSinkNet.

FileReference const getFile | ( |  | ) |

Returns the FileReference that provides the target for these datagrams, if any, or NULL if the datagrams do not written to a file on disk.

Filename const getFilename | ( |  | ) |

Returns the filename that provides the target for these datagrams, if any, or empty string if the datagrams do not get written to a file on disk.

int getFilePos | ( |  | ) |

Returns the current file position within the data stream, if any, or 0 if the file position is not meaningful or cannot be determined.

For DatagramSinks that return a meaningful file position, this will be pointing to the first byte following the datagram returned after a call to put_datagram().

bool isError | ( |  | ) |

Reimplemented in DatagramSinkNet.

bool putDatagram | ( | Datagram const | data | ) |

Reimplemented in DatagramSinkNet.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties