degate  0.1.2
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  Copyright 2012 Robert Nitsch
00007 
00008  Degate is free software: you can redistribute it and/or modify
00009  it under the terms of the GNU General Public License as published by
00010  the Free Software Foundation, either version 3 of the License, or
00011  any later version.
00012 
00013  Degate is distributed in the hope that it will be useful,
00014  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  GNU General Public License for more details.
00017 
00018  You should have received a copy of the GNU General Public License
00019  along with degate. If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifndef __CONNECTEDLOGICMODELOBJECT_H__
00024 #define __CONNECTEDLOGICMODELOBJECT_H__
00025 
00026 #include "globals.h"
00027 #include "Net.h"
00028 #include "PlacedLogicModelObject.h"
00029 
00030 namespace degate {
00031 
00032   /**
00033    * Represents a logic model object, that can be electrically connected to other
00034    * logic model objects.
00035    */
00036 
00037   class ConnectedLogicModelObject : public PlacedLogicModelObject  {
00038 
00039   private:
00040 
00041     Net_shptr net;
00042 
00043   public:
00044 
00045     /**
00046      * Construct an object.
00047      */
00048 
00049     ConnectedLogicModelObject();
00050 
00051 
00052     /**
00053      * Destroy object. It will deregister this object from the net.
00054      * @see remove_net()
00055      */
00056 
00057     virtual ~ConnectedLogicModelObject();
00058     
00059     void cloneDeepInto(DeepCopyable_shptr destination, oldnew_t *oldnew) const;
00060 
00061     /**
00062      * Set the net for this object. This method will add the object to the net.
00063      */
00064     virtual void set_net(Net_shptr net);
00065 
00066     /**
00067      * Remove the net from this object. It will deregister this object
00068      * from the net's connection list as well.
00069      */
00070     virtual void remove_net();
00071 
00072 
00073     /**
00074      * Get a shared pointer to the net.
00075      */
00076     virtual Net_shptr get_net();
00077 
00078     /**
00079      * Check if an connectable object is connected to
00080      * another connectable object.
00081      * @return Returns true, if this object is connected to
00082      *   another object. Else false is returned.
00083      */
00084     virtual bool is_connected() const;
00085   };
00086 
00087 }
00088 
00089 #endif