CHeaderManager class

(C)Copyright 2000 NTT Cyber Space Laboratories

# `CHeaderManager class`

name
  `CHeaderManager` - class for TwinVQ bit stream header management
interface
  `class CHeaderManager {
  public:
  // initialization, destructor
  static CHeaderManager* Create(CChunkChunk& twinChunk); // static member function for initialization
  virtual ~CHeaderManager(); // destructor
  // member functions
  const std::string GetID(); // TwinVQ get TwinVQ data ID
  CChunk GetPrimaryChunk(std::string chunkID); // get normal chunk information
  CChunk GetSecondaryChunk(std::string chunkID); // get auxiliary chunk information
  // exception
  class err_FailGetChunk; // failure in data acquisition
  }`
description of functions
  Class `CHeaderManager` stores the bit stream header information. At the initialization, it creates data base by reading `twinChunk` information stored in `CChunkChunk` class objects. Header information can be accessed by `GetPrimaryChunk()` and `GetSecondaryChunk()`
creation, initialization
  This class has no released constructor. Instead, creation and initialization are carried out by static member function `Create()`. This function reads header information twinChunk and returns a pointer to a CHeaderChunk class objects. If the `twinChunk` format is incorrect, `Create()` returns NULL.
  twinChunk consists of TwinVQ data header and generated by `TvqGetBsHeaderInfo()` in a sample program.
  An Initialized object should be removed by `delete` when it becomes unnecessary.
  An example of creation and initialization of header manager (`theHeaderManager`) is shown as follows.

      CChunkChunk *twinChunk = TvqGetBsHeaderInfo(bfp);
      CHeaderManager *theHeaderManager = CHeaderManager::Create(*twinChunk);

description of member functions
  `std::string GetID()`
    gets TwinVQ header ID (12 characters beginning from "TWIN")
  `CChunk GetPrimaryChunk( std::string chunkID)`
    gets normal header chunk information specified by chunkID as a CChunk object. In case of failure, it returns `err_FailGetChunk`.
  `CChunk GetSecondaryChunk(std::string chunkID)`
    gets auxiliary header chunk information specified by chunkID as a CChunk object. In case of failure, it returns `err_FailGetChunk`.
include file name
  `CHeaderManager.h`
file name containing these functions
  `HeaderManager.cxx`
reference
  `TvqGetBsHeaderInfo()`, CChunk