CIRCT 22.0.0git
Loading...
Searching...
No Matches
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 (Context &ctxt, int port)
 Start a server on the given port. -1 means to let the OS pick a port.
 
 ~Impl ()
 
ContextgetContext ()
 
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 ()
 
int getPort ()
 
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.
 
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.
 
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.
 

Private Attributes

Contextctxt
 
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
 
int port = -1
 
std::unique_ptr< Server > server
 

Detailed Description

Definition at line 50 of file RpcServer.cpp.

Constructor & Destructor Documentation

◆ Impl()

Impl::Impl ( Context ctxt,
int  port 
)

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

Definition at line 149 of file RpcServer.cpp.

References ctxt, esi::Context::getLogger(), esi::Logger::info(), port, server, and writePort().

◆ ~Impl()

Impl::~Impl ( )

Definition at line 179 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 326 of file RpcServer.cpp.

References esi::Logger::debug(), getContext(), esi::Context::getLogger(), and writePorts.

◆ getContext()

Context & esi::cosim::RpcServer::Impl::getContext ( )
inline

Definition at line 56 of file RpcServer.cpp.

References ctxt.

Referenced by ConnectToClientChannel().

◆ GetManifest()

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

Definition at line 197 of file RpcServer.cpp.

References compressedManifest, context, and esiVersion.

◆ getPort()

int esi::cosim::RpcServer::Impl::getPort ( )
inline

Definition at line 75 of file RpcServer.cpp.

References port.

◆ 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 208 of file RpcServer.cpp.

References context, port, readPorts, and writePorts.

◆ registerReadPort()

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

Definition at line 184 of file RpcServer.cpp.

References port, and readPorts.

◆ registerWritePort()

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

Definition at line 190 of file RpcServer.cpp.

References port, and writePorts.

◆ 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 341 of file RpcServer.cpp.

References context, and readPorts.

◆ setManifest()

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

Definition at line 62 of file RpcServer.cpp.

References compressedManifest, and esiVersion.

◆ stop()

void Impl::stop ( )

Definition at line 166 of file RpcServer.cpp.

References port, readPorts, server, and writePorts.

Referenced by ~Impl().

Member Data Documentation

◆ compressedManifest

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

Definition at line 96 of file RpcServer.cpp.

Referenced by GetManifest(), and setManifest().

◆ ctxt

Context& esi::cosim::RpcServer::Impl::ctxt
private

◆ esiVersion

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

Definition at line 95 of file RpcServer.cpp.

Referenced by GetManifest(), and setManifest().

◆ port

int esi::cosim::RpcServer::Impl::port = -1
private

Definition at line 99 of file RpcServer.cpp.

Referenced by getPort(), Impl(), ListChannels(), registerReadPort(), registerWritePort(), and stop().

◆ readPorts

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

Definition at line 97 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 100 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 98 of file RpcServer.cpp.

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


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