telebotxx/include/telebotxx/Update.hpp
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

41 lines
583 B
C++

#ifndef TELEBOTXX_UPDATE_HPP
#define TELEBOTXX_UPDATE_HPP
#include "Message.hpp"
#include <vector>
#include <memory>
namespace telebotxx {
class Update
{
public:
enum class Type
{
Message,
EditedMessage,
ChannelPost,
EditedChannelPost,
InlineQuery,
ChosenInlineResult,
CallbackQuery
};
Update(int id, Type type, std::unique_ptr<Message>);
int getId() const;
Type getType() const;
MessagePtr getMessage() const;
private:
int id_;
Type type_;
boost::variant<MessagePtr> value_;
};
using Updates = std::vector<Update>;
}
#endif // TELEBOTXX_UPDATE_HPP