TLObject.cpp 924 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. #include "TLObject.h"
  9. #include "NativeByteBuffer.h"
  10. thread_local NativeByteBuffer *sizeCalculatorBuffer = new NativeByteBuffer(true);
  11. TLObject::~TLObject() {
  12. }
  13. void TLObject::readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error) {
  14. }
  15. void TLObject::serializeToStream(NativeByteBuffer *stream) {
  16. }
  17. TLObject *TLObject::deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error) {
  18. return nullptr;
  19. }
  20. uint32_t TLObject::getObjectSize() {
  21. sizeCalculatorBuffer->clearCapacity();
  22. serializeToStream(sizeCalculatorBuffer);
  23. return sizeCalculatorBuffer->capacity();
  24. }
  25. bool TLObject::isNeedLayer() {
  26. return false;
  27. }