CIRCT
19.0.0git
|
The Endpoint registry is where Endpoints report their existence (register) and they are looked up by RPC clients. More...
#include <Endpoint.h>
Public Member Functions | |
bool | registerEndpoint (std::string epId, std::string fromHostTypeId, std::string toHostTypeId) |
Register an Endpoint. More... | |
Endpoint * | operator[] (const std::string &epId) |
Get the specified endpoint. More... | |
void | iterateEndpoints (const std::function< void(std::string id, const Endpoint &)> &f) const |
Iterate over the list of endpoints, calling the provided function for each endpoint. More... | |
size_t | size () const |
Return the number of endpoints. More... | |
Private Types | |
using | Lock = std::lock_guard< std::mutex > |
Private Attributes | |
std::mutex | m |
This object needs to be thread-safe. An object-wide mutex is sufficient. More... | |
std::map< std::string, Endpoint > | endpoints |
Endpoint ID to object pointer mapping. More... | |
The Endpoint registry is where Endpoints report their existence (register) and they are looked up by RPC clients.
Definition at line 110 of file Endpoint.h.
|
private |
Definition at line 137 of file Endpoint.h.
void EndpointRegistry::iterateEndpoints | ( | const std::function< void(std::string id, const Endpoint &)> & | f | ) | const |
Iterate over the list of endpoints, calling the provided function for each endpoint.
Definition at line 55 of file Endpoint.cpp.
|
inline |
Get the specified endpoint.
Return nullptr if it does not exist. This method is defined inline so it can be inlined at compile time. Performance is important here since this method is used in the polling call from the simulator. Returns nullptr if the endpoint cannot be found.
Definition at line 121 of file Endpoint.h.
bool EndpointRegistry::registerEndpoint | ( | std::string | epId, |
std::string | fromHostTypeId, | ||
std::string | toHostTypeId | ||
) |
Register an Endpoint.
Creates the Endpoint object and owns it. Returns false if unsuccessful.
Definition at line 37 of file Endpoint.cpp.
Referenced by esi::cosim::RpcClient::Impl::Impl(), and esi::cosim::RpcServer::registerEndpoint().
size_t EndpointRegistry::size | ( | ) | const |
Return the number of endpoints.
Definition at line 65 of file Endpoint.cpp.
Referenced by esiaccel.types.ArrayType::bit_width(), esiaccel.types.ArrayType::deserialize(), and esiaccel.types.ArrayType::is_valid().
|
private |
Endpoint ID to object pointer mapping.
Definition at line 143 of file Endpoint.h.
Referenced by iterateEndpoints(), operator[](), registerEndpoint(), and size().
|
private |
This object needs to be thread-safe. An object-wide mutex is sufficient.
Definition at line 140 of file Endpoint.h.
Referenced by iterateEndpoints(), operator[](), registerEndpoint(), and size().