|
degate 0.1.1
|
Represents a logic model object, that can be electrically connected to other logic model objects. More...
#include <ConnectedLogicModelObject.h>

Public Member Functions | |
| ConnectedLogicModelObject () | |
| Construct an object. | |
| virtual | ~ConnectedLogicModelObject () |
| Destroy object. | |
| virtual void | set_net (Net_shptr net) |
| Set the net for this object. | |
| virtual void | remove_net () |
| Remove the net from this object. | |
| virtual Net_shptr | get_net () |
| Get a shared pointer to the net. | |
| virtual bool | is_connected () const |
| Check if an connectable object is connected to another connectable object. | |
Private Attributes | |
| Net_shptr | net |
Represents a logic model object, that can be electrically connected to other logic model objects.
Definition at line 36 of file ConnectedLogicModelObject.h.
| ConnectedLogicModelObject::ConnectedLogicModelObject | ( | ) |
| ConnectedLogicModelObject::~ConnectedLogicModelObject | ( | ) | [virtual] |
Destroy object.
It will deregister this object from the net.
Definition at line 36 of file ConnectedLogicModelObject.cc.
References remove_net().
{
remove_net();
};

| Net_shptr ConnectedLogicModelObject::get_net | ( | ) | [virtual] |
Get a shared pointer to the net.
Definition at line 56 of file ConnectedLogicModelObject.cc.
References net.
{
return net;
}
| bool ConnectedLogicModelObject::is_connected | ( | ) | const [virtual] |
Check if an connectable object is connected to another connectable object.
Definition at line 60 of file ConnectedLogicModelObject.cc.
References degate::LogicModelObjectBase::get_object_id(), and net.
{
if(net == NULL) return false;
if(net->size() >= 2) return true;
BOOST_FOREACH(object_id_t oid, *net) {
if(oid != get_object_id()) return true;
}
return false;
}

| void ConnectedLogicModelObject::remove_net | ( | ) | [virtual] |
Remove the net from this object.
It will deregister this object from the net's connection list as well.
Definition at line 48 of file ConnectedLogicModelObject.cc.
References degate::LogicModelObjectBase::get_object_id(), and net.
Referenced by ~ConnectedLogicModelObject().
{
if(net != NULL) {
net->remove_object(get_object_id());
net.reset();
}
}


| void ConnectedLogicModelObject::set_net | ( | Net_shptr | net | ) | [virtual] |
Set the net for this object.
This method will add the object to the net.
Definition at line 40 of file ConnectedLogicModelObject.cc.
References degate::LogicModelObjectBase::get_object_id(), and net.
Referenced by degate::LogicModelImporter::parse_nets_element().
{
if(this->net != NULL) {
this->net->remove_object(get_object_id());
}
this->net = net;
this->net->add_object(get_object_id());
}


Definition at line 40 of file ConnectedLogicModelObject.h.
Referenced by get_net(), is_connected(), remove_net(), and set_net().
1.7.4