#pragma once /** * \file * Contains downcast_call methods for calling a function object on downcasted to * the most derived class TDLib API object. */ #include "td_api.h" namespace td { namespace td_api { /** * Calls the specified function object with the given object downcasted to its most derived type. * \param[in] obj Object to pass as an argument to the function object. * \param[in] func Function object to which the object will be passed. * \returns Whether function object call has happened. Should always return true for correct parameters. */ template bool downcast_call(Object &obj, const T &func) { switch (obj.get_id()) { case accentColor::ID: func(static_cast(obj)); return true; case accountTtl::ID: func(static_cast(obj)); return true; case addedReaction::ID: func(static_cast(obj)); return true; case addedReactions::ID: func(static_cast(obj)); return true; case address::ID: func(static_cast
(obj)); return true; case animatedChatPhoto::ID: func(static_cast(obj)); return true; case animatedEmoji::ID: func(static_cast(obj)); return true; case animation::ID: func(static_cast(obj)); return true; case animations::ID: func(static_cast(obj)); return true; case archiveChatListSettings::ID: func(static_cast(obj)); return true; case attachmentMenuBot::ID: func(static_cast(obj)); return true; case attachmentMenuBotColor::ID: func(static_cast(obj)); return true; case audio::ID: func(static_cast