degate  0.1.2
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.
void cloneDeepInto (DeepCopyable_shptr destination, oldnew_t *oldnew) const
 Deep-copy all members to destination.
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 37 of file ConnectedLogicModelObject.h.


Constructor & Destructor Documentation

Construct an object.

Definition at line 34 of file ConnectedLogicModelObject.cc.

                                                     {
}

Destroy object.

It will deregister this object from the net.

See also:
remove_net()

Definition at line 37 of file ConnectedLogicModelObject.cc.

References remove_net().

                                                       {
  remove_net();
};

Here is the call graph for this function:


Member Function Documentation

void ConnectedLogicModelObject::cloneDeepInto ( DeepCopyable_shptr  destination,
oldnew_t oldnew 
) const [virtual]

Deep-copy all members to destination.

Todo:
Find out whether the default assignment operator can be used to simplify implementations of this method.

Reimplemented from degate::PlacedLogicModelObject.

Reimplemented in degate::GatePort, degate::Via, degate::EMarker, and degate::Wire.

Definition at line 41 of file ConnectedLogicModelObject.cc.

References net.

                                                                                             {
  PlacedLogicModelObject::cloneDeepInto(dest, oldnew);
  
  auto clone = std::dynamic_pointer_cast<ConnectedLogicModelObject>(dest);
  if (net.get() != nullptr) {
    clone->net = std::dynamic_pointer_cast<Net>(net->cloneDeep(oldnew));
  }
}

Get a shared pointer to the net.

Definition at line 66 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 70 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:

Remove the net from this object.

It will deregister this object from the net's connection list as well.

Definition at line 58 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:

Set the net for this object.

This method will add the object to the net.

Definition at line 50 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 41 of file ConnectedLogicModelObject.h.

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


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