|
degate 0.1.1
|
The class LogicModelObjectBase is the base class for basically every class that represents a logic model object. More...
#include <LogicModelObjectBase.h>

Public Member Functions | |
| LogicModelObjectBase (object_id_t oid=0) | |
| Create a new object. | |
| LogicModelObjectBase (std::string const &object_name, std::string const &object_description) | |
| The constructor. | |
| LogicModelObjectBase (object_id_t oid, std::string const &object_name, std::string const &object_description) | |
| The constructor. | |
| virtual | ~LogicModelObjectBase () |
| The dtor. | |
| virtual void | set_name (std::string const &name) |
| Set the name for a logic model object. | |
| virtual void | set_description (std::string const &description) |
| Set the description for a logic model object. | |
| virtual std::string const & | get_name () const |
| Get the name for a logic model object. | |
| virtual std::string const & | get_description () const |
| Get the description for a logic model object. | |
| virtual bool | has_name () const |
| Check if a logic model object has a name. | |
| virtual bool | has_description () const |
| Check if a logic model object has a description. | |
| virtual void | set_object_id (object_id_t oid) |
| Set the object ID for a logic model object. | |
| virtual object_id_t | get_object_id () const |
| Get the object ID for a logic model object. | |
| virtual bool | has_valid_object_id () const |
| Check if the logic model object has a valid object ID. | |
| 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, e.g. | |
Private Attributes | |
| object_id_t | object_id |
| std::string | name |
| std::string | description |
The class LogicModelObjectBase is the base class for basically every class that represents a logic model object.
Definition at line 34 of file LogicModelObjectBase.h.
| LogicModelObjectBase::LogicModelObjectBase | ( | object_id_t | oid = 0 | ) |
| LogicModelObjectBase::LogicModelObjectBase | ( | std::string const & | object_name, |
| std::string const & | object_description | ||
| ) |
The constructor.
Definition at line 34 of file LogicModelObjectBase.cc.
: object_id(0), name(object_name), description(object_description) { }
| LogicModelObjectBase::LogicModelObjectBase | ( | object_id_t | oid, |
| std::string const & | object_name, | ||
| std::string const & | object_description | ||
| ) |
The constructor.
Definition at line 41 of file LogicModelObjectBase.cc.
: object_id(oid), name(object_name), description(object_description) { }
| LogicModelObjectBase::~LogicModelObjectBase | ( | ) | [virtual] |
| std::string const & LogicModelObjectBase::get_description | ( | ) | const [virtual] |
Get the description for a logic model object.
Definition at line 64 of file LogicModelObjectBase.cc.
References description.
Referenced by degate::GateTemplate::print(), degate::Gate::print(), and degate::Annotation::print().
{
return description;
}

| const std::string LogicModelObjectBase::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 in degate::Annotation, degate::EMarker, degate::Gate, degate::GatePort, degate::Net, degate::Via, and degate::Wire.
Definition at line 90 of file LogicModelObjectBase.cc.
References get_object_id().
{
// should be dispatched. In debug mode we break here.
assert(1 == 0);
boost::format fmter("Generic object %1%");
fmter % get_object_id();;
return fmter.str();
}

| std::string const & LogicModelObjectBase::get_name | ( | ) | const [virtual] |
Get the name for a logic model object.
Definition at line 60 of file LogicModelObjectBase.cc.
References name.
Referenced by degate::Wire::get_descriptive_identifier(), degate::Via::get_descriptive_identifier(), degate::Gate::get_descriptive_identifier(), degate::EMarker::get_descriptive_identifier(), degate::Annotation::get_descriptive_identifier(), degate::Module::lookup_module(), degate::Module::move_gates_recursive(), degate::Via::print(), degate::GateTemplate::print(), degate::GatePort::print(), degate::Gate::print(), degate::EMarker::print(), and degate::Annotation::print().
{
return name;
}

| object_id_t LogicModelObjectBase::get_object_id | ( | ) | const [virtual] |
Get the object ID for a logic model object.
Definition at line 81 of file LogicModelObjectBase.cc.
References object_id.
Referenced by degate::Wire::get_descriptive_identifier(), degate::Via::get_descriptive_identifier(), degate::Net::get_descriptive_identifier(), get_descriptive_identifier(), degate::GatePort::get_descriptive_identifier(), degate::Gate::get_descriptive_identifier(), degate::EMarker::get_descriptive_identifier(), degate::Annotation::get_descriptive_identifier(), degate::ConnectedLogicModelObject::is_connected(), degate::PlacedLogicModelObject::notify_shape_change(), degate::Via::print(), degate::GateTemplate::print(), degate::GatePort::print(), degate::Gate::print(), degate::EMarker::print(), degate::Annotation::print(), degate::ConnectedLogicModelObject::remove_net(), and degate::ConnectedLogicModelObject::set_net().
{
return object_id;
}

| const std::string LogicModelObjectBase::get_object_type_name | ( | ) | const [virtual] |
Get a human readable string that names the object type, e.g.
"Wire" or "Gate port".
Reimplemented in degate::Annotation, degate::EMarker, degate::Gate, degate::GatePort, degate::Via, and degate::Wire.
Definition at line 99 of file LogicModelObjectBase.cc.
{
return std::string("Generic object");
}
| bool LogicModelObjectBase::has_description | ( | ) | const [virtual] |
Check if a logic model object has a description.
Definition at line 72 of file LogicModelObjectBase.cc.
References description.
{
return !description.empty();
}
| bool LogicModelObjectBase::has_name | ( | ) | const [virtual] |
Check if a logic model object has a name.
Definition at line 68 of file LogicModelObjectBase.cc.
References name.
Referenced by degate::Wire::get_descriptive_identifier(), degate::Via::get_descriptive_identifier(), degate::Gate::get_descriptive_identifier(), and degate::EMarker::get_descriptive_identifier().
{
return !name.empty();
}

| bool LogicModelObjectBase::has_valid_object_id | ( | ) | const [virtual] |
Check if the logic model object has a valid object ID.
Definition at line 85 of file LogicModelObjectBase.cc.
References object_id.
Referenced by degate::PlacedLogicModelObject::notify_shape_change().
{
return object_id != 0;
}

| void LogicModelObjectBase::set_description | ( | std::string const & | description | ) | [virtual] |
Set the description for a logic model object.
It is up to the user how the object is described.
Definition at line 56 of file LogicModelObjectBase.cc.
References description.
{
this->description = description;
}
| void LogicModelObjectBase::set_name | ( | std::string const & | name | ) | [virtual] |
Set the name for a logic model object.
It is up to the user how the object is named. But it should be identifying.
Definition at line 52 of file LogicModelObjectBase.cc.
References name.
Referenced by degate::Module::Module().

| void LogicModelObjectBase::set_object_id | ( | object_id_t | oid | ) | [virtual] |
Set the object ID for a logic model object.
Definition at line 77 of file LogicModelObjectBase.cc.
References object_id.
{
object_id = oid;
}
std::string degate::LogicModelObjectBase::description [private] |
Definition at line 41 of file LogicModelObjectBase.h.
Referenced by get_description(), has_description(), and set_description().
std::string degate::LogicModelObjectBase::name [private] |
Definition at line 40 of file LogicModelObjectBase.h.
Referenced by get_name(), has_name(), degate::Module::set_entity_name(), and set_name().
Definition at line 38 of file LogicModelObjectBase.h.
Referenced by get_object_id(), degate::GateTemplate::get_template_port(), degate::GateTemplate::has_template_port(), has_valid_object_id(), degate::GateTemplate::remove_template_port(), and set_object_id().
1.7.4