degate  0.1.2
Public Member Functions | Private Types | Private Member Functions | Private Attributes
degate::HlObjectSet Class Reference

This class represents a collection of highlighted objects. More...

#include <HlObjectSet.h>

Inheritance diagram for degate::HlObjectSet:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void clear ()
void add (degate::PlacedLogicModelObject_shptr object)
void add (degate::PlacedLogicModelObject_shptr object, LogicModel_shptr lmodel)
void remove (degate::PlacedLogicModelObject_shptr object)

Private Types

typedef std::map
< ConnectedLogicModelObject_shptr,
std::list
< ConnectedLogicModelObject_shptr > > 
adjacent_objects_t

Private Member Functions

void highlight_adjacent_objects (ConnectedLogicModelObject_shptr o, LogicModel_shptr lmodel)
void unhighlight_adjacent_objects (adjacent_objects_t::mapped_type &list)
void highlight (PlacedLogicModelObject::HIGHLIGHTING_STATE state)

Private Attributes

adjacent_objects_t adjacent_objects

Detailed Description

This class represents a collection of highlighted objects.

Definition at line 37 of file HlObjectSet.h.


Member Typedef Documentation

Definition at line 41 of file HlObjectSet.h.


Member Function Documentation

Reimplemented from degate::ObjectSet.

void HlObjectSet::clear ( ) [virtual]

Reimplemented from degate::ObjectSet.

Definition at line 30 of file HlObjectSet.cc.

                        {
  highlight(PlacedLogicModelObject::HLIGHTSTATE_NOT);

  
  for(adjacent_objects_t::iterator iter = adjacent_objects.begin();
      iter != adjacent_objects.end(); ++iter) {
    unhighlight_adjacent_objects(iter->second);
  }

  adjacent_objects.clear();
  ObjectSet::clear();
}

Definition at line 43 of file HlObjectSet.cc.

                                                                          {
  for(iterator it = begin(); it != end(); ++it)
    (*it)->set_highlighted(state);
}

Definition at line 66 of file HlObjectSet.cc.

                                                                      {
  Net_shptr net = o->get_net();
  if(net == NULL) return;

  // iterate over net
  BOOST_FOREACH(object_id_t oid, *net) {
    PlacedLogicModelObject_shptr plo = lmodel->get_object(oid);
    ConnectedLogicModelObject_shptr clo =
      std::dynamic_pointer_cast<ConnectedLogicModelObject>(plo);
    assert(clo != NULL);
    // remember connnected objects in list
    if(o != clo) {

      clo->set_highlighted(PlacedLogicModelObject::HLIGHTSTATE_ADJACENT);

      adjacent_objects[o].push_back(clo);
    }
  }
}

Reimplemented from degate::ObjectSet.

Definition at line 99 of file HlObjectSet.cc.

                                                                     {
  ObjectSet::remove(object);

  if(ConnectedLogicModelObject_shptr o =
     std::dynamic_pointer_cast<ConnectedLogicModelObject>(object) ) {
  
    adjacent_objects_t::iterator iter = adjacent_objects.find(o);
    if(iter != adjacent_objects.end()) {
      unhighlight_adjacent_objects((*iter).second);
    }
    adjacent_objects.erase(iter);
  }

  object->set_highlighted(PlacedLogicModelObject::HLIGHTSTATE_NOT);
}
void HlObjectSet::unhighlight_adjacent_objects ( adjacent_objects_t::mapped_type &  list) [private]

Definition at line 87 of file HlObjectSet.cc.

                                                                                   {
  // iterate over list
  BOOST_FOREACH(ConnectedLogicModelObject_shptr clo, list) {

    adjacent_objects_t::iterator iter = adjacent_objects.find(clo);
    if(iter == adjacent_objects.end())
      clo->set_highlighted(PlacedLogicModelObject::HLIGHTSTATE_NOT);

  }
  list.clear();
}

Member Data Documentation

Definition at line 42 of file HlObjectSet.h.


The documentation for this class was generated from the following files: