CIRCT  20.0.0git
Public Member Functions | Private Attributes | List of all members
esi::cosim::RpcServer::Impl Class Reference
Inheritance diagram for esi::cosim::RpcServer::Impl:
Inheritance graph
[legend]
Collaboration diagram for esi::cosim::RpcServer::Impl:
Collaboration graph
[legend]

Public Member Functions

 Impl (int port)
 Start a server on the given port. -1 means to let the OS pick a port. More...
 
 ~Impl ()
 
void setManifest (int esiVersion, const std::vector< uint8_t > &compressedManifest)
 
ReadChannelPortregisterReadPort (const std::string &name, const std::string &type)
 
WriteChannelPortregisterWritePort (const std::string &name, const std::string &type)
 
void stop ()
 
ServerUnaryReactor * GetManifest (CallbackServerContext *context, const VoidMessage *, Manifest *response) override
 
ServerUnaryReactor * ListChannels (CallbackServerContext *, const VoidMessage *, ListOfChannels *channelsOut) override
 Load the list of channels into the response and fire it off. More...
 
ServerWriteReactor< esi::cosim::Message > * ConnectToClientChannel (CallbackServerContext *context, const ChannelDesc *request) override
 When a client sends a message to a read port (write port on this end), start streaming messages until the client calls uncle and requests a cancellation. More...
 
ServerUnaryReactor * SendToServer (CallbackServerContext *context, const esi::cosim::AddressedMessage *request, esi::cosim::VoidMessage *response) override
 When a client sends a message to a write port (a read port on this end), simply locate the associated port, and write that message into its queue. More...
 

Private Attributes

int esiVersion
 
std::vector< uint8_t > compressedManifest
 
std::map< std::string, std::unique_ptr< RpcServerReadPort > > readPorts
 
std::map< std::string, std::unique_ptr< RpcServerWritePort > > writePorts
 
std::unique_ptr< Server > server
 

Detailed Description

Definition at line 49 of file RpcServer.cpp.

Constructor & Destructor Documentation

◆ Impl()

Impl::Impl ( int  port)

Start a server on the given port. -1 means to let the OS pick a port.

Definition at line 141 of file RpcServer.cpp.

References server, and writePort().

◆ ~Impl()

Impl::~Impl ( )

Definition at line 169 of file RpcServer.cpp.

References server, and stop().

Member Function Documentation

◆ ConnectToClientChannel()

ServerWriteReactor< esi::cosim::Message > * Impl::ConnectToClientChannel ( CallbackServerContext *  context,
const ChannelDesc *  request 
)
override

When a client sends a message to a read port (write port on this end), start streaming messages until the client calls uncle and requests a cancellation.

Definition at line 318 of file RpcServer.cpp.

References writePorts.

◆ GetManifest()

ServerUnaryReactor * Impl::GetManifest ( CallbackServerContext *  context,
const VoidMessage *  ,
Manifest response 
)
override

Definition at line 189 of file RpcServer.cpp.

References compressedManifest, and esiVersion.

◆ ListChannels()

ServerUnaryReactor * Impl::ListChannels ( CallbackServerContext *  context,
const VoidMessage *  ,
ListOfChannels *  channelsOut 
)
override

Load the list of channels into the response and fire it off.

Definition at line 200 of file RpcServer.cpp.

References readPorts, and writePorts.

◆ registerReadPort()

ReadChannelPort & Impl::registerReadPort ( const std::string &  name,
const std::string &  type 
)

Definition at line 174 of file RpcServer.cpp.

References readPorts.

Referenced by esi::cosim::RpcServer::registerReadPort().

◆ registerWritePort()

WriteChannelPort & Impl::registerWritePort ( const std::string &  name,
const std::string &  type 
)

Definition at line 181 of file RpcServer.cpp.

References writePorts.

Referenced by esi::cosim::RpcServer::registerWritePort().

◆ SendToServer()

ServerUnaryReactor * Impl::SendToServer ( CallbackServerContext *  context,
const esi::cosim::AddressedMessage *  request,
esi::cosim::VoidMessage *  response 
)
override

When a client sends a message to a write port (a read port on this end), simply locate the associated port, and write that message into its queue.

Definition at line 333 of file RpcServer.cpp.

References readPorts.

◆ setManifest()

void esi::cosim::RpcServer::Impl::setManifest ( int  esiVersion,
const std::vector< uint8_t > &  compressedManifest 
)
inline

Definition at line 59 of file RpcServer.cpp.

References compressedManifest, and esiVersion.

Referenced by esi::cosim::RpcServer::setManifest().

◆ stop()

void Impl::stop ( )

Definition at line 156 of file RpcServer.cpp.

References readPorts, server, and writePorts.

Referenced by esi::cosim::RpcServer::stop(), and ~Impl().

Member Data Documentation

◆ compressedManifest

std::vector<uint8_t> esi::cosim::RpcServer::Impl::compressedManifest
private

Definition at line 90 of file RpcServer.cpp.

Referenced by GetManifest(), and setManifest().

◆ esiVersion

int esi::cosim::RpcServer::Impl::esiVersion
private

Definition at line 89 of file RpcServer.cpp.

Referenced by GetManifest(), and setManifest().

◆ readPorts

std::map<std::string, std::unique_ptr<RpcServerReadPort> > esi::cosim::RpcServer::Impl::readPorts
private

Definition at line 91 of file RpcServer.cpp.

Referenced by ListChannels(), registerReadPort(), SendToServer(), and stop().

◆ server

std::unique_ptr<Server> esi::cosim::RpcServer::Impl::server
private

Definition at line 94 of file RpcServer.cpp.

Referenced by Impl(), stop(), and ~Impl().

◆ writePorts

std::map<std::string, std::unique_ptr<RpcServerWritePort> > esi::cosim::RpcServer::Impl::writePorts
private

Definition at line 92 of file RpcServer.cpp.

Referenced by ConnectToClientChannel(), ListChannels(), registerWritePort(), and stop().


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