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

Inherits Actor.

Classes

struct  Options
 Options for ClientActor creation. More...
 

Public Member Functions

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

Static Public Member Functions

static td_api::object_ptr< td_api::Objectexecute (td_api::object_ptr< td_api::Function > request)
 

Detailed 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.

Constructor & Destructor Documentation

◆ ClientActor() [1/2]

td::ClientActor::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()

td::ClientActor::~ClientActor ( )
final

Destroys the ClientActor and the TDLib instance.

◆ ClientActor() [2/2]

td::ClientActor::ClientActor ( ClientActor &&  other)
noexcept

Move constructor.

Member Function Documentation

◆ execute()

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

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 & td::ClientActor::operator= ( ClientActor &&  other)
noexcept

Move assignment operator.

◆ request()

void td::ClientActor::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: