degate 0.1.1
Public Member Functions | Private Attributes
degate::ConnectedLogicModelObject Class Reference

Represents a logic model object, that can be electrically connected to other logic model objects. More...

#include <ConnectedLogicModelObject.h>

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

List of all members.

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

Detailed Description

Represents a logic model object, that can be electrically connected to other logic model objects.

Definition at line 36 of file ConnectedLogicModelObject.h.


Constructor & Destructor Documentation

ConnectedLogicModelObject::ConnectedLogicModelObject ( )

Construct an object.

Definition at line 33 of file ConnectedLogicModelObject.cc.

                                                     {
}
ConnectedLogicModelObject::~ConnectedLogicModelObject ( ) [virtual]

Destroy object.

It will deregister this object from the net.

See also:
remove_net()

Definition at line 36 of file ConnectedLogicModelObject.cc.

References remove_net().

                                                       {
  remove_net();
};

Here is the call graph for this function:


Member Function Documentation

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.

Returns:
Returns true, if this object is connected to another object. Else false is returned.

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;
}

Here is the call graph for this function:

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();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

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());
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 40 of file ConnectedLogicModelObject.h.

Referenced by get_net(), is_connected(), remove_net(), and set_net().


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