degate 0.1.1
LogicModelObjectBase.h
Go to the documentation of this file.
00001 /* -*-c++-*-
00002 
00003  This file is part of the IC reverse engineering tool degate.
00004 
00005  Copyright 2008, 2009, 2010 by Martin Schobert
00006 
00007  Degate is free software: you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by
00009  the Free Software Foundation, either version 3 of the License, or
00010  any later version.
00011 
00012  Degate is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU General Public License for more details.
00016 
00017  You should have received a copy of the GNU General Public License
00018  along with degate. If not, see <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00022 #ifndef __LOGICMODELOBJECTBASE_H__
00023 #define __LOGICMODELOBJECTBASE_H__
00024 
00025 #include "globals.h"
00026 #include <boost/format.hpp>
00027 
00028 namespace degate {
00029 
00030   /**
00031    * The class LogicModelObjectBase is the base class for basically every class
00032    * that represents a logic model object.
00033    */
00034   class LogicModelObjectBase {
00035 
00036   private:
00037 
00038     object_id_t object_id;
00039 
00040     std::string name;
00041     std::string description;
00042 
00043   public:
00044 
00045     /**
00046      * Create a new object.
00047      */
00048 
00049     LogicModelObjectBase(object_id_t oid = 0);
00050 
00051     /**
00052      * The constructor.
00053      */
00054 
00055     LogicModelObjectBase(std::string const& object_name,
00056                          std::string const& object_description);
00057 
00058     /**
00059      * The constructor.
00060      */
00061 
00062     LogicModelObjectBase(object_id_t oid,
00063                          std::string const& object_name,
00064                          std::string const& object_description);
00065 
00066     /**
00067      * The dtor.
00068      */
00069 
00070     virtual ~LogicModelObjectBase();
00071 
00072     /**
00073      * Set the name for a logic model object. It is up to the user
00074      * how the object is named. But it should be identifying.
00075      */
00076 
00077     virtual void set_name(std::string const& name);
00078 
00079     /**
00080      * Set the description for a logic model object. It is up to the user
00081      * how the object is described.
00082      */
00083 
00084     virtual void set_description(std::string const & description);
00085 
00086     /**
00087      * Get the name for a logic model object.
00088      */
00089 
00090     virtual std::string const & get_name() const;
00091 
00092     /**
00093      * Get the description for a logic model object.
00094      */
00095 
00096     virtual std::string const & get_description() const;
00097 
00098     /**
00099      * Check if a logic model object has a name.
00100      */
00101 
00102     virtual bool has_name() const;
00103 
00104     /**
00105      * Check if a logic model object has a description.
00106      */
00107 
00108     virtual bool has_description() const;
00109 
00110     /**
00111      * Set the object ID for a logic model object.
00112      */
00113 
00114     virtual void set_object_id(object_id_t oid);
00115 
00116     /**
00117      * Get the object ID for a logic model object.
00118      */
00119 
00120     virtual object_id_t get_object_id() const;
00121 
00122     /**
00123      * Check if the logic model object has a valid object ID.
00124      */
00125 
00126     virtual bool has_valid_object_id() const;
00127 
00128 
00129     /**
00130      * Get a human readable string that describes the whole
00131      * logic model object. The string should be unique in order
00132      * to let the user identify the concrete object. But that
00133      * is not a must.
00134      */
00135 
00136     virtual const std::string get_descriptive_identifier() const;
00137 
00138     /**
00139      * Get a human readable string that names the object type,
00140      * e.g. "Wire" or "Gate port".
00141      */
00142 
00143     virtual const std::string get_object_type_name() const;
00144 
00145   };
00146 
00147   typedef std::tr1::shared_ptr<LogicModelObjectBase> LogicModelObjectBase_shptr;
00148 }
00149 
00150 #endif