Android-cuttlefish cvd tool
Public Types | Public Member Functions | Private Attributes | Friends | List of all members
cuttlefish::Client Class Reference

#include <client.h>

Collaboration diagram for cuttlefish::Client:
Collaboration graph
[legend]

Public Types

enum  ClientType { RIL , REMOTE }
 

Public Member Functions

 Client ()=default
 
 ~Client ()=default
 
 Client (SharedFD fd)
 
 Client (SharedFD read, SharedFD write)
 
 Client (SharedFD fd, ClientType client_type)
 
 Client (SharedFD read, SharedFD write, ClientType client_type)
 
 Client (const Client &client)=delete
 
 Client (Client &&client)=delete
 
Clientoperator= (Client &&other)=delete
 
bool operator== (const Client &other) const
 
void SendCommandResponse (std::string response) const
 
void SendCommandResponse (const std::vector< std::string > &responses) const
 
ClientId Id () const
 
ClientType Type () const
 

Private Attributes

ClientId id_
 
ClientType type = RIL
 
SharedFD client_read_fd_
 
SharedFD client_write_fd_
 
std::string incomplete_command
 
std::mutex write_mutex
 
bool first_read_command_
 
bool is_valid = true
 

Friends

class ChannelMonitor
 
class ::ModemServiceTest
 

Detailed Description

Client object managed by ChannelMonitor, contains two types, the RIL client and the remote client of other cuttlefish instance. Due to std::mutex does not implement its copy and operate= constructors, it can't be stored in standard contains (vector, map), so use the point instead.

Member Enumeration Documentation

◆ ClientType

Enumerator
RIL 
REMOTE 

Constructor & Destructor Documentation

◆ Client() [1/7]

cuttlefish::Client::Client ( )
default

◆ ~Client()

cuttlefish::Client::~Client ( )
default

◆ Client() [2/7]

cuttlefish::Client::Client ( SharedFD  fd)

◆ Client() [3/7]

cuttlefish::Client::Client ( SharedFD  read,
SharedFD  write 
)

◆ Client() [4/7]

cuttlefish::Client::Client ( SharedFD  fd,
ClientType  client_type 
)

◆ Client() [5/7]

cuttlefish::Client::Client ( SharedFD  read,
SharedFD  write,
ClientType  client_type 
)

◆ Client() [6/7]

cuttlefish::Client::Client ( const Client client)
delete

◆ Client() [7/7]

cuttlefish::Client::Client ( Client &&  client)
delete

Member Function Documentation

◆ Id()

ClientId cuttlefish::Client::Id ( ) const
inline

◆ operator=()

Client & cuttlefish::Client::operator= ( Client &&  other)
delete

◆ operator==()

bool cuttlefish::Client::operator== ( const Client other) const

◆ SendCommandResponse() [1/2]

void cuttlefish::Client::SendCommandResponse ( const std::vector< std::string > &  responses) const

◆ SendCommandResponse() [2/2]

void cuttlefish::Client::SendCommandResponse ( std::string  response) const

◆ Type()

ClientType cuttlefish::Client::Type ( ) const
inline

Friends And Related Function Documentation

◆ ::ModemServiceTest

friend class ::ModemServiceTest
friend

◆ ChannelMonitor

friend class ChannelMonitor
friend

Member Data Documentation

◆ client_read_fd_

SharedFD cuttlefish::Client::client_read_fd_
private

◆ client_write_fd_

SharedFD cuttlefish::Client::client_write_fd_
private

◆ first_read_command_

bool cuttlefish::Client::first_read_command_
private

◆ id_

ClientId cuttlefish::Client::id_
private

◆ incomplete_command

std::string cuttlefish::Client::incomplete_command
private

◆ is_valid

bool cuttlefish::Client::is_valid = true
private

◆ type

ClientType cuttlefish::Client::type = RIL
private

◆ write_mutex

std::mutex cuttlefish::Client::write_mutex
mutableprivate

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