degate  0.1.2
Public Member Functions | Protected Member Functions
degate::EMarker Class Reference

Representation of an electrically connectable marker object. More...

#include <EMarker.h>

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

List of all members.

Public Member Functions

 EMarker ()
 EMarker (int _x, int _y, diameter_t _diameter=5)
 Constructor for a via object.
virtual ~EMarker ()
 Destructor for a via object.
virtual const std::string get_descriptive_identifier () const
 Get a human readable string that describes the whole logic model object.
virtual const std::string get_object_type_name () const
 Get a human readable string that names the object type.
void print (std::ostream &os, int n_tabs) const
 Print the object.
void shift_x (int delta_x)
 Shift the shape vertically.
void shift_y (int delta_y)
 Shift the shape horizontally.
void set_x (int x)
void set_y (int y)
void set_diameter (unsigned int diameter)
virtual bool in_bounding_box (BoundingBox const &bbox) const
 Check if this shape is in the bounding box.
virtual BoundingBox const & get_bounding_box () const
 Get the bounding box.
virtual bool in_shape (int x, int y, int max_distance=0) const
 Check in the Point with coordinates x and y is within the area of the shape.
DeepCopyable_shptr cloneShallow () const
 Return a copy of this object, but with all references to other DeepCopyables cleared (e.g.
void cloneDeepInto (DeepCopyable_shptr destination, oldnew_t *oldnew) const
 Deep-copy all members to destination.

Protected Member Functions

virtual object_id_t push_object_to_server (std::string const &server_url)

Detailed Description

Representation of an electrically connectable marker object.

Definition at line 43 of file EMarker.h.


Constructor & Destructor Documentation

degate::EMarker::EMarker ( ) [inline, explicit]

Definition at line 48 of file EMarker.h.

{};
EMarker::EMarker ( int  _x,
int  _y,
diameter_t  _diameter = 5 
)

Constructor for a via object.

Definition at line 29 of file EMarker.cc.

                                                     :
  Circle(_x, _y, _diameter) {
}
EMarker::~EMarker ( ) [virtual]

Destructor for a via object.

Definition at line 33 of file EMarker.cc.

{}

Member Function Documentation

void EMarker::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::Circle.

Definition at line 40 of file EMarker.cc.

                                                                           {
  auto clone = std::dynamic_pointer_cast<EMarker>(dest);
  Circle::cloneDeepInto(clone, oldnew);
  ConnectedLogicModelObject::cloneDeepInto(clone, oldnew);
  RemoteObject::cloneDeepInto(clone, oldnew);
}

Return a copy of this object, but with all references to other DeepCopyables cleared (e.g.

set to 0-pointer).

Implements degate::DeepCopyable.

Definition at line 35 of file EMarker.cc.

                                               {
  auto clone = std::make_shared<EMarker>();
  return clone;
}
virtual BoundingBox const& degate::EMarker::get_bounding_box ( ) const [inline, virtual]

Get the bounding box.

Reimplemented from degate::Circle.

Definition at line 100 of file EMarker.h.

Referenced by print().

                                                        {
      return Circle::get_bounding_box();
    }

Here is the caller graph for this function:

const std::string EMarker::get_descriptive_identifier ( ) const [virtual]

Get a human readable string that describes the whole logic model object.

The string should be unique in order to let the user identify the concrete object. But that is not a must.

Reimplemented from degate::LogicModelObjectBase.

Definition at line 47 of file EMarker.cc.

References degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), and degate::LogicModelObjectBase::has_name().

                                                          {
  if(has_name()) {
    boost::format fmter("emarker %1% (%2%)");
    fmter % get_name() % get_object_id();
    return fmter.str();
  }
  else {
    boost::format fmter("emarker (%1%)");
    fmter % get_object_id();
    return fmter.str();
  }
}

Here is the call graph for this function:

const std::string EMarker::get_object_type_name ( ) const [virtual]

Get a human readable string that names the object type.

Here it is "EMarker".

Reimplemented from degate::LogicModelObjectBase.

Definition at line 60 of file EMarker.cc.

                                                    {
  return std::string("EMarker");
}
virtual bool degate::EMarker::in_bounding_box ( BoundingBox const &  bbox) const [inline, virtual]

Check if this shape is in the bounding box.

Note: it is somhow unclear if this 'in' means complete within or if an intersection is sufficient.

Reimplemented from degate::Circle.

Definition at line 96 of file EMarker.h.

                                                                {
      return Circle::in_bounding_box(bbox);
    }
virtual bool degate::EMarker::in_shape ( int  x,
int  y,
int  max_distance = 0 
) const [inline, virtual]

Check in the Point with coordinates x and y is within the area of the shape.

Reimplemented from degate::Circle.

Definition at line 104 of file EMarker.h.

                                                                    {
      return Circle::in_shape(x, y, max_distance);
    }
void EMarker::print ( std::ostream &  os,
int  n_tabs 
) const [virtual]

Print the object.

Implements degate::PlacedLogicModelObject.

Definition at line 65 of file EMarker.cc.

References degate::gen_tabs(), get_bounding_box(), degate::LogicModelObjectBase::get_name(), degate::LogicModelObjectBase::get_object_id(), degate::Circle::get_x(), degate::Circle::get_y(), and degate::BoundingBox::to_string().

                                                     {

  os
    << gen_tabs(n_tabs) << "EMarker name      : " << get_name() << std::endl
    << gen_tabs(n_tabs) << "Object ID         : " << get_object_id() << std::endl
    << gen_tabs(n_tabs) << "EMarker position  : " << get_x() << " / " << get_y() << std::endl
    << gen_tabs(n_tabs) << "Bounding box      : " << Circle::get_bounding_box().to_string() << std::endl
    << std::endl;
    ;

}

Here is the call graph for this function:

object_id_t EMarker::push_object_to_server ( std::string const &  server_url) [protected, virtual]

Implements degate::RemoteObject.

Definition at line 103 of file EMarker.cc.

References degate::Circle::get_diameter(), degate::PlacedLogicModelObject::get_layer(), degate::Circle::get_x(), degate::Circle::get_y(), degate::PlacedLogicModelObject::layer, degate::remote_method_call(), and degate::RemoteObject::set_remote_object_id().

                                                                      {

  try {

    xmlrpc_c::paramList params;
    params.add(xmlrpc_c::value_string("add"));
    params.add(xmlrpc_c::value_string("emarker"));

    Layer_shptr layer = get_layer();
    assert(layer != NULL);
    params.add(xmlrpc_c::value_int(layer->get_layer_id()));

    params.add(xmlrpc_c::value_int(get_x()));
    params.add(xmlrpc_c::value_int(get_y()));
    params.add(xmlrpc_c::value_int(get_diameter()));

    int const transaction_id =
      xmlrpc_c::value_int(remote_method_call(server_url, "degate.push", params));

    set_remote_object_id(transaction_id);

    std::cout << "Pushed via to server. remote id is: " << transaction_id << std::endl;
    return transaction_id;
  }
  catch(std::exception const& e) {
    std::cerr << "Client threw error: " << e.what() << std::endl;
    throw XMLRPCException(e.what());
  }
  catch(...) {
    std::cerr << "Client threw unexpected error." << std::endl;
    throw XMLRPCException("Client threw unexpected error.");
  }

}

Here is the call graph for this function:

void EMarker::set_diameter ( unsigned int  diameter) [virtual]

Reimplemented from degate::Circle.

Definition at line 97 of file EMarker.cc.

References degate::PlacedLogicModelObject::notify_shape_change().

Here is the call graph for this function:

void EMarker::set_x ( int  x) [virtual]

Reimplemented from degate::Circle.

Definition at line 87 of file EMarker.cc.

References degate::PlacedLogicModelObject::notify_shape_change().

Here is the call graph for this function:

void EMarker::set_y ( int  y) [virtual]

Reimplemented from degate::Circle.

Definition at line 92 of file EMarker.cc.

References degate::PlacedLogicModelObject::notify_shape_change().

Here is the call graph for this function:

void EMarker::shift_x ( int  delta_x) [virtual]

Shift the shape vertically.

Note: If you store this shape in a QuadTree, you have to manage the changes in your QuadTree by yourself.

Reimplemented from degate::Circle.

Definition at line 77 of file EMarker.cc.

References degate::PlacedLogicModelObject::notify_shape_change().

Here is the call graph for this function:

void EMarker::shift_y ( int  delta_y) [virtual]

Shift the shape horizontally.

Note: If you store this shape in a QuadTree, you have to manage the changes in your QuadTree by yourself.

Reimplemented from degate::Circle.

Definition at line 82 of file EMarker.cc.

References degate::PlacedLogicModelObject::notify_shape_change().

Here is the call graph for this function:


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