fvfile_block.h

00001
00002 /***************************************************************************
00003  *  fvfile_block.h - FireVision file block
00004  *
00005  *  Created: Fri Mar 28 11:52:45 2008
00006  *  Copyright  2008  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #ifndef __FIREVISION_FVUTILS_FILEFORMAT_FVFILE_BLOCK_H_
00025 #define __FIREVISION_FVUTILS_FILEFORMAT_FVFILE_BLOCK_H_
00026 
00027 #include <fvutils/fileformat/fvff.h>
00028 #include <cstddef>
00029
00030 class FireVisionDataFileBlock
00031 {
00032  public:
00033   FireVisionDataFileBlock(unsigned int type, size_t data_size,
00034                           void *spec_header, size_t spec_header_size);
00035   FireVisionDataFileBlock(unsigned int type, size_t data_size,
00036                           size_t spec_header_size);
00037   FireVisionDataFileBlock(unsigned int type, size_t data_size);
00038   FireVisionDataFileBlock(FireVisionDataFileBlock *block);
00039   virtual ~FireVisionDataFileBlock();
00040
00041   unsigned int  type() const;
00042   void *        block_memptr() const;
00043   size_t        block_size() const;
00044   void *        data_ptr() const;
00045   size_t        data_size() const;
00046
00047  protected:
00048   void set_spec_header(void *spec_header, size_t spec_header_size);
00049
00050   void   *_data;
00051   size_t  _data_size;
00052   void   *_spec_header;
00053
00054  private:
00055   void constructor(unsigned int type, size_t data_size,
00056                    void *spec_header, size_t spec_header_size);
00057
00058   fvff_block_header_t *__block_header;
00059   void                *__block_memptr;
00060   size_t               __block_size;
00061   bool                 __block_owner;
00062
00063   size_t               __spec_header_size;
00064 };
00065
00066 #endif