DataSetInfo.hh 4.29 KB
/*
 * DataSetInfo.hh
 *
 *  Created on: Oct 6, 2014
 *      Author: m.mazel
 */

#ifndef DATASETINFO_HH_
#define DATASETINFO_HH_

#include <iostream>
#include <sstream>
#include <map>
#include <algorithm>
#include <boost/shared_ptr.hpp>
#include <utility>
#include <vector>

namespace AMDA {
namespace Info {

//Info keys for dataset
#define DATASET_ID              "DATASET_ID"
#define DATASET_NAME            "DATASET_NAME"
#define DATASET_DESC            "DATASET_DESCRIPTION"
#define DATASET_SOURCE          "DATASET_SOURCE"
#define DATASET_START           "DATASET_GLOBAL_START"
#define DATASET_STOP            "DATASET_GLOBAL_STOP"
#define DATASET_MIN_SAMP        "DATASET_MIN_SAMPLING"
#define DATASET_MAX_SAMP        "DATASET_MAX_SAMPLING"
#define DATASET_CAVEATS         "DATASET_CAVEATS"
#define DATASET_ACKNOWLEDGEMENT "DATASET_ACKNOWLEDGEMENT"

/**
 * @class DataSetInfo
 * @brief Information about a dataset.
 * @details
 */
class DataSetInfo {
public:
	DataSetInfo () :
		_id(""),
		_name(""),
		_description(""),
		_source(""),
		_globalStart(""),
		_globalStop(""),
		_minSampling(-1),
		_maxSampling(-1),
		_caveats(""),
		_acknowledgement(""),
		_instrumentId("")
	{}

	friend std::ostream& operator<<(std::ostream& out_, const DataSetInfo& dsi);

	/*
	 * @brief Get dataset id
	 */
	const std::string& getId() const {
		return _id;
	}

	/*
	 * @brief Set dataset id
	 */
	void setId(const std::string& id) {
		_id = id;
	}

	/*
	 * @brief Get dataset name
	 */
	const std::string& getName() const {
		return _name;
	}

	/*
	 * @brief Set dataset name
	 */
	void setName(const std::string& name) {
		_name = name;
	}

	/*
	 * @brief Get dataset description
	 */
	const std::string& getDescription() const {
		return _description;
	}

	/*
	 * @brief Set dataset description
	 */
	void setDescription(const std::string& description) {
		_description = description;
	}

	/*
	 * @brief Get dataset source
	 */
	const std::string& getSource() const {
		return _source;
	}

	/*
	 * @brief Set dataset source
	 */
	void setSource(const std::string& source) {
		_source = source;
	}

	/*
	 * @brief Get dataset global start
	 */
	const std::string& getGlobalStart() const {
		return _globalStart;
	}

	/*
	 * @brief Set dataset global start
	 */
	void setGlobalStart(const std::string& globalStart) {
		_globalStart = globalStart;
	}

	/*
	 * @brief Get dataset global stop
	 */
	const std::string& getGlobalStop() const {
		return _globalStop;
	}

	/*
	 * @brief Set dataset global stop
	 */
	void setGlobalStop(const std::string& globalStop) {
		_globalStop = globalStop;
	}

	/*
	 * @brief Get datset max sampling
	 */
	int getMaxSampling() const {
		return _maxSampling;
	}

	/*
	 * @brief Set dataset max sampling
	 */
	void setMaxSampling(int maxSampling) {
		_maxSampling = maxSampling;
	}

	/*
	 * @brief Get dataset min sampling
	 */
	int getMinSampling() const {
		return _minSampling;
	}

	/*
	 * @brief Set dataset min sampling
	 */
	void setMinSampling(int minSampling) {
		_minSampling = minSampling;
	}

	/*
	 * @brief Get datsqet caveats
	 */
	const std::string& getCaveats() const {
		return _caveats;
	}

	/*
	 * @brief Set dataset caveats
	 */
	void setCaveats(const std::string& caveats) {
		_caveats = caveats;
	}

	/*
	 * @brief Get dataset acknowledgement
	 */
	const std::string& getAcknowledgement() const {
		return _acknowledgement;
	}

	/*
	 * @brief Set dataset acknwoledgement
	 */
	void setAcknowledgement(const std::string& acknowledgement) {
		_acknowledgement = acknowledgement;
	}

	/*
	 * @brief Get dataset associated instrument id
	 */
	const std::string& getInstrumentId() const {
		return _instrumentId;
	}

	/*
	 * @brief Set dataset associated instrument id
	 */
	void setInstrumentId(const std::string& instrumentId) {
		_instrumentId = instrumentId;
	}

	/*
	 * @brief Get a map of dataset info
	 */
	std::vector<std::pair<std::string,std::string>> getInfoMap();

protected:
	std::string	_id;

	std::string _name;
	std::string _description;
	std::string _source;
	std::string _globalStart;
	std::string _globalStop;
	int	_minSampling;
	int _maxSampling;
	std::string _caveats;
	std::string _acknowledgement;

	std::string _instrumentId;
};

typedef boost::shared_ptr<DataSetInfo> DataSetInfoSPtr;
typedef std::map<std::string,DataSetInfoSPtr> DataSetInfoMap;

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


#endif /* DATASETINFO_HH_ */