#include "edif_err.h"
//---------------------------------------------------------------------------
UndefReason :: UndefReason (const std::string& kind, const std::string& thing): 
thing_(thing), kind_(kind) {}
UndefReason :: UndefReason (const char* thing, const char* kind): 
thing_(thing), kind_(kind)  {}
UndefReason :: UndefReason (const UndefReason & that): 
thing_(that.thing_), kind_(that.kind_)  {}
std::string UndefReason :: tell (void) const {
    std::string res;
    res = kind_ + " " + thing_ + " undefined";
    return res;
}
//---------------------------------------------------------------------------
RedefReason :: RedefReason (const std::string& kind, const std::string& thing): 
thing_(thing), kind_(kind)  {}
RedefReason :: RedefReason (const char* thing, const char* kind): 
thing_(thing), kind_(kind)  {}
RedefReason :: RedefReason (const RedefReason & that): 
thing_(that.thing_), kind_(that.kind_) {}
std::string RedefReason :: tell (void) const {
    std::string res;
    res = kind_ + " " + thing_ + " redefined";
    return res;
}
//---------------------------------------------------------------------------
OthReason :: OthReason (const std::string& kind, const std::string& thing, const std::string& rsn): 
thing_(thing), kind_(kind), rsn_(rsn)  {}
OthReason :: OthReason (const char* thing, const char* kind, const char* rsn): 
thing_(thing), kind_(kind), rsn_(rsn)  {}
OthReason :: OthReason (const OthReason & that): 
thing_(that.thing_), kind_(that.kind_) {}
std::string OthReason :: tell (void) const {
    std::string res;
    res = kind_ + " " + thing_ + " " + rsn_;
    return res;
}
//---------------------------------------------------------------------------
CircCtx :: CircCtx (const hub::Named* lib, const hub::Named* ent, const hub::Named* arch):
lib_(lib), ent_(ent), arch_(arch) {};
CircCtx :: CircCtx (int):
lib_(NULL), ent_(NULL), arch_(NULL) {};
CircCtx :: CircCtx (const CircCtx & that):
lib_(that.lib_), ent_(that.ent_), arch_(that.arch_) {};
std::string CircCtx :: tell (void) const {
    std::string res;
    if (lib_) res += lib_->name();
    if (ent_) res += "." + ent_->name();
    if (arch_) res += "." + arch_->name();
    return res;
}
