telebotxx/src/Update.cpp
Kirill Kirilenko 9a607eef8c Used boost::optional for optional fields.
Updates and attachments hierarchy replaced with Union-like classes.
Changes in JSON parsing for RVO/move-semantics.
2017-02-19 16:09:13 +03:00

28 lines
402 B
C++

#include <telebotxx/Update.hpp>
#include <boost/variant.hpp>
namespace telebotxx {
Update::Update(int id, Type type, std::unique_ptr<Message> message)
: id_(id),
type_(type),
value_(std::move(message))
{
}
int Update::getId() const
{
return id_;
}
Update::Type Update::getType() const
{
return type_;
}
MessagePtr Update::getMessage() const
{
return boost::get<MessagePtr>(value_);
}
}