Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

mxcpcStreamSource.h

00001 //           ///          //                                        Mx clientSDK
00002 //          /////        ////                    Mx Crossplatform Client Library
00003 //         /// XXX     XXX ///
00004 //        ///    XXX XXX    ///     $RCSfile: mxcpcStreamSource.h,v $
00005 //       ///       XXX       ///     $Revision: 1.4 $
00006 //      ///      XXX XXX      ///     $Date: 2005/12/12 19:29:16 $
00007 //     ////    XXX     XXX    ////     $Author: cvs-kai $
00008 //    ////                     ////
00009 //   ////  M  O  B  O  T  I  X  ////////////////////////////////////////////////
00010 //  //// Security Vision Systems //////////////////////////////////////////////
00011 //                                                                          //
00012 //  Copyright (C) 2005 - 2006, MOBOTIX AG, Germany                         //
00013 //  This software is made available under the BSD licence. Please refer   //
00014 //  to the file LICENCE.TXT contained in this distribution for details.  //
00015 //                                                                      //
00016 //  /////////////////////////////////////////////////////////////////////
00017 
00018 
00019 
00020 #ifndef __MXCPC_STREAMSOURCE_H__
00021 #define __MXCPC_STREAMSOURCE_H__
00022 
00023 
00024 
00025 //! Abstract representation of a (media) stream source.
00026 /*!
00027  *  \ingroup mxcpc_core
00028  */
00029 class mxcpcStreamSource {
00030 
00031  public:
00032   virtual ~mxcpcStreamSource();
00033   
00034  public:
00035   //! Fetches at most <tt>num</tt> raw stream bytes from the stream source,
00036   //! writes them to the specified buffer, and returns the number of bytes
00037   //! actually fetched.
00038   /*!
00039    *  A return value of <tt>0</tt> is not necessarily an error - maybe there
00040    *  simply were no more bytes available when the method was called.
00041    *
00042    *  However, in case of error, it is also <tt>0</tt> that is returned. 
00043    *
00044    *  In case of a return value of <tt>0</tt>,
00045    *  use the stillUp() method to test whether or not the stream source is
00046    *  still operational. If it is not, all subsequent calls to fetchBytes() will
00047    *  return <tt>0</tt>.
00048    */
00049   virtual int fetchBytes(unsigned char *buffer, int num) = 0;
00050   //! Returns whether or not the stream source is still operational.
00051   /*!
00052    *  If a stream source has become "not-up" once, it will never come up again.
00053    *  Instead, its fetchBytes() method will return <tt>0</tt> on all subsequent
00054    *  calls. Possible examples for a stream source that has become no longer up
00055    *  are an encountered EOF or read error.
00056    */
00057   virtual bool stillUp(void) = 0;
00058 };
00059 
00060 
00061 
00062 #endif   // __MXCPC_STREAMSOURCE_H__

Generated on Fri Jan 20 13:33:34 2006 for mxcpc by  doxygen 1.4.4