| 1 | /* |
| 2 | * This is the source code of tgnet library v. 1.1 |
| 3 | * It is licensed under GNU GPL v. 2 or later. |
| 4 | * You should have received a copy of the license in this archive (see LICENSE). |
| 5 | * |
| 6 | * Copyright Nikolai Kudashov, 2015-2018. |
| 7 | */ |
| 8 | |
| 9 | #ifndef TLOBJECT_H |
| 10 | #define TLOBJECT_H |
| 11 | |
| 12 | #include <stdint.h> |
| 13 | #include "Defines.h" |
| 14 | |
| 15 | class NativeByteBuffer; |
| 16 | |
| 17 | class TLObject { |
| 18 | |
| 19 | public: |
| 20 | virtual ~TLObject(); |
| 21 | virtual void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 22 | virtual void serializeToStream(NativeByteBuffer *stream); |
| 23 | virtual TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 24 | uint32_t getObjectSize(); |
| 25 | virtual bool isNeedLayer(); |
| 26 | |
| 27 | fillParamsFunc initFunc; |
| 28 | }; |
| 29 | |
| 30 | #endif |
| 31 | |