degate 0.1.1
ConnectedLogicModelObject.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 __CONNECTEDLOGICMODELOBJECT_H__
00023 #define __CONNECTEDLOGICMODELOBJECT_H__
00024 
00025 #include "globals.h"
00026 #include "Net.h"
00027 #include "PlacedLogicModelObject.h"
00028 
00029 namespace degate {
00030 
00031   /**
00032    * Represents a logic model object, that can be electrically connected to other
00033    * logic model objects.
00034    */
00035 
00036   class ConnectedLogicModelObject : public PlacedLogicModelObject  {
00037 
00038   private:
00039 
00040     Net_shptr net;
00041 
00042   public:
00043 
00044     /**
00045      * Construct an object.
00046      */
00047 
00048     ConnectedLogicModelObject();
00049 
00050 
00051     /**
00052      * Destroy object. It will deregister this object from the net.
00053      * @see remove_net()
00054      */
00055 
00056     virtual ~ConnectedLogicModelObject();
00057 
00058     /**
00059      * Set the net for this object. This method will add the object to the net.
00060      */
00061     virtual void set_net(Net_shptr net);
00062 
00063     /**
00064      * Remove the net from this object. It will deregister this object
00065      * from the net's connection list as well.
00066      */
00067     virtual void remove_net();
00068 
00069 
00070     /**
00071      * Get a shared pointer to the net.
00072      */
00073     virtual Net_shptr get_net();
00074 
00075     /**
00076      * Check if an connectable object is connected to
00077      * another connectable object.
00078      * @return Returns true, if this object is connected to
00079      *   another object. Else false is returned.
00080      */
00081     virtual bool is_connected() const;
00082   };
00083 
00084 }
00085 
00086 #endif