// This file generated by libqtelegram-code-generator.
// You can download it from: https://github.com/Aseman-Land/libqtelegram-code-generator
// DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

#ifndef TELEGRAMTYPEOBJECT_H
#define TELEGRAMTYPEOBJECT_H

#ifdef LQTG_DISABLE_ASSERTS
#define LQTG_FETCH_ASSERT setError(true)
#define LQTG_PUSH_ASSERT setError(true)
#else
#include <QtGlobal>
#define LQTG_FETCH_ASSERT qt_assert("x",__FILE__,__LINE__)
#define LQTG_PUSH_ASSERT qt_assert("x",__FILE__,__LINE__)
#endif

#ifdef LQTG_DISABLE_LOG
#define LQTG_FETCH_LOG
#define LQTG_PUSH_LOG
#else
#include <QDebug>
#define LQTG_FETCH_LOG qDebug() << this << __PRETTY_FUNCTION__;
#define LQTG_PUSH_LOG qDebug() << this << __PRETTY_FUNCTION__;
#endif

#include "libqtelegram_global.h"

class InboundPkt;
class OutboundPkt;
class LIBQTELEGRAMSHARED_EXPORT TelegramTypeObject
{
public:
    TelegramTypeObject();
    ~TelegramTypeObject();

    virtual bool fetch(InboundPkt *in) = 0;
    virtual bool push(OutboundPkt *out) const = 0;

    bool error() const;

protected:
    void setError(bool stt) {
        mError = stt;
    }

private:
    bool mError;
};

#endif // TELEGRAMTYPEOBJECT_H
