Source: traceencoderrepository.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                    Master Thesis Implementation                  ####
// ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
// ####                  DiffServ with A Priori Knowledge                ####
// ####                                                                  ####
// #### ================================================================ ####
// ####                                                                  ####
// ####                                                                  ####
// #### Trace Encoder Repository                                         ####
// ####                                                                  ####
// #### Version 1.00  --  October 10, 2000                               ####
// ####                                                                  ####
// #### Copyright (C) 2000 Thomas Dreibholz                              ####
// #### University of Bonn, Department of Computer Science IV            ####
// #### EMail: Dreibholz@bigfoot.com                                     ####
// #### WWW:   http://www.bigfoot.com/~dreibholz/diplom/index.html       ####
// ####                                                                  ####
// ##########################################################################


#ifndef TRACEENCODERREPOSITORY_H
#define TRACEENCODERREPOSITORY_H


#include "system.h"
#include "synchronizable.h"
#include "encoderrepositoryinterface.h"
#include "traceencoderinterface.h"


#include <multimap.h>
#include <algo.h>


namespace Coral {


/**
  * This class is a repository for trace encoders.
  *
  * @short   Trace Encoder Repository
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */
class TraceEncoderRepository : virtual public EncoderRepositoryInterface,
                               virtual public TraceEncoderInterface
{
   // ====== Constructor/Destructor =========================================
   public:
   /**
     * Constructor.
     */
   TraceEncoderRepository();

   /**
     * Destructor.
     */
   ~TraceEncoderRepository();


   // ====== Repository functionality =======================================
   /**
     * Add trace encoder to repository.
     *
     * @param encoder New trace encoder to be added.
     * @return true, if encoder has been added; false, if not.
     */
   bool addEncoder(TraceEncoderInterface* encoder);

   /**
     * Remove trace encoder from repository.
     *
     * @param encoder Trace encoder to be removed.
     */
   void removeEncoder(TraceEncoderInterface* encoder);

   /**
     * selectEncoderForTypeID() implementation of EncoderRepositoryInterface.
     *
     * @see EncoderRepositoryInterface#selectEncoderForTypeID
     */
   bool selectEncoderForTypeID(const card16 typeID);

   /**
     * Set AutoDelete mode. If true, all encoders will be deleted with delete
     * operator by the destructor.
     */
   inline void setAutoDelete(const bool on);

   /**
     * getCurrentEncoder() implementation of EncoderRepositoryInterface.
     *
     * @see EncoderRepositoryInterface#getCurrentEncoder
     */
   EncoderInterface* getCurrentEncoder() const;

   /**
     * Get TraceEncoderInterface of the current encoder.
     *
     * @return Current encoder's TraceEncoderInterface.
     */
   TraceEncoderInterface* getCurrentTraceEncoder() const;


   // ====== EncoderInterface implementation ================================
   /**
     * getTypeID() implementation of EncoderInterface.
     *
     * @see EncoderInterface#getTypeID
     */
   const card16 getTypeID() const;

   /**
     * getTypeName implementation of EncoderInterface.
     *
     * @see EncoderInterface#getTypeName
     */
   const char* getTypeName() const;

   /**
     * activate() implementation of EncoderInterface.
     *
     * @see EncoderInterface#activate
     */
   void activate();

   /**
     * deactivate() implementation of EncoderInterface.
     *
     * @see EncoderInterface#deactivate
     */
   void deactivate();

   /**
     * reset() implementation of EncoderInterface.
     *
     * @see EncoderInterface#reset
     */
   void reset();

   /**
     * checkInterval() implementation of EncoderInterface.
     *
     * @see EncoderInterface#checkInterval
     */
   card64 checkInterval();


   /**
     * prepareNextFrame() implementation of EncoderInterface.
     *
     * @see EncoderInterface#prepareNextFrame
     */
   bool prepareNextFrame(const cardinal headerSize,
                         const cardinal maxPacketSize,
                         const cardinal flags);

   /**
     * getNextPacket() implementation of EncoderInterface.
     *
     * @see EncoderInterface#getNextPacket
     */
   cardinal getNextPacket(EncoderPacket* encoderPacket);


   /**
     * getQoSDescription() implementation of EncoderInterface.
     *
     * @see EncoderInterface#getQoSDescription
     */
   AbstractQoSDescription* getQoSDescription(const cardinal pktHeaderSize,
                                             const cardinal pktMaxSize,
                                             const card64   position);

   /**
     * updateQuality() implementation of EncoderInterface.
     *
     * @see EncoderInterface#updateQuality
     */
   void updateQuality(const AbstractQoSDescription* aqd);


   // ====== TraceEncoderInterface implementation ===========================
   /**
     * getWantedUtilization() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#getWantedUtilization
     */
   double getWantedUtilization() const;

   /**
     * setWantedUtilization() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#setWantedUtilization
     */
   void setWantedUtilization(const double utilization);

   /**
     * getStreamPriority() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#getStreamPriority
     */
   int8 getStreamPriority() const;

   /**
     * setStreamPriority() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#setStreamPriority
     */
   void setStreamPriority(const int8 priority);

   /**
     * getMaxWantedDelay() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#getMaxWantedDelay
     */
   double getMaxWantedDelay() const;

   /**
     * setMaxWantedDelay() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#setMaxWanted
     */
   void setMaxWantedDelay(const double delay);

   /**
     * getMinWantedBandwidth() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#getMinWantedBandwidth
     */
   cardinal getMinWantedBandwidth() const;

   /**
     * getMaxWantedBandwidth() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#getMaxWantedBandwidth
     */
   cardinal getMaxWantedBandwidth() const;

   /**
     * setMinWantedBandwidth() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#setMinWantedBandwidth
     */
   void setMinWantedBandwidth(const cardinal bandwidth);

   /**
     * setMaxWantedBandwidth() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#setMaxWantedBandwidth
     */
   void setMaxWantedBandwidth(const cardinal bandwidth);


   // ====== Private data ===================================================
   private:
   multimap<const card16,TraceEncoderInterface*> TraceEncoderRepository;
   TraceEncoderInterface*                        Encoder;
   bool                                          AutoDelete;
};


}


#include "traceencoderrepository.icc"


#endif

Generated by: viper@odin on Mon Oct 16 11:49:26 2000, using kdoc 2.0a36.