libivon 0.1.0
Voice-over-IP library
Loading...
Searching...
No Matches
ivon::IClient Class Referenceabstract

Pure virtual interface for the libivon client. More...

#include <ivon_client_interface.hpp>

Inheritance diagram for ivon::IClient:
ivon::ClientWrapper

Public Member Functions

virtual ~IClient ()=default
 
virtual expected_void< NegotiationErrorconnect ()=0
 Connect to the server (blocking).
 
virtual void disconnect ()=0
 Disconnect from the server (blocks until closed).
 
virtual ConnectionState connection_state () const noexcept=0
 Get the current connection lifecycle state.
 
virtual bool is_connected () const noexcept=0
 Check if fully connected to the server.
 
virtual bool is_synchronized () const noexcept=0
 Check if initial state synchronization is complete.
 
virtual std::string session_id () const =0
 Get the session ID assigned by the server (empty if not connected).
 
virtual bool send_client_message (const std::string &client_id, const std::string &type, const std::vector< uint8_t > &buffer)=0
 Send a typed message to a specific remote client. Returns false if not connected.
 
virtual bool send_broadcast_message (const std::string &type, const std::vector< uint8_t > &buffer)=0
 Broadcast a typed message to all connected clients. Returns false if not connected.
 
virtual bool send_group_message (const std::string &group_id, const std::string &type, const std::vector< uint8_t > &buffer)=0
 Send a typed message to all members of a group via TCP. Returns false if not connected or not a member.
 
virtual size_t get_remote_client_count () const noexcept=0
 Get the count of remote clients in the session.
 
virtual bool has_remote_client (const std::string &client_id) const noexcept=0
 Check if a remote client with the given ID exists.
 
virtual std::vector< std::string > get_remote_client_ids () const =0
 Get all remote client IDs as a vector.
 
virtual bool join_group (const std::string &group_id)=0
 Request to join a group. Returns false if not connected.
 
virtual bool leave_group (const std::string &group_id)=0
 Request to leave a group. Returns false if not connected.
 
virtual bool request_group_list ()=0
 Request the list of available groups from the server.
 
virtual bool set_mute (const std::string &group_id, const std::string &target_client_id, bool muted)=0
 Mute or unmute a target client in a specific group.
 
virtual bool is_group_member (const std::string &group_id) const =0
 Check if this client is a member of the given group.
 
virtual std::vector< std::string > get_group_ids () const =0
 Get all group IDs this client is a member of.
 
virtual bool send_group_data (const std::string &group_id, const unsigned char *data, size_t len)=0
 Send raw data to a group via the fanout channel.
 
virtual bool send_group_data (const std::string &group_id, const std::vector< uint8_t > &data)=0
 Send raw data to a group via the fanout channel (vector overload).
 
virtual bool set_fanout_sender_id (uint64_t sender_id)=0
 Set this client's fanout sender ID (used for audio routing).
 
virtual void on_tofu_verify (TofuVerifyCallback cb)=0
 Set the TOFU key verification callback (called during negotiation).
 
virtual void on_password_required (PasswordCallback cb)=0
 Set the password prompt callback (called when the server requires auth).
 
virtual void on_client_message (ClientMessageCallback cb)=0
 Set the callback for incoming direct client messages.
 
virtual void on_client_joined (ClientJoinedCallback cb)=0
 Set the callback fired when a remote client joins the session.
 
virtual void on_client_left (ClientLeftCallback cb)=0
 Set the callback fired when a remote client leaves the session.
 
virtual void on_kicked (KickedCallback cb)=0
 Set the callback fired when this client is kicked from the server.
 
virtual void on_disconnected (DisconnectedCallback cb)=0
 Set the callback fired when the connection is lost or closed.
 
virtual void on_connection_state_changed (ConnectionStateCallback cb)=0
 Set the callback fired on connection state transitions.
 
virtual void on_group_joined (GroupJoinCallback cb)=0
 Set the callback for group join results.
 
virtual void on_group_left (GroupLeaveCallback cb)=0
 Set the callback for group leave results.
 
virtual void on_group_key_update (GroupKeyUpdateCallback cb)=0
 Set the callback fired when a group's encryption key is rotated.
 
virtual void on_group_member_joined (GroupMemberJoinedCallback cb)=0
 Set the callback fired when another client joins a group.
 
virtual void on_group_member_left (GroupMemberLeftCallback cb)=0
 Set the callback fired when another client leaves a group.
 
virtual void on_group_kicked (GroupKickedCallback cb)=0
 Set the callback fired when this client is kicked from a group.
 
virtual void on_group_list (GroupListCallback cb)=0
 Set the callback for group list responses.
 
virtual void on_group_mute (GroupMuteCallback cb)=0
 Set the callback for group mute operation results.
 
virtual void on_fanout_data (FanoutDataCallback cb)=0
 Set the callback for incoming fanout data.
 
virtual void on_fanout_error (FanoutErrorCallback cb)=0
 Set the callback for fanout channel errors.
 
virtual void on_server_properties (ServerPropertiesCallback cb)=0
 Set the callback for initial server properties received during sync.
 
virtual void on_server_property_update (ServerPropertyUpdateCallback cb)=0
 Set the callback for server property updates.
 
virtual void on_group_property_update (GroupPropertyUpdateCallback cb)=0
 Set the callback for group property updates.
 

Detailed Description

Pure virtual interface for the libivon client.

Every method here must have a corresponding C ABI function in ivon_client.h and a wrapper in ivon_client_wrapper.hpp. Adding a new pure virtual here will cause a compile error in any class that inherits IClient but hasn't implemented the new method, ensuring the C ABI stays synchronized with the C++ API.

Constructor & Destructor Documentation

◆ ~IClient()

virtual ivon::IClient::~IClient ( )
virtualdefault

Member Function Documentation

◆ connect()

virtual expected_void< NegotiationError > ivon::IClient::connect ( )
pure virtual

Connect to the server (blocking).

Returns
Success, or NegotiationError on failure.

Implemented in ivon::ClientWrapper.

◆ connection_state()

virtual ConnectionState ivon::IClient::connection_state ( ) const
pure virtualnoexcept

Get the current connection lifecycle state.

Implemented in ivon::ClientWrapper.

◆ disconnect()

virtual void ivon::IClient::disconnect ( )
pure virtual

Disconnect from the server (blocks until closed).

Implemented in ivon::ClientWrapper.

◆ get_group_ids()

virtual std::vector< std::string > ivon::IClient::get_group_ids ( ) const
pure virtual

Get all group IDs this client is a member of.

Implemented in ivon::ClientWrapper.

◆ get_remote_client_count()

virtual size_t ivon::IClient::get_remote_client_count ( ) const
pure virtualnoexcept

Get the count of remote clients in the session.

Implemented in ivon::ClientWrapper.

◆ get_remote_client_ids()

virtual std::vector< std::string > ivon::IClient::get_remote_client_ids ( ) const
pure virtual

Get all remote client IDs as a vector.

Implemented in ivon::ClientWrapper.

◆ has_remote_client()

virtual bool ivon::IClient::has_remote_client ( const std::string &  client_id) const
pure virtualnoexcept

Check if a remote client with the given ID exists.

Implemented in ivon::ClientWrapper.

◆ is_connected()

virtual bool ivon::IClient::is_connected ( ) const
pure virtualnoexcept

Check if fully connected to the server.

Implemented in ivon::ClientWrapper.

◆ is_group_member()

virtual bool ivon::IClient::is_group_member ( const std::string &  group_id) const
pure virtual

Check if this client is a member of the given group.

Implemented in ivon::ClientWrapper.

◆ is_synchronized()

virtual bool ivon::IClient::is_synchronized ( ) const
pure virtualnoexcept

Check if initial state synchronization is complete.

Implemented in ivon::ClientWrapper.

◆ join_group()

virtual bool ivon::IClient::join_group ( const std::string &  group_id)
pure virtual

Request to join a group. Returns false if not connected.

Implemented in ivon::ClientWrapper.

◆ leave_group()

virtual bool ivon::IClient::leave_group ( const std::string &  group_id)
pure virtual

Request to leave a group. Returns false if not connected.

Implemented in ivon::ClientWrapper.

◆ on_client_joined()

virtual void ivon::IClient::on_client_joined ( ClientJoinedCallback  cb)
pure virtual

Set the callback fired when a remote client joins the session.

Implemented in ivon::ClientWrapper.

◆ on_client_left()

virtual void ivon::IClient::on_client_left ( ClientLeftCallback  cb)
pure virtual

Set the callback fired when a remote client leaves the session.

Implemented in ivon::ClientWrapper.

◆ on_client_message()

virtual void ivon::IClient::on_client_message ( ClientMessageCallback  cb)
pure virtual

Set the callback for incoming direct client messages.

Implemented in ivon::ClientWrapper.

◆ on_connection_state_changed()

virtual void ivon::IClient::on_connection_state_changed ( ConnectionStateCallback  cb)
pure virtual

Set the callback fired on connection state transitions.

Implemented in ivon::ClientWrapper.

◆ on_disconnected()

virtual void ivon::IClient::on_disconnected ( DisconnectedCallback  cb)
pure virtual

Set the callback fired when the connection is lost or closed.

Implemented in ivon::ClientWrapper.

◆ on_fanout_data()

virtual void ivon::IClient::on_fanout_data ( FanoutDataCallback  cb)
pure virtual

Set the callback for incoming fanout data.

Implemented in ivon::ClientWrapper.

◆ on_fanout_error()

virtual void ivon::IClient::on_fanout_error ( FanoutErrorCallback  cb)
pure virtual

Set the callback for fanout channel errors.

Implemented in ivon::ClientWrapper.

◆ on_group_joined()

virtual void ivon::IClient::on_group_joined ( GroupJoinCallback  cb)
pure virtual

Set the callback for group join results.

Implemented in ivon::ClientWrapper.

◆ on_group_key_update()

virtual void ivon::IClient::on_group_key_update ( GroupKeyUpdateCallback  cb)
pure virtual

Set the callback fired when a group's encryption key is rotated.

Implemented in ivon::ClientWrapper.

◆ on_group_kicked()

virtual void ivon::IClient::on_group_kicked ( GroupKickedCallback  cb)
pure virtual

Set the callback fired when this client is kicked from a group.

Implemented in ivon::ClientWrapper.

◆ on_group_left()

virtual void ivon::IClient::on_group_left ( GroupLeaveCallback  cb)
pure virtual

Set the callback for group leave results.

Implemented in ivon::ClientWrapper.

◆ on_group_list()

virtual void ivon::IClient::on_group_list ( GroupListCallback  cb)
pure virtual

Set the callback for group list responses.

Implemented in ivon::ClientWrapper.

◆ on_group_member_joined()

virtual void ivon::IClient::on_group_member_joined ( GroupMemberJoinedCallback  cb)
pure virtual

Set the callback fired when another client joins a group.

Implemented in ivon::ClientWrapper.

◆ on_group_member_left()

virtual void ivon::IClient::on_group_member_left ( GroupMemberLeftCallback  cb)
pure virtual

Set the callback fired when another client leaves a group.

Implemented in ivon::ClientWrapper.

◆ on_group_mute()

virtual void ivon::IClient::on_group_mute ( GroupMuteCallback  cb)
pure virtual

Set the callback for group mute operation results.

Implemented in ivon::ClientWrapper.

◆ on_group_property_update()

virtual void ivon::IClient::on_group_property_update ( GroupPropertyUpdateCallback  cb)
pure virtual

Set the callback for group property updates.

Implemented in ivon::ClientWrapper.

◆ on_kicked()

virtual void ivon::IClient::on_kicked ( KickedCallback  cb)
pure virtual

Set the callback fired when this client is kicked from the server.

Implemented in ivon::ClientWrapper.

◆ on_password_required()

virtual void ivon::IClient::on_password_required ( PasswordCallback  cb)
pure virtual

Set the password prompt callback (called when the server requires auth).

Implemented in ivon::ClientWrapper.

◆ on_server_properties()

virtual void ivon::IClient::on_server_properties ( ServerPropertiesCallback  cb)
pure virtual

Set the callback for initial server properties received during sync.

Implemented in ivon::ClientWrapper.

◆ on_server_property_update()

virtual void ivon::IClient::on_server_property_update ( ServerPropertyUpdateCallback  cb)
pure virtual

Set the callback for server property updates.

Implemented in ivon::ClientWrapper.

◆ on_tofu_verify()

virtual void ivon::IClient::on_tofu_verify ( TofuVerifyCallback  cb)
pure virtual

Set the TOFU key verification callback (called during negotiation).

Implemented in ivon::ClientWrapper.

◆ request_group_list()

virtual bool ivon::IClient::request_group_list ( )
pure virtual

Request the list of available groups from the server.

Implemented in ivon::ClientWrapper.

◆ send_broadcast_message()

virtual bool ivon::IClient::send_broadcast_message ( const std::string &  type,
const std::vector< uint8_t > &  buffer 
)
pure virtual

Broadcast a typed message to all connected clients. Returns false if not connected.

Implemented in ivon::ClientWrapper.

◆ send_client_message()

virtual bool ivon::IClient::send_client_message ( const std::string &  client_id,
const std::string &  type,
const std::vector< uint8_t > &  buffer 
)
pure virtual

Send a typed message to a specific remote client. Returns false if not connected.

Implemented in ivon::ClientWrapper.

◆ send_group_data() [1/2]

virtual bool ivon::IClient::send_group_data ( const std::string &  group_id,
const std::vector< uint8_t > &  data 
)
pure virtual

Send raw data to a group via the fanout channel (vector overload).

Implemented in ivon::ClientWrapper.

◆ send_group_data() [2/2]

virtual bool ivon::IClient::send_group_data ( const std::string &  group_id,
const unsigned char *  data,
size_t  len 
)
pure virtual

Send raw data to a group via the fanout channel.

Implemented in ivon::ClientWrapper.

◆ send_group_message()

virtual bool ivon::IClient::send_group_message ( const std::string &  group_id,
const std::string &  type,
const std::vector< uint8_t > &  buffer 
)
pure virtual

Send a typed message to all members of a group via TCP. Returns false if not connected or not a member.

Implemented in ivon::ClientWrapper.

◆ session_id()

virtual std::string ivon::IClient::session_id ( ) const
pure virtual

Get the session ID assigned by the server (empty if not connected).

Implemented in ivon::ClientWrapper.

◆ set_fanout_sender_id()

virtual bool ivon::IClient::set_fanout_sender_id ( uint64_t  sender_id)
pure virtual

Set this client's fanout sender ID (used for audio routing).

Implemented in ivon::ClientWrapper.

◆ set_mute()

virtual bool ivon::IClient::set_mute ( const std::string &  group_id,
const std::string &  target_client_id,
bool  muted 
)
pure virtual

Mute or unmute a target client in a specific group.

Implemented in ivon::ClientWrapper.


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