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

The RCVBlacklistExporter exports a set of RC Violations, which should be ignored. More...

#include <RCVBlacklistExporter.h>

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

List of all members.

Public Member Functions

 RCVBlacklistExporter (ObjectIDRewriter_shptr _oid_rewriter)
 ~RCVBlacklistExporter ()
void export_data (std::string const &filename, RCBase::container_type const &violations)

Private Member Functions

void add_rcv (xmlpp::Element *templates_elem, RCViolation_shptr rcv)

Private Attributes

ObjectIDRewriter_shptr oid_rewriter

Detailed Description

The RCVBlacklistExporter exports a set of RC Violations, which should be ignored.

Definition at line 39 of file RCVBlacklistExporter.h.


Constructor & Destructor Documentation

Definition at line 48 of file RCVBlacklistExporter.h.

: oid_rewriter(_oid_rewriter) {}

Definition at line 49 of file RCVBlacklistExporter.h.

{}

Member Function Documentation

void RCVBlacklistExporter::add_rcv ( xmlpp::Element *  templates_elem,
RCViolation_shptr  rcv 
) [private]

Definition at line 70 of file RCVBlacklistExporter.cc.

                                                           {

  xmlpp::Element* rcv_elem = root_elem->add_child("rc-violation");
  if(rcv_elem == NULL) throw(std::runtime_error("Failed to create node."));
  
  
  PlacedLogicModelObject_shptr o = rcv->get_object();    
  object_id_t new_oid = oid_rewriter->get_new_object_id(o->get_object_id());
  
  rcv_elem->set_attribute("object-id", number_to_string<object_id_t>(new_oid));
  rcv_elem->set_attribute("rc-violation-class", rcv->get_rc_violation_class());
  rcv_elem->set_attribute("severity", rcv->get_severity_as_string());
  rcv_elem->set_attribute("description", rcv->get_problem_description());

}
void RCVBlacklistExporter::export_data ( std::string const &  filename,
RCBase::container_type const &  violations 
)

Definition at line 44 of file RCVBlacklistExporter.cc.

References degate::get_basedir().

Referenced by degate::ProjectExporter::export_all().

                                                                               {

  std::string directory = get_basedir(filename);

  try {

    xmlpp::Document doc;

    xmlpp::Element * root_elem = doc.create_root_node("rc-blacklist");
    assert(root_elem != NULL);

    BOOST_FOREACH(RCViolation_shptr rcv, violations) {
      add_rcv(root_elem, rcv);
    }

    doc.write_to_file_formatted(filename, "ISO-8859-1");

  }
  catch(const std::exception& ex) {
    std::cout << "Exception caught: " << ex.what() << std::endl;
    throw;
  }

}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 45 of file RCVBlacklistExporter.h.


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