TDLib
Loading...
Searching...
No Matches
ClientActor Class Referencefinal

Inherits Actor.

Description

This is a low-level Actor interface for interaction with TDLib. The interface is a lot more flexible than the ClientManager interface, however, for most usages the ClientManager interface should be sufficient.

Classes

struct  Options
 Options for ClientActor creation. More...

Public Member Functions

 ClientActor (ClientActor &&other) noexcept
 ClientActor (const ClientActor &)=delete
 ClientActor (unique_ptr< TdCallback > callback, Options options={})
ClientActor & operator= (ClientActor &&other) noexcept
ClientActor & operator= (const ClientActor &)=delete
void request (uint64 id, td_api::object_ptr< td_api::Function > request)
 ~ClientActor () final

Static Public Member Functions

static td_api::object_ptr< td_api::Object > execute (td_api::object_ptr< td_api::Function > request)

Constructor & Destructor Documentation

◆ ClientActor() [1/2]

ClientActor ( unique_ptr< TdCallback > callback,
Options options = {} )
explicit

Creates a ClientActor using the specified callback.

Parameters
[in]callbackCallback for outgoing notifications from TDLib.
[in]optionsOptions to create the TDLib.

◆ ~ClientActor()

~ClientActor ( )
final

Destroys the ClientActor and the TDLib instance.

◆ ClientActor() [2/2]

ClientActor ( ClientActor && other)
noexcept

Move constructor.

Member Function Documentation

◆ execute()

Synchronously executes a TDLib request. Only a few requests can be executed synchronously. May be called from any thread.

Parameters
[in]requestRequest to the TDLib instance.
Returns
The request response.

◆ operator=()

ClientActor & operator= ( ClientActor && other)
noexcept

Move assignment operator.

◆ request()

void request ( uint64 id,
td_api::object_ptr< td_api::Function > request )

Sends one request to TDLib. The answer will be received via callback.

Parameters
[in]idRequest identifier, must be positive.
[in]requestThe request.

The documentation for this class was generated from the following file: