Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::Module Struct Referenceabstract

A module is a chunck of railroad stuff that is all located in one rectangular volume. More...

#include <C:/Trend/Development/Trax3/Code/trax/rigid/modules/Module.h>

Inheritance diagram for trax::Module:

Public Member Functions

virtual const char * TypeName () const noexcept=0
virtual bool IsValid () const noexcept=0
 Checks whether the elements in this module are valid.
virtual void SetFrame (const spat::Frame< Length, One > &frame) noexcept=0
 Set frame of reference.
virtual const spat::Frame< Length, One > & GetFrame () const noexcept=0
 Get frame of reference.
virtual void SetVolume (const spat::Box< Length > &volume) noexcept=0
 Gets the volume this module occupies.
virtual const spat::Box< Length > & GetVolume () const noexcept=0
 Sets the volume this module occupies.
virtual void Attach (std::shared_ptr< TrackSystem > pTrackSystem) noexcept=0
 Attaches a TrackSystem to this Module.
virtual std::shared_ptr< TrackSystemGetTrackSystem () const noexcept=0
virtual void Attach (std::shared_ptr< Fleet > pFleet) noexcept=0
 Attaches a Fleet to this Module.
virtual std::shared_ptr< FleetGetFleet () const noexcept=0
virtual void Attach (std::shared_ptr< SignalCollection > pSignalCollection) noexcept=0
 Attaches a SignalCollection to this Module.
virtual std::shared_ptr< SignalCollectionGetSignalCollection () const noexcept=0
virtual void Attach (std::shared_ptr< IndicatorCollection > pIndicatorCollection) noexcept=0
 Attaches an IndicatorCollection to the track system.
virtual std::shared_ptr< IndicatorCollectionGetIndicatorCollection () const noexcept=0
virtual void Attach (std::shared_ptr< CargoCollection > pCargoCollection) noexcept=0
 Attaches an CargoCollection to the track system.
virtual std::shared_ptr< CargoCollectionGetCargoCollection () const noexcept=0
virtual void Attach (std::shared_ptr< TimerCollection > pTimerCollection) noexcept=0
 Attaches a TimerCollection to the module.
virtual std::shared_ptr< TimerCollectionGetTimerCollection () const noexcept=0
virtual void Attach (std::shared_ptr< PulseCounterCollection > pPulseCounterCollection) noexcept=0
 Attaches a PulseCounterCollection to the module.
virtual std::shared_ptr< PulseCounterCollectionGetPulseCounterCollection () const noexcept=0
virtual void Attach (std::shared_ptr< CameraCollection > pCameraCollection) noexcept=0
 Attaches an CameraCollection to the track system.
virtual std::shared_ptr< CameraCollectionGetCameraCollection () const noexcept=0
virtual void Take (Module &fromModule)=0
 Moves all objects from all the collections to this module.
virtual void Clear ()=0
 Clear the Module from all attached objects.
virtual void ClearCollections ()=0
 Clears all the attached collections.
Public Member Functions inherited from trax::Identified< Module >
virtual const std::string & Reference (const std::string &name) const=0
 Gets a reference that was set for this object by name.
virtual const std::vector< char const * > & ReferenceNames (const std::string &namePart) const=0
 Searches for all reference names that countain namePart as substring in the name.
virtual IDType ID () const noexcept=0
 Identified (const Identified &)=delete
Identified & operator= (const Identified &)=delete
Public Member Functions inherited from trax::SocketRegistry
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 PlugGetPlug (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().
 SocketRegistry (const SocketRegistry &)=delete
 SocketRegistry (SocketRegistry &&)=delete
SocketRegistry & operator= (const SocketRegistry &)=delete
SocketRegistry & operator= (SocketRegistry &&)=delete

Static Public Member Functions

static dclspc std::unique_ptr< ModuleMake (bool bCreateCollections=true) noexcept
 Makes a standard Module object.
Static Public Member Functions inherited from trax::SocketRegistry
static dclspc std::unique_ptr< SocketRegistry > Make () noexcept
 Makes a standard SocketRegistry object.

Detailed Description

A module is a chunck of railroad stuff that is all located in one rectangular volume.

A module holds collection types of various kind to store the items. So TrackSystem, Fleet and Batch collections can be assigned to it (one of each only). A module maintains a frame of reference which is used to determine the general situation of the module. A track will give module local coordinates.

Member Function Documentation

◆ Attach() [1/8]

virtual void trax::Module::Attach ( std::shared_ptr< CameraCollection > pCameraCollection)
pure virtualnoexcept

Attaches an CameraCollection to the track system.

Parameters
pCameraCollectionPointer to object to attach or nullptr to remove.

◆ Attach() [2/8]

virtual void trax::Module::Attach ( std::shared_ptr< CargoCollection > pCargoCollection)
pure virtualnoexcept

Attaches an CargoCollection to the track system.

Parameters
pCargoCollectionPointer to object to attach or nullptr to remove.

◆ Attach() [3/8]

virtual void trax::Module::Attach ( std::shared_ptr< Fleet > pFleet)
pure virtualnoexcept

Attaches a Fleet to this Module.

Parameters
pFleetPointer to object to attach or nullptr to remove.

◆ Attach() [4/8]

virtual void trax::Module::Attach ( std::shared_ptr< IndicatorCollection > pIndicatorCollection)
pure virtualnoexcept

Attaches an IndicatorCollection to the track system.

Parameters
pIndicatorCollectionPointer to object to attach or nullptr to remove.

◆ Attach() [5/8]

virtual void trax::Module::Attach ( std::shared_ptr< PulseCounterCollection > pPulseCounterCollection)
pure virtualnoexcept

Attaches a PulseCounterCollection to the module.

Parameters
pPulseCounterCollectionPointer to object to attach or nullptr to remove.

◆ Attach() [6/8]

virtual void trax::Module::Attach ( std::shared_ptr< SignalCollection > pSignalCollection)
pure virtualnoexcept

Attaches a SignalCollection to this Module.

Parameters
pSignalCollectionPointer to object to attach or nullptr to remove.

◆ Attach() [7/8]

virtual void trax::Module::Attach ( std::shared_ptr< TimerCollection > pTimerCollection)
pure virtualnoexcept

Attaches a TimerCollection to the module.

Parameters
pTimerCollectionPointer to object to attach or nullptr to remove.

◆ Attach() [8/8]

virtual void trax::Module::Attach ( std::shared_ptr< TrackSystem > pTrackSystem)
pure virtualnoexcept

Attaches a TrackSystem to this Module.

Parameters
pTrackSystemPointer to object to attach or nullptr to remove.

◆ Clear()

virtual void trax::Module::Clear ( )
pure virtual

Clear the Module from all attached objects.

Implements trax::SocketRegistry.

◆ GetCameraCollection()

virtual std::shared_ptr< CameraCollection > trax::Module::GetCameraCollection ( ) const
pure virtualnoexcept
Returns
A pointer to the attached Batch.

◆ GetCargoCollection()

virtual std::shared_ptr< CargoCollection > trax::Module::GetCargoCollection ( ) const
pure virtualnoexcept
Returns
A pointer to the attached CargoCollection.

◆ GetFleet()

virtual std::shared_ptr< Fleet > trax::Module::GetFleet ( ) const
pure virtualnoexcept
Returns
A pointer to the attached Fleet.

◆ GetFrame()

virtual const spat::Frame< Length, One > & trax::Module::GetFrame ( ) const
pure virtualnoexcept

Get frame of reference.

The module's frame of reference gets applied to track locations and thereby rolling stock positions etc, so these will always give ModuleSet relative values.

◆ GetIndicatorCollection()

virtual std::shared_ptr< IndicatorCollection > trax::Module::GetIndicatorCollection ( ) const
pure virtualnoexcept
Returns
A pointer to the IndicatorCollection attached to this TrackSystem.

◆ GetPulseCounterCollection()

virtual std::shared_ptr< PulseCounterCollection > trax::Module::GetPulseCounterCollection ( ) const
pure virtualnoexcept
Returns
A pointer to the attached PulseCounterCollection.

◆ GetSignalCollection()

virtual std::shared_ptr< SignalCollection > trax::Module::GetSignalCollection ( ) const
pure virtualnoexcept
Returns
A pointer to the attached SignalCollection.

◆ GetTimerCollection()

virtual std::shared_ptr< TimerCollection > trax::Module::GetTimerCollection ( ) const
pure virtualnoexcept
Returns
A pointer to the attached TimerCollection.

◆ GetTrackSystem()

virtual std::shared_ptr< TrackSystem > trax::Module::GetTrackSystem ( ) const
pure virtualnoexcept
Returns
A pointer to the attached TrackSystem.

◆ IsValid()

virtual bool trax::Module::IsValid ( ) const
pure virtualnoexcept

Checks whether the elements in this module are valid.

Returns
true if all the elements are valid build.

◆ SetFrame()

virtual void trax::Module::SetFrame ( const spat::Frame< Length, One > & frame)
pure virtualnoexcept

Set frame of reference.

The module's frame of reference gets applied to track locations and thereby rolling stock positions etc, so these will always give ModuleSet relative values.

◆ Take()

virtual void trax::Module::Take ( Module & fromModule)
pure virtual

Moves all objects from all the collections to this module.

Objects only can get moved if the appropriate collections are attached to this module. The function will use the Remove() and Add() functions of decorators if applicable.

◆ TypeName()

virtual const char * trax::Module::TypeName ( ) const
pure virtualnoexcept
Returns
the name for the object type that implements this interface.

The documentation for this struct was generated from the following file:
  • C:/Trend/Development/Trax3/Code/trax/rigid/modules/Module.h