degate  0.1.2
HlObjectSet.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 __HLOBJECTSET_H__
00023 #define __HLOBJECTSET_H__
00024 
00025 #include <degate.h>
00026 #include <set>
00027 #include <list>
00028 #include <map>
00029 #include <memory>
00030 #include <ObjectSet.h>
00031 
00032 namespace degate {
00033 
00034   /**
00035    * This class represents a collection of highlighted objects.
00036    */
00037   class HlObjectSet : public ObjectSet {
00038 
00039   private:
00040     typedef std::map<ConnectedLogicModelObject_shptr,
00041                      std::list<ConnectedLogicModelObject_shptr> > adjacent_objects_t;
00042     adjacent_objects_t adjacent_objects;
00043 
00044   private:
00045     void highlight_adjacent_objects(ConnectedLogicModelObject_shptr o,
00046                                     LogicModel_shptr lmodel);
00047 
00048     void unhighlight_adjacent_objects(adjacent_objects_t::mapped_type & list);
00049 
00050     void highlight(PlacedLogicModelObject::HIGHLIGHTING_STATE state);
00051 
00052   public:
00053     void clear();
00054     void add(degate::PlacedLogicModelObject_shptr object);
00055     void add(degate::PlacedLogicModelObject_shptr object,
00056              LogicModel_shptr lmodel);
00057     void remove(degate::PlacedLogicModelObject_shptr object);
00058   };
00059 }
00060 
00061 #endif