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

A Plug of some object can get plugged into a jack of some object, specific to a certain event. More...

#include <C:/Trend/Development/Trax3/Code/trax/Plug.h>

Inheritance diagram for trax::Plug:

Public Member Functions

virtual const char * TypeName () const noexcept=0
virtual JackPlugged () const noexcept=0
 Is this Plug already plugged into a jack?
virtual bool IsCyclic () const noexcept=0
virtual const PlugTail () const =0
 receives the tail (last element) of a Plug chain.
virtual PlugTail ()=0
 receives the tail (last element) of a Plug chain.
virtual JackJackOnPulse () noexcept=0
 Get a Jack that triggers a pulse if the Plug receives a pulse.
virtual const JackJackOnPulse () const noexcept=0
 Get a Jack that triggers a pulse if the Plug receives a pulse.
virtual PlugEnumeratorParent () const noexcept=0
virtual void Remove () noexcept=0
Public Member Functions inherited from trax::Identified< Plug >
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

Protected Member Functions

virtual void Pulse (bool) noexcept
virtual void Release () noexcept
virtual void ConnectTo (Jack &) noexcept

Friends

class Jack_Imp

Detailed Description

A Plug of some object can get plugged into a jack of some object, specific to a certain event.

The plug will receive a Pulse() call if that event occures. The pulse is always going from jack to plug. The plugs are provided by objects, too. These would take a pulse, received from a jack of another object as a trigger to perform a certain action. The Pulse() - method has no parameters! There is no meaning to a pulse and no message forewarded. All the 'meaning' of a pulse is laying in the connection of a specific plug to a specific jack.

Member Function Documentation

◆ IsCyclic()

virtual bool trax::Plug::IsCyclic ( ) const
pure virtualnoexcept
Returns
true if it happens that the plug's jacks are connected in a cyclic manner, false otherwise.

Implemented in trax::Plug_Imp.

◆ JackOnPulse() [1/2]

virtual const Jack & trax::Plug::JackOnPulse ( ) const
pure virtualnoexcept

Get a Jack that triggers a pulse if the Plug receives a pulse.

Implemented in trax::Plug_Imp.

◆ JackOnPulse() [2/2]

virtual Jack & trax::Plug::JackOnPulse ( )
pure virtualnoexcept

Get a Jack that triggers a pulse if the Plug receives a pulse.

This can be used to cascade several Plugs to receive the pulse from one single Jack.

Implemented in trax::Plug_Imp.

◆ Parent()

virtual PlugEnumerator & trax::Plug::Parent ( ) const
pure virtualnoexcept
Returns
a pointer to the owner of this plug.

Every object that provides plugs will implement this interface.

Implemented in trax::Plug_Imp.

◆ Plugged()

virtual Jack * trax::Plug::Plugged ( ) const
pure virtualnoexcept

Is this Plug already plugged into a jack?

Returns
A pointer to the Jack this Plug is plugged to.

Implemented in trax::Plug_Imp.

◆ Pulse()

virtual void trax::Plug::Pulse ( bool )
inlineprotectedvirtualnoexcept

◆ Tail() [1/2]

virtual const Plug & trax::Plug::Tail ( ) const
pure virtual

receives the tail (last element) of a Plug chain.

Plugs provide themselves a Jack so they can get cascaded. The function receives the last element in this chain.

Returns
A Plug that is directly or indirectly inserted in this plug's jack and provides an empty Jack.
Exceptions
std::logic_errorif the connection happens to be cyclic, i.e., there is no empty jack.

Implemented in trax::Plug_Imp.

◆ Tail() [2/2]

virtual Plug & trax::Plug::Tail ( )
pure virtual

receives the tail (last element) of a Plug chain.

Plugs provide themselves a Jack so they can get cascaded. The function receives the last element in this chain.

Returns
A Plug that is directly or indirectly inserted in this plug's jack and provides an empty Jack.
Exceptions
std::logic_errorif the connection happens to be cyclic, i.e., there is no empty jack.

Implemented in trax::Plug_Imp.

◆ TypeName()

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

Implemented in trax::Plug_Imp.


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