#ifndef LOCATION_H
#define LOCATION_H
#include "hub.h"
#include "err.h"
#include <string>

namespace hub {
    // ----------------------------------------------------------------------------
    class LocationNames {
	std::string 	archName_;
	std::string	entityName_;
	std::string	libName_;
    public:
	const std::string& archName   (void) const { return archName_; }
	const std::string& entityName (void) const { return entityName_; }
	const std::string& libName    (void) const { return libName_; }

	void libName    (const std::string& s)  { libName_ = s; }
	void archName   (const std::string& s)  { archName_ = s; }
	void entityName (const std::string& s)  { entityName_ = s; }
	void libName    (const char* s)  { libName_ = s; }
	void archName   (const char* s)  { archName_ = s; }
	void entityName (const char* s)  { entityName_ = s; }
    };

    // ----------------------------------------------------------------------------
    class Location {
    protected:			// Location is seen as a kind of interface

	Architecture*	theArch_;	bool fixedArch_;
	Entity*		theEntity_;	bool fixedEntity_;
	Library*	theLib_;	bool fixedLib_;
	Hub*		theHub_;

    public:
	Location (Architecture *);
	Location (Entity*);
	Location (Library*);
	Location (Hub*);

	InconsReason FindOrCreate (const std::string&, const std::string& ="", const std::string& ="");
	InconsReason FindOrCreate (const LocationNames&);
	InconsReason Find (const std::string&, const std::string& ="", const std::string& ="");
	InconsReason Find (const LocationNames&);

	void Set (Library*);
	void Set (Entity*);
	void Set (Architecture*);
	void FindOrCreateDesign (const std::string&);
    };
}

#endif
