degate  0.1.2
Public Member Functions | Private Attributes
degate::LogicModelObjectBase Class Reference

The class LogicModelObjectBase is the base class for basically every class that represents a logic model object. More...

#include <LogicModelObjectBase.h>

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

List of all members.

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.
void cloneDeepInto (DeepCopyable_shptr destination, oldnew_t *oldnew) const
 Deep-copy all members to destination.
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

Detailed Description

The class LogicModelObjectBase is the base class for basically every class that represents a logic model object.

Definition at line 36 of file LogicModelObjectBase.h.


Constructor & Destructor Documentation

Create a new object.

Definition at line 31 of file LogicModelObjectBase.cc.

                                                          :
  object_id(oid) {
}
LogicModelObjectBase::LogicModelObjectBase ( std::string const &  object_name,
std::string const &  object_description 
)

The constructor.

Definition at line 35 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 42 of file LogicModelObjectBase.cc.

                                                                                :
  object_id(oid),
  name(object_name),
  description(object_description) {
}

The dtor.

Definition at line 50 of file LogicModelObjectBase.cc.

                                            {
}

Member Function Documentation

void LogicModelObjectBase::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.

Implements degate::DeepCopyableBase.

Reimplemented in degate::GateTemplate, degate::Annotation, degate::Net, degate::Module, degate::Gate, degate::GateTemplatePort, degate::GatePort, degate::Via, degate::PlacedLogicModelObject, degate::EMarker, degate::ConnectedLogicModelObject, and degate::Wire.

Definition at line 53 of file LogicModelObjectBase.cc.

References description, name, and object_id.

                                                                                        {
  auto clone = std::dynamic_pointer_cast<LogicModelObjectBase>(dest);
  clone->object_id = object_id;
  clone->name = name;
  clone->description = description;
}
std::string const & LogicModelObjectBase::get_description ( ) const [virtual]

Get the description for a logic model object.

Definition at line 72 of file LogicModelObjectBase.cc.

References description.

Referenced by degate::Annotation::print(), degate::Gate::print(), and degate::GateTemplate::print().

                                                              {
  return description;
}

Here is the caller graph for this function:

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::Gate, degate::GatePort, degate::Annotation, degate::Net, degate::Via, degate::EMarker, and degate::Wire.

Definition at line 98 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();
}

Here is the call graph for this function:

std::string const & LogicModelObjectBase::get_name ( ) const [virtual]
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::Gate, degate::GatePort, degate::Annotation, degate::Via, degate::EMarker, and degate::Wire.

Definition at line 107 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 80 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 76 of file LogicModelObjectBase.cc.

References name.

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

                                          {
  return !name.empty();
}

Here is the caller graph for this function:

Check if the logic model object has a valid object ID.

Definition at line 93 of file LogicModelObjectBase.cc.

References object_id.

Referenced by degate::PlacedLogicModelObject::notify_shape_change().

                                                     {
  return object_id != 0;
}

Here is the caller graph for this function:

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 64 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 60 of file LogicModelObjectBase.cc.

References name.

Referenced by degate::Module::Module().

                                                         {
  this->name = name;
}

Here is the caller graph for this function:

Set the object ID for a logic model object.

Definition at line 85 of file LogicModelObjectBase.cc.

References object_id.

                                                        {
  object_id = oid;
}

Member Data Documentation

std::string degate::LogicModelObjectBase::name [private]

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