mirror of
https://github.com/UltraCoderRU/telebotxx.git
synced 2026-01-28 04:05:13 +00:00
Updates and attachments hierarchy replaced with Union-like classes. Changes in JSON parsing for RVO/move-semantics.
28 lines
402 B
C++
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_);
|
|
}
|
|
|
|
}
|