MissionInfo.cc 1.05 KB
/*
 * MissionInfo.cc
 *
 *  Created on: Oct 8, 2014
 *      Author: m.mazel
 */

#include "MissionInfo.hh"

namespace AMDA {
namespace Info {

std::ostream& operator<<(std::ostream& out, const MissionInfo& mi){

	out << "[MissionInfo]" << std::endl;
	out << "{"<<std::endl;
	out << "  _id              = " << mi._id << std::endl;
	out << "  _name            = " << mi._name << std::endl;
	out << "  _description     = " << mi._description << std::endl;
	out << "  _url             = " << mi._url << std::endl;
	out << "}" << std::endl;
	return out;
}

#define PUSHINFO(infoMap, key, value) if(!value.empty())infoMap.push_back(std::pair<std::string,std::string>(key,value))

std::vector<std::pair<std::string,std::string>> MissionInfo::getInfoMap()
{
	std::vector<std::pair<std::string,std::string>> infoMap;

	//push all info
	PUSHINFO(infoMap, MISSION_ID, getId());
	PUSHINFO(infoMap, MISSION_NAME, getName());
	PUSHINFO(infoMap, MISSION_DESC, getDescription());
	PUSHINFO(infoMap, MISSION_URL, getUrl());

	return infoMap;
}

} /* namespace Info */
} /* namespace AMDA */