Source: tracedecoderrepository.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                    Master Thesis Implementation                  ####
// ####  Management of Layered Variable Bitrate Multimedia Streams over  ####
// ####                  DiffServ with A Priori Knowledge                ####
// ####                                                                  ####
// #### ================================================================ ####
// ####                                                                  ####
// ####                                                                  ####
// #### Trace Decoder 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 TRACEDECODERREPOSITORY_H
#define TRACEDECODERREPOSITORY_H


#include "system.h"
#include "tracedecoderinterface.h"
#include "decoderrepositoryinterface.h"


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


namespace Coral {


/**
  * This class is a repository for trace decoders.
  *
  * @short   Trace Decoder Repository
  * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
  * @version 1.0
  */
class TraceDecoderRepository : virtual public DecoderRepositoryInterface,
                               virtual public TraceDecoderInterface
{
   public:
   // ====== Constructor/Destructor =========================================
   /**
     * Constructor.
     */
   TraceDecoderRepository();

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


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

   /**
     * Remove trace decoder from repository.
     *
     * @param decoder Trace decoder to be removed.
     */
   void removeDecoder(TraceDecoderInterface* decoder);

   /**
     * selectDecoderForTypeID() implementation of DecoderRepositoryInterface.
     *
     * @see DecoderRepositoryInterface#selectDecoderForTypeID
     */
   bool selectDecoderForTypeID(const card16 typeID);

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

   /**
     * getCurrentDecoder() implementation of DecoderRepositoryInterface.
     *
     * @see DecoderRepositoryInterface#getCurrentDecoder
     */
   DecoderInterface* getCurrentDecoder() const;

   /**
     * Get TraceDecoderInterface of the current decoder.
     *
     * @return Current decoder's TraceDecoderInterface.
     */
   TraceDecoderInterface* getCurrentTraceDecoder() const;


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

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

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

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

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

   /**
     * getMediaInfo() implementation of DecoderInterface.
     *
     * @see DecoderInterface#getMediaInfo
     */
   void getMediaInfo(MediaInfo& mediaInfo) const;

   /**
     * getErrorCode() implementation of DecoderInterface.
     *
     * @see DecoderInterface#getErrorCode
     */
   card8 getErrorCode() const;

   /**
     * getPosition() implementation of DecoderInterface.
     *
     * @see DecoderInterface#getPosition
     */
   card64 getPosition() const;

   /**
     * getMaxPosition() implementation of DecoderInterface.
     *
     * @see DecoderInterface#getMaxPosition
     */
   card64 getMaxPosition() const;

   /**
     * checkNextPacket() implementation of DecoderInterface.
     *
     * @see DecoderInterface#checkNextPacket
     */
   bool checkNextPacket(DecoderPacket* decoderPacket);

   /**
     * handleNextPacket() implementation of DecoderInterface.
     *
     * @see DecoderInterface#handleNextPacket
     */
   void handleNextPacket(const DecoderPacket* decoderPacket);


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

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

   /**
     * getBandwidth() implementation of TraceEncoderInterface.
     *
     * @see TraceEncoderInterface#getBandwidth
     */
   Range<cardinal> getBandwidth() const;

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

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


   // ====== Private data ===================================================
   private:
   multimap<const card16,TraceDecoderInterface*> TraceDecoderRepository;
   TraceDecoderInterface*                        Decoder;
   bool                                          AutoDelete;
};


}


#include "tracedecoderrepository.icc"


#endif

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