Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
SocketRegistry.h
1// trax track library
2// AD 2016
3//
4// "the resolution of all the fruitless searches"
5//
6// Peter Gabriel
7//
8// Copyright (c) 2025 Trend Redaktions- und Verlagsgesellschaft mbH
9// Copyright (c) 2019 Marc-Michael Horstmann
10//
11// Permission is hereby granted to any person obtaining a copy of this software
12// and associated source code (the "Software"), to use, view, and study the
13// Software for personal or internal business purposes, subject to the following
14// conditions:
15//
16// 1. Redistribution, modification, sublicensing, or commercial use of the
17// Software is NOT permitted without prior written consent from the copyright
18// holder.
19//
20// 2. The Software is provided "AS IS", without warranty of any kind, express
21// or implied.
22//
23// 3. All copies of the Software must retain this license notice.
24//
25// For further information, please contact: horstmann.marc@trendverlag.de
26
27#pragma once
28
29#include "Configuration.h"
30
31#include <memory>
32
33namespace trax{
34
35 struct IDType;
36 struct Plug;
37 struct Jack;
38
40 struct SocketRegistry{
41
43 static dclspc std::unique_ptr<SocketRegistry> Make() noexcept;
44
45
53 virtual void RegisterPlug( Plug& plug ) = 0;
54
55
58 virtual void UnRegisterPlug( const Plug& plug ) = 0;
59
60
63 virtual Plug* GetPlug( IDType id ) const = 0;
64
65
67 virtual IDType MaxValidPlugID() const noexcept = 0;
68
69
76 virtual void ConnectJack( Jack& jack ) = 0;
77
78
81 virtual void RemoveJack( Jack& jack ) noexcept = 0;
82
83
85 virtual void Clear() = 0;
86
87
88 virtual ~SocketRegistry() = default;
89 SocketRegistry( const SocketRegistry& ) = delete;
90 SocketRegistry( SocketRegistry&& ) = delete;
91 SocketRegistry& operator=( const SocketRegistry& ) = delete;
92 SocketRegistry& operator=( SocketRegistry&& ) = delete;
93 protected:
94 SocketRegistry() = default;
95 };
96
97}
98
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
Type used for IDs in the trax library.
Definition IDType.h:43
A jack a plug can get connected with.
Definition Jack.h:83
A Plug of some object can get plugged into a jack of some object, specific to a certain event.
Definition Plug.h:57
virtual void Clear()=0
Clears the registry.
virtual IDType MaxValidPlugID() const noexcept=0
static dclspc std::unique_ptr< SocketRegistry > Make() noexcept
Makes a standard SocketRegistry object.
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 UnRegisterPlug(const Plug &plug)=0
Removes the supplied Plug from registration database.
virtual void RegisterPlug(Plug &plug)=0
Registers a Plug with the module.
virtual Plug * GetPlug(IDType id) const =0