Allows the web server to read from a fifo. More...
#include <process_io_handler.h>
Public Member Functions | |
| ProcessIOHandler (zmm::String filename, zmm::Ref< Executor > main_proc, zmm::Ref< zmm::Array< ProcListItem > > proclist=nil, bool ignoreSeek=false) | |
| Sets the filename to work with. | |
| virtual void | open (IN enum UpnpOpenFileMode mode) |
| Opens file for reading (writing is not supported). | |
| virtual int | read (OUT char *buf, IN size_t length) |
| Reads a previously opened file sequentially. | |
| virtual int | write (OUT char *buf, IN size_t length) |
| Writes to a previously opened file. | |
| virtual void | seek (IN off_t offset, IN int whence) |
| Performs seek on an open file. | |
| virtual void | close () |
| Close a previously opened file and kills the kill_pid process. | |
| ~ProcessIOHandler () | |
| virtual void | open (enum UpnpOpenFileMode mode) |
| Opens a data for the web server. | |
| virtual int | read (char *buf, size_t length) |
| Reads previously opened/initialized data sequentially. | |
| virtual int | write (char *buf, size_t length) |
| Writes to previously opened/initialized data sequentially. | |
| virtual void | seek (off_t offset, int whence) |
| Performs a seek on an open/initialized data. | |
| void | retain () |
| void | release () |
| int | getRefCount () |
Static Public Member Functions | |
| static void * | operator new (size_t size) |
| static void | operator delete (void *ptr) |
Protected Member Functions | |
| bool | abort () |
| void | killall () |
| void | registerAll () |
| void | unregisterAll () |
Protected Attributes | |
| zmm::Ref< zmm::Array < ProcListItem > > | proclist |
| List of associated processes. | |
| zmm::Ref< Executor > | main_proc |
| Main process used for reading. | |
| zmm::String | filename |
| name of the file or fifo to read the data from | |
| int | fd |
| file descriptor | |
| bool | ignore_seek |
| if this flag is set seek on a fifo will not return an error | |
| mt_atomic_t | _ref_count |
| pthread_mutex_t | mutex |
Allows the web server to read from a fifo.
Definition at line 55 of file process_io_handler.h.
| ProcessIOHandler::ProcessIOHandler | ( | zmm::String | filename, | |
| zmm::Ref< Executor > | main_proc, | |||
| zmm::Ref< zmm::Array< ProcListItem > > | proclist = nil, |
|||
| bool | ignoreSeek = false | |||
| ) |
Sets the filename to work with.
| filename | to read the data from | |
| proclist | associated processes that will be terminated once they are no longer needed |
| ProcessIOHandler::~ProcessIOHandler | ( | ) |
| bool ProcessIOHandler::abort | ( | ) | [protected] |
| virtual void ProcessIOHandler::close | ( | ) | [virtual] |
Close a previously opened file and kills the kill_pid process.
Reimplemented from IOHandler.
| int Object::getRefCount | ( | ) | [inherited] |
Definition at line 78 of file object.cc.
References zmm::Object::_ref_count, and atomic_get().
| void ProcessIOHandler::killall | ( | ) | [protected] |
| virtual void IOHandler::open | ( | enum UpnpOpenFileMode | mode | ) | [virtual, inherited] |
Opens a data for the web server.
| mode | in which the data will be opened (we only support UPNP_READ) |
Reimplemented in BufferedIOHandler, and IOHandlerBufferHelper.
| virtual void ProcessIOHandler::open | ( | IN enum UpnpOpenFileMode | mode | ) | [virtual] |
Opens file for reading (writing is not supported).
| void Object::operator delete | ( | void * | ptr | ) | [static, inherited] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| virtual int IOHandler::read | ( | char * | buf, | |
| size_t | length | |||
| ) | [virtual, inherited] |
Reads previously opened/initialized data sequentially.
| buf | This buffer will be filled by our read functions. | |
| length | Number of bytes to read. |
Reimplemented in IOHandlerBufferHelper.
Referenced by web_read().
| virtual int ProcessIOHandler::read | ( | OUT char * | buf, | |
| IN size_t | length | |||
| ) | [virtual] |
Reads a previously opened file sequentially.
| buf | Data from the file will be copied into this buffer. | |
| length | Number of bytes to be copied into the buffer. |
| void ProcessIOHandler::registerAll | ( | ) | [protected] |
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| virtual void IOHandler::seek | ( | off_t | offset, | |
| int | whence | |||
| ) | [virtual, inherited] |
Performs a seek on an open/initialized data.
| offset | Number of bytes to move in the buffer. For seeking forwards positive values are used, for seeking backwards - negative. Offset must be positive if origin is set to SEEK_SET | |
| whence | The position to move relative to. SEEK_CUR to move relative to current position, SEEK_END to move relative to the end of file, SEEK_SET to specify an absolute offset. |
Reimplemented in IOHandlerBufferHelper.
Referenced by web_seek().
| virtual void ProcessIOHandler::seek | ( | IN off_t | offset, | |
| IN int | whence | |||
| ) | [virtual] |
Performs seek on an open file.
| offset | Number of bytes to move in the file. For seeking forwards positive values are used, for seeking backwards - negative. Offset must be positive if origin is set to SEEK_SET | |
| whence | The position to move relative to. SEEK_CUR to move relative to current position, SEEK_END to move relative to the end of file, SEEK_SET to specify an absolute offset. |
| void ProcessIOHandler::unregisterAll | ( | ) | [protected] |
| virtual int IOHandler::write | ( | char * | buf, | |
| size_t | length | |||
| ) | [virtual, inherited] |
Writes to previously opened/initialized data sequentially.
| buf | Data to be written. | |
| length | Number of bytes to write. |
| virtual int ProcessIOHandler::write | ( | OUT char * | buf, | |
| IN size_t | length | |||
| ) | [virtual] |
Writes to a previously opened file.
| buf | Data from the buffer will be written to the file. | |
| length | Number of bytes to be written from the buffer. |
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
int ProcessIOHandler::fd [protected] |
file descriptor
Definition at line 106 of file process_io_handler.h.
zmm::String ProcessIOHandler::filename [protected] |
name of the file or fifo to read the data from
Definition at line 103 of file process_io_handler.h.
bool ProcessIOHandler::ignore_seek [protected] |
if this flag is set seek on a fifo will not return an error
Definition at line 109 of file process_io_handler.h.
zmm::Ref<Executor> ProcessIOHandler::main_proc [protected] |
Main process used for reading.
Definition at line 100 of file process_io_handler.h.
pthread_mutex_t zmm::Object::mutex [protected, inherited] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, Singleton< Storage >, and Singleton< SessionManager >.
Definition at line 56 of file object.h.
Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().
zmm::Ref<zmm::Array<ProcListItem> > ProcessIOHandler::proclist [protected] |
List of associated processes.
Definition at line 97 of file process_io_handler.h.
1.6.1