/*******************************************************************************
 * Copyright (c) 2015-2017 ONERA and IRT AESE (IRT Saint Exupéry).
 * Ce logiciel est la propriété de l’ONERA (the French Aerospace Lab) et de
 * l'IRT AESE (IRT Saint Exupéry).
 * Tous droits réservés.
 *
 * Ce programme et les éléments qui l'accompagnent sont mis à disposition
 * aux conditions définies par le contrat de licence logiciel CeCILL-C soumise
 * au droit français et respectant les principes de diffusion des logiciels libres.
 * Vous pouvez utiliser, modifier et/ou redistribuer ce programme
 * sous les conditions de la licence CeCILL-C (http://www.cecill.info).

 * This software is property of ONERA (the French Aerospace Lab) and of
 * the IRT AESE (IRT Saint Exupéry).
 * All rights reserved.
 *
 * This program and the accompanying materials are made available under
 * the terms of the CeCILL-C license under French law and
 * abiding by the rules of distribution of free software.
 * You can  use, modify and/ or redistribute the software under the terms of
 * the CeCILL-C license (http://www.cecill.info).
 *
 * Contributeurs/contributors:
 *     Guillaume Infantes (ONERA - Centre de Toulouse) - initial API and implementation
 *     Alexandre Albore (IRT Saint-Exupéry) - Altarica/Fiacre translation
 *
 *******************************************************************************/


#include "Domain.hh"

namespace epoch {
    namespace altarica {


	std::string Domain::get_name() {
	    if (name_.size() > 0)
		return name_[0];
	    else return std::string("");
	}	    
	
	bool Domain::alias(std::string name) {
	    for (std::vector<std::string>::iterator nit = name_.begin();
		 nit != name_.end(); ++nit) {
		if (name.compare(*nit) == 0)
		    return true;
	    }
	    return false;
	}
	
	void Domain::set_name(std::string n) {
	    name_.push_back(n);
	}
	    
	// Domain* Domain::findDomainInVector(std::vector<Domain*> vd, std::string *name) {
	//     for (std::vector<Domain*>::iterator vdit = vd.begin();
	// 	 vdit != vd.end(); ++vdit)
	// 	if ((*vdit)->alias(name))
	// 	    return *vdit;
	//     return NULL;
	// }

	std::vector<Variable*> * Domain::flatten(Variable* v) const {
	    std::vector<Variable*> * nv = new std::vector<Variable*>();
	    nv->push_back(v);
	    return nv;
	}

    }
	
	
}

