recordbase.h

00001 /***************************************************************************
00002 *   Copyright (C) 2001 by Rick L. Vinyard, Jr.                            *
00003 *   rvinyard@cs.nmsu.edu                                                  *
00004 *                                                                         *
00005 *   This program is free software; you can redistribute it and/or modify  *
00006 *   it under the terms of the GNU Lesser General Public License as        *
00007 *   published by the Free Software Foundation version 2.1.                *
00008 *                                                                         *
00009 *   This program is distributed in the hope that it will be useful,       *
00010 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012 *   GNU General Public License for more details.                          *
00013 *                                                                         *
00014 *   You should have received a copy of the GNU Lesser General Public      *
00015 *   License along with this library; if not, write to the                 *
00016 *   Free Software Foundation, Inc.,                                       *
00017 *   51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA              *
00018 ***************************************************************************/
00019 #ifndef BITRECORDBASE_H
00020 #define BITRECORDBASE_H
00021 
00022 #include <bit/fieldbase.h>
00023 
00024 namespace bit {
00025 
00032 class RecordBase : public FieldBase
00033 {
00034 public:
00035   typedef boost::shared_ptr<RecordBase> pointer;
00036   
00037   RecordBase( std::string name="",
00038               size_t length_units=BITS,
00039               int offset=0,
00040               size_t offset_units=BITS,
00041               std::string descr=""
00042             );
00043 
00044     virtual ~RecordBase();
00045 
00046     virtual size_t length_units() const;
00047 
00048     virtual void set_length_units(size_t units);
00049 
00051     virtual int offset() const;
00052 
00053     virtual int offset(size_t units) const;
00054 
00055     virtual void set_offset(int offset);
00056 
00057     virtual size_t offset_units() const;
00058 
00059     virtual void set_offset_units(size_t units);
00060 
00068     virtual std::string name() const;
00069 
00070     virtual std::string name(int depth) const;
00071 
00073     virtual void set_name(const std::string& name);
00074 
00078     virtual std::string description() const;
00079 
00081     virtual void set_description(const std::string& description);
00082 
00083     virtual void add_field(FieldBase::pointer child) = 0;
00084 
00085     virtual void remove_field(const std::string& name) = 0;
00086 
00087   protected:
00088     std::string m_name;
00089     size_t m_length_units;
00090     int m_offset;
00091     size_t m_offset_units;
00092     std::string m_description;
00093 
00094 };
00095 
00096 }
00097 
00098 #endif

Generated on Thu Jul 6 14:38:08 2006 by  doxygen 1.4.6