44#include "Identified.h"
63 virtual const char*
TypeName() const noexcept = 0;
85 velocityMax = velocity12,
107 virtual void Toggle(
bool pulse =
true ) = 0;
179 static dclspc std::unique_ptr<VelocityControl>
Make() noexcept;
318 static dclspc std::unique_ptr<JumpSite>
Make() noexcept;
325 virtual
void Target(
std::shared_ptr<Depot> pDepot ) = 0;
402 dclspc
Signal::Status SignalStatusFrom(
const std::string& socketName );
422 virtual void Active(
bool bActive )
noexcept = 0;
426 virtual bool Active() const noexcept = 0;
429 virtual ~SignalTarget() = default;
430 SignalTarget( const SignalTarget& ) = delete;
431 SignalTarget( SignalTarget&& ) = delete;
432 SignalTarget& operator=( const SignalTarget& ) = delete;
433 SignalTarget& operator=( SignalTarget&& ) = delete;
435 SignalTarget() = default;
440 struct SignalAligned{
442 virtual void Attach( std::shared_ptr<Signal> pSignal,
Length parameterOffset = 0
_m ) = 0;
444 virtual IDType GetSignalRef()
const = 0;
446 virtual Length ParameterOffset()
const = 0;
448 virtual void ParameterOffset(
Length parameterOffset ) = 0;
450 virtual bool PreserveUpDirection()
const = 0;
452 virtual void PreserveUpDirection(
bool bPreserveUpDirection ) = 0;
454 virtual ~SignalAligned() =
default;
455 SignalAligned(
const SignalAligned& ) =
delete;
456 SignalAligned( SignalAligned&& ) =
delete;
457 SignalAligned& operator=(
const SignalAligned& ) =
delete;
458 SignalAligned& operator=( SignalAligned&& ) =
delete;
460 SignalAligned() =
default;
Home of the Track and TrackBuilder interfaces.
A Location specifies a position on a track system by referencing a track and a TrackLocation on it.
Definition Location.h:110
Value< Dimension< 1, 0, -1 > > Velocity
Velocity.
Definition DimensionedValues.h:331
Value< Dimension< 1, 0, 0 > > Length
Length.
Definition DimensionedValues.h:324
constexpr Real _m(Length l) noexcept
Dimensionated Values conversion functions.
Definition DimensionedValues.h:1210
Namespace of all the trax track libraries classes and methods.
Definition Collection.h:17
dclspc Signal::Status ToSignalStatus(const std::string &status)
Makes a status value from a status string.
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 Signal that triggers a Train to jump to a jump site.
Definition Signal.h:315
virtual std::shared_ptr< Depot > TargetDepot() const =0
virtual const Location & TargetLocation() const =0
virtual void Target(const Location &target)=0
Sets the target to a location.
virtual Jack & JackOnChangeToJump()=0
Gets a Jack that pulses its Plug if the signal is set to jump and was not set so before.
virtual Jack & JackOnClear()=0
Gets a Jack that pulses its Plug if the signal is set to clear.
static dclspc std::unique_ptr< JumpSite > Make() noexcept
Makes a JumpSite object.
virtual bool IsTargetLocation() const =0
virtual Jack & JackOnJump()=0
Gets a Jack that pulses its Plug if the signal is set to jump.
virtual MultiPlug & PlugToJump()=0
Gets a Plug that sets the signal to jump.
virtual Jack & JackOnChangeToClear()=0
Gets a Jack that pulses its Plug if the signal is set to clear and was not set so before.
virtual MultiPlug & PlugToClear()=0
Gets a Plug that sets the signal to clear.
A MultiPlug provides a variable number of actual Plugs to one input slot.
Definition Plug.h:307
A Signal is positioned along a track and is submitted to a Train if it runs over it.
Definition Signal.h:61
virtual const char * TypeName() const noexcept=0
virtual MultiPlug & PlugTo(Status status)=0
Gets a Plug that switches to the specified Status.
virtual void Toggle(bool pulse=true)=0
Sets the signal state to the next setting.
virtual void UnregisterSockets(SocketRegistry &modul)=0
Removes all references to Plugs and Jacks from the module.
virtual Jack & JackOnChange()=0
virtual void RegisterSockets(SocketRegistry &modul)=0
Registers all the Plugs with the module and supplies the Jacks with plug ids for connecting.
virtual void Attach(TrackBuilder *pTrackBuilder) noexcept=0
Attaches the Signal to a TrackBuilder.
Status
Various Signal status settings.
Definition Signal.h:67
virtual Status Get() const =0
Get the Signal's setting.
virtual Jack & JackOnChangeTo(Status status)=0
Gets a Jack that pulses its Plug if the specified Status is set and was not set before.
virtual MultiPlug & PlugToToggle()=0
virtual Status Set(Status status, bool pulse=true)=0
Set the Signal's setting.
virtual Jack & JackOn(Status status)=0
Gets a Jack that pulses its Plug if the specified Status is set.
virtual int CountStatus() const =0
Gets the number of signal status the signal provides.
virtual void GetTrackRange(TrackRange &trackRange) const =0
Gets the range on the track on wich the signal is effective.
virtual Location GetLocation() const =0
Creates a Location for the signals reference point on the tracks.
virtual TrackBuilder * TrackAttached() const =0
virtual bool Active() const noexcept=0
virtual void Active(bool bActive) noexcept=0
Switches the target on or off to receive notifications from signals.
virtual bool Notify(const Signal &signal, Length distance)=0
Method called to notify about a signalling state.
Interface for a registry that reconnects Plugs and Jacks according to their IDs.
Definition SocketRegistry.h:40
Interface for making and shaping tracks.
Definition Track.h:831
A Signal that can be placed at track couplings to signal that a Train runs over the coupling between ...
Definition Signal.h:369
virtual Track * From() const =0
static dclspc std::unique_ptr< TrackEndTransition > Make(Track *pToTrack, Track::EndType toEnd) noexcept
Makes a standard TrackEndTransition object.
virtual Track * To() const =0
virtual Track * To(Track::EndType &end) const =0
virtual Track * From(Track::EndType &end) const =0
Interface for a track used to calculate 3D positions.
Definition Track.h:275
EndType
Designates one of the two ends of a track.
Definition Track.h:292
An interval on a track, referenced by an id.
Definition TrackLocation.h:132
Interface for signals that control the velocity of trains.
Definition Signal.h:177
virtual void VelocityMin(Status status, Velocity velocityMin)=0
Sets the minimum velocity.
virtual MultiPlug & PlugToVelocity(Status status)=0
virtual void StopDistance(Length distance)=0
Sets a distance from the far edge to stop at.
virtual bool IsValidState(Status status) const =0
static dclspc std::unique_ptr< VelocityControl > Make() noexcept
Makes a VelocityControl object.
virtual bool AffectTravelVelocity(Status status, bool bTravel)=0
Set if the signal should affect the velocity permanently.
virtual void Clear()=0
Removes all signal states.
virtual void VelocityMax(Status status, Velocity velocityMax)=0
Sets the maximum velocity.
virtual Jack & JackOnVelocity(Status status)=0
virtual void Remove(Status status)=0
Removes thje signal state with index idx.
virtual void SetVelocity(Status status, Velocity velocityMin, Velocity velocityMax)=0
Set the target velocities.