Agora C++ API Reference for All Platforms
Public Member Functions | List of all members
agora::rtm::IChannel Class Referenceabstract

Public Member Functions

virtual void setEventHandler (IChannelEventHandler *eventHandler)=0
 
virtual int join ()=0
 
virtual int leave ()=0
 
virtual int sendMessage (const IMessage *message)=0
 
virtual int updateAttributes (IChannelAttributes *attributes, int64_t &requestId)=0
 
virtual int deleteAttributes (IChannelAttributes *attributes, int64_t &requestId)=0
 
virtual const char * getId () const =0
 
virtual int release ()=0
 

Detailed Description

The IChannel class.

Member Function Documentation

◆ setEventHandler()

virtual void agora::rtm::IChannel::setEventHandler ( IChannelEventHandler eventHandler)
pure virtual

Sets an event handler for IChannel.

Parameters
eventHandlerThe pointer to the event handler of IChannel: IChannelEventHandler.

◆ join()

virtual int agora::rtm::IChannel::join ( )
pure virtual

Joins the current channel.

A successful method call triggers either onJoinSuccess() or onJoinFailure() on the local client, to report the state of joining the channel.

Returns
  • 0: Success.
  • < 0: Failure.

◆ leave()

virtual int agora::rtm::IChannel::leave ( )
pure virtual

Leaves the current channel.

After the local user successfully leaves the channel, the SDK triggers the onLeave() on the local client.

Returns
  • 0: Success.
  • < 0: Failure.

◆ sendMessage()

virtual int agora::rtm::IChannel::sendMessage ( const IMessage message)
pure virtual

Sends a channel message.

After you successfully send a channel message, all members in the channel receive the message in the onMessageReceived() callback.

Parameters
messageThe pointer to the channel message that you want to send: IMessage.
Returns
  • 0: Success.
  • < 0: Failure.

◆ updateAttributes()

virtual int agora::rtm::IChannel::updateAttributes ( IChannelAttributes attributes,
int64_t &  requestId 
)
pure virtual

Updates the channel attributes.

A successful method call triggers the onUpdateAttributesResponse() callback on the local client.

Parameters
attributesThe pointer to the channel attributes that you want to update: IChannelAttributes.
requestIdID of the current update request.
Returns
  • 0: Success.
  • < 0: Failure.

◆ deleteAttributes()

virtual int agora::rtm::IChannel::deleteAttributes ( IChannelAttributes attributes,
int64_t &  requestId 
)
pure virtual

Removes the channel attributes.

A successful method call triggers the onDeleteAttributesResponse() callback on the local client.

Parameters
attributesThe pointer to the channel attributes that you want to remove: IChannelAttributes.
requestIdID of the current delete request.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getId()

virtual const char* agora::rtm::IChannel::getId ( ) const
pure virtual

Gets the current request ID.

Returns
  • The pointer to the request ID, if the method call succeeds.
  • An empty pointer NULL, if the method call fails.

◆ release()

virtual int agora::rtm::IChannel::release ( )
pure virtual

Releases the IChannel instance.

This is a synchronous method call, which means that the SDK reports the result of this method call after the IChannel instance is successfully released.

Returns
  • 0: Success.
  • < 0: Failure.