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

Represents a placeable object. More...

#include <PlacedLogicModelObject.h>

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

List of all members.

Public Types

enum  HIGHLIGHTING_STATE {
  HLIGHTSTATE_NOT = 0,
  HLIGHTSTATE_DIRECT = 1,
  HLIGHTSTATE_ADJACENT = 2
}

Public Member Functions

 PlacedLogicModelObject ()
 The constructor.
virtual ~PlacedLogicModelObject ()
 The destructor.
void cloneDeepInto (DeepCopyable_shptr destination, oldnew_t *oldnew) const
 Deep-copy all members to destination.
virtual HIGHLIGHTING_STATE get_highlighted () const
 A placed object is highlightable.
virtual bool is_highlighted () const
 Check if an object is highlighted at all.
virtual void set_highlighted (HIGHLIGHTING_STATE state)
 Set the selection state.
virtual void set_layer (std::shared_ptr< Layer > layer)
 Set the layer on which the object is placed.
virtual std::shared_ptr< Layerget_layer ()
 Get the layer on which the object is placed.
virtual void print (std::ostream &os=std::cout, int n_tabs=0) const =0
 Print the object.

Protected Member Functions

void notify_shape_change ()
 Ajust the position in the quadtree.

Private Attributes

HIGHLIGHTING_STATE highlight_state
std::shared_ptr< Layerlayer

Detailed Description

Represents a placeable object.

Any class that represents a somewhere placeable objects should inherit from that base class. The term "placed objects" is related to real existent physical structures on the chip surface (e.g. wire, vias, ...) as well as logical objects (e.g. annotations).

Definition at line 42 of file PlacedLogicModelObject.h.


Member Enumeration Documentation

Enumerator:
HLIGHTSTATE_NOT 
HLIGHTSTATE_DIRECT 
HLIGHTSTATE_ADJACENT 

Definition at line 49 of file PlacedLogicModelObject.h.


Constructor & Destructor Documentation

The constructor.

Definition at line 32 of file PlacedLogicModelObject.cc.

The destructor.

Definition at line 35 of file PlacedLogicModelObject.cc.

                                                {
}

Member Function Documentation

void PlacedLogicModelObject::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::ColoredObject.

Reimplemented in degate::Annotation, degate::Gate, degate::GatePort, degate::Via, degate::EMarker, degate::ConnectedLogicModelObject, and degate::Wire.

Definition at line 38 of file PlacedLogicModelObject.cc.

References highlight_state, and layer.

                                                                                                 {
  ColoredObject::cloneDeepInto(destination, oldnew);
  LogicModelObjectBase::cloneDeepInto(destination, oldnew);
  
  auto clone = std::dynamic_pointer_cast<PlacedLogicModelObject>(destination);
  assert(clone.get () != 0);
  clone->highlight_state = highlight_state;
  clone->layer = std::dynamic_pointer_cast<Layer>(layer->cloneDeep(oldnew));
}

A placed object is highlightable.

You can ask for its state with this method.

Definition at line 48 of file PlacedLogicModelObject.cc.

References highlight_state.

                                                                                       {
  return highlight_state;
}
std::shared_ptr< Layer > PlacedLogicModelObject::get_layer ( ) [virtual]

Get the layer on which the object is placed.

Definition at line 65 of file PlacedLogicModelObject.cc.

References layer.

Referenced by degate::Wire::push_object_to_server(), degate::EMarker::push_object_to_server(), and degate::Via::push_object_to_server().

                                                       {
  return layer;
}

Here is the caller graph for this function:

bool PlacedLogicModelObject::is_highlighted ( ) const [virtual]

Check if an object is highlighted at all.

Definition at line 52 of file PlacedLogicModelObject.cc.

References highlight_state, and HLIGHTSTATE_NOT.

virtual void degate::PlacedLogicModelObject::print ( std::ostream &  os = std::cout,
int  n_tabs = 0 
) const [pure virtual]

Set the selection state.

Definition at line 56 of file PlacedLogicModelObject.cc.

References highlight_state.

                                                                                           {
  highlight_state = state;
}
void PlacedLogicModelObject::set_layer ( std::shared_ptr< Layer layer) [virtual]

Set the layer on which the object is placed.

Definition at line 61 of file PlacedLogicModelObject.cc.

References layer.

                                                                 {
  this->layer = layer;
}

Member Data Documentation

std::shared_ptr<Layer> degate::PlacedLogicModelObject::layer [private]

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