Interface for a registry that reconnects Plugs and Jacks according to their IDs.
More...
#include <C:/Trend/Development/Trax3/Code/trax/SocketRegistry.h>
|
| virtual void | RegisterPlug (Plug &plug)=0 |
| | Registers a Plug with the module.
|
| virtual void | UnRegisterPlug (const Plug &plug)=0 |
| | Removes the supplied Plug from registration database.
|
| virtual Plug * | GetPlug (IDType id) const =0 |
| virtual IDType | MaxValidPlugID () const noexcept=0 |
| virtual void | ConnectJack (Jack &jack)=0 |
| | Registers a Jack for connecting with a plug.
|
| virtual void | RemoveJack (Jack &jack) noexcept=0 |
| | Remove Jacks foremerely registered with ConnectJack().
|
| virtual void | Clear ()=0 |
| | Clears the registry.
|
|
| SocketRegistry (const SocketRegistry &)=delete |
|
| SocketRegistry (SocketRegistry &&)=delete |
|
SocketRegistry & | operator= (const SocketRegistry &)=delete |
|
SocketRegistry & | operator= (SocketRegistry &&)=delete |
|
|
static dclspc std::unique_ptr< SocketRegistry > | Make () noexcept |
| | Makes a standard SocketRegistry object.
|
Interface for a registry that reconnects Plugs and Jacks according to their IDs.
◆ Clear()
| virtual void trax::SocketRegistry::Clear |
( |
| ) |
|
|
pure virtual |
◆ ConnectJack()
| virtual void trax::SocketRegistry::ConnectJack |
( |
Jack & | jack | ) |
|
|
pure virtual |
Registers a Jack for connecting with a plug.
This will only reconnect a Jack wiches RefPlugID is set, otherwise will do nothing. A registerd Jack will be kept until a Plug appears with RegisterPlug that carries the same id. If a Plug gets registered with zero id all registered Jacks are removed.
- Parameters
-
| jack | Reference to jack that needs reconnection. |
◆ GetPlug()
| virtual Plug * trax::SocketRegistry::GetPlug |
( |
IDType | id | ) |
const |
|
pure virtual |
- Returns
- A Plug previously registered with RegisterPlug() that carries the id or nullptr if no such plug exists.
◆ MaxValidPlugID()
| virtual IDType trax::SocketRegistry::MaxValidPlugID |
( |
| ) |
const |
|
pure virtualnoexcept |
- Returns
- the maximum valid plug id.
◆ RegisterPlug()
| virtual void trax::SocketRegistry::RegisterPlug |
( |
Plug & | plug | ) |
|
|
pure virtual |
Registers a Plug with the module.
If the Plug carries no id it gets assigned some unique id. If it comes with an unique id, that one gets used. If a matching Jack is found, the Plug will get connected.
- Parameters
-
| plug | Reference to Plug to register. |
- Exceptions
-
| std::logic_error | Thrown if it is tried to register a Plug with an id that is already occupied by another registered Plug. |
◆ RemoveJack()
| virtual void trax::SocketRegistry::RemoveJack |
( |
Jack & | jack | ) |
|
|
pure virtualnoexcept |
Remove Jacks foremerely registered with ConnectJack().
- Parameters
-
| jack | Reference to jack that needs to be removed. |
◆ UnRegisterPlug()
| virtual void trax::SocketRegistry::UnRegisterPlug |
( |
const Plug & | plug | ) |
|
|
pure virtual |
Removes the supplied Plug from registration database.
- Parameters
-
| plug | Reference to Plug to unregister. |
The documentation for this struct was generated from the following file: