温馨提示:此内容可能已过期/不符合项目要求/编译无法通过。
作者:zhc
#ifndef MEETING_H
#define MEETING_H
#include <vector>
#include "Date.cpp" //改了
class Meeting {
public:
/**
* @brief default constructor
*/
Meeting() = default;
/**
* @brief constructor with argument
*/
Meeting(const std::string &t_sponsor,
const std::vector<std::string> &t_participator,
const Date &t_startTime, const Date &t_endTime,
const std::string &t_title)
{
std::string m_sponsor = t_sponsor;
std::vector<std::string> m_participators = t_participator;
Date m_startDate = t_startTime;
Date m_endDate = t_endTime;
std::string m_title = t_title;
}
/**
* @brief copy constructor of left value
*/
Meeting(const Meeting &t_meeting){
std::string m_sponsor = t_meeting.getSponsor();
std::vector<std::string> m_participators = t_meeting.getParticipator();
Date m_startDate = t_meeting.getStartDate();
Date m_endDate = t_meeting.getEndDate();
std::string m_title = t_meeting.getTitle();
}
/**
* @brief get the meeting's sponsor
* @return a string indicate sponsor
*/
std::string getSponsor(void) const{
return m_sponsor;
}
/**
* @brief set the sponsor of a meeting
* @param the new sponsor string
*/
void setSponsor(const std::string &t_sponsor){
m_sponsor = t_sponsor;
}
/**
* @brief get the participators of a meeting
* @return return a string vector indicate participators
*/
std::vector<std::string> getParticipator(void) const{
return m_participators ;
}
/**
* @brief set the new participators of a meeting
* @param the new participators vector
*/
void setParticipator(const std::vector<std::string> &t_participators){
m_participators = t_participators ;
}
/**
* @brief add a new participator to the meeting
* @param the new participator
*/
void addParticipator(const std::string &t_participator){
m_participators.push_back(t_participator);
}
/**
* @brief remove a participator of the meeting
* @param the participator to be removed
*/
void removeParticipator(const std::string &t_participator){
std::vector<std::string> ::iterator itor ;
for(itor = m_participators.begin(); itor!=m_participators.end() ;itor++){
if(*itor == t_participator) itor = m_participators.erase(itor) ;
}
}
/**
* @brief get the startDate of a meeting
* @return return a string indicate startDate
*/
Date getStartDate(void) const{
return m_startDate ;
}
/**
* @brief set the startDate of a meeting
* @param the new startdate of a meeting
*/
void setStartDate(const Date &t_startTime){
m_startDate = t_startTime ;
}
/**
* @brief get the endDate of a meeting
* @return a date indicate the endDate
*/
Date getEndDate(void) const{
return m_endDate ;
}
/**
* @brief set the endDate of a meeting
* @param the new enddate of a meeting
*/
void setEndDate(const Date &t_endTime){
m_endDate = t_endTime ;
}
/**
* @brief get the title of a meeting
* @return a date title the endDate
*/
std::string getTitle(void) const{
return m_title ;
}
/**
* @brief set the title of a meeting
* @param the new title of a meeting
*/
void setTitle(const std::string &t_title){
m_title = t_title ;
}
/**
* @brief check if the user take part in this meeting
* @param t_username the source username
* @return if the user take part in this meeting
*/
bool isParticipator(const std::string &t_username) const{
for(const auto& item : m_participators ){
if(item == t_username) return true ;
}
return false ;
}
private:
std::string m_sponsor;
std::vector<std::string> m_participators;
Date m_startDate;
Date m_endDate;
std::string m_title;
};
#endif