18#ifndef NeTrainSim_NetSignal_h
19#define NeTrainSim_NetSignal_h
35class NetSignal :
public std::enable_shared_from_this<NetSignal> {
37 static unsigned int NumberOfSignalsInSimulator;
45 std::weak_ptr<NetLink>
link;
54 NetSignal(
int signalID, std::shared_ptr<NetLink> hostingLink);
63 NetSignal(
int signalID, std::shared_ptr<NetLink> hostingLink,
64 std::shared_ptr<NetNode> previousLinkNode, std::shared_ptr<NetNode> currentLinkNode);
The NetLink class represents a network link in a simulation.
Definition netlink.h:36
The NetNode class represents a network node in a simulation.
Definition netnode.h:35
The NetSignal class represents a network signal in a simulation.
Definition netsignal.h:35
std::weak_ptr< NetNode > previousNode
The previous node connected to the signal.
Definition netsignal.h:46
double proximityToActivate
The proximity at which the signal activates.
Definition netsignal.h:43
std::weak_ptr< NetNode > currentNode
The current node connected to the signal.
Definition netsignal.h:47
int userID
The user identifier of the signal.
Definition netsignal.h:40
std::weak_ptr< NetLink > link
The link associated with the signal.
Definition netsignal.h:45
int id
The identifier of the signal.
Definition netsignal.h:41
static unsigned int getNumberOfSignalsInSimulator()
Gets the number of signals in the simulator.
Definition netsignal.cpp:42
bool isGreen
Indicates whether the signal is green.
Definition netsignal.h:42
friend ostream & operator<<(ostream &ostr, const NetSignal &signal)
Overloaded ostream operator for printing the NetSignal object.
Definition netsignal.cpp:48