Eclipse SUMO - Simulation of Urban MObility
MSJunctionLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // kinds of logic-implementations.
17 /****************************************************************************/
18 #ifndef MSJunctionLogic_h
19 #define MSJunctionLogic_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <utils/common/StdDefs.h>
28 #include "MSLogicJunction.h"
29 #include <string>
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
39 public:
41  virtual ~MSJunctionLogic();
42 
44  int nLinks();
45 
47  virtual const MSLogicJunction::LinkBits& getResponseFor(int linkIndex) const {
48  UNUSED_PARAMETER(linkIndex);
49  return myDummyFoes;
50  }
51 
53  virtual const MSLogicJunction::LinkBits& getFoesFor(int linkIndex) const {
54  UNUSED_PARAMETER(linkIndex);
55  return myDummyFoes;
56  }
57  virtual bool getIsCont(int linkIndex) const {
58  UNUSED_PARAMETER(linkIndex);
59  return false;
60  }
61 
62 
63  int getLogicSize() const {
64  return myNLinks;
65  }
66 
67  virtual bool hasFoes() const {
68  return false;
69  }
70 
71 
72 
73 
74 protected:
77 
79  int myNLinks;
80 
83 
84 private:
87 
90 
93 
94 };
95 
96 
97 #endif
98 
99 /****************************************************************************/
100 
UNUSED_PARAMETER
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:31
MSJunctionLogic::myNLinks
int myNLinks
The logic's number of links.
Definition: MSJunctionLogic.h:79
MSJunctionLogic::getLogicSize
int getLogicSize() const
Definition: MSJunctionLogic.h:63
MSJunctionLogic
Definition: MSJunctionLogic.h:38
MSJunctionLogic::getResponseFor
virtual const MSLogicJunction::LinkBits & getResponseFor(int linkIndex) const
Returns the response for the given link.
Definition: MSJunctionLogic.h:47
MSJunctionLogic::hasFoes
virtual bool hasFoes() const
Definition: MSJunctionLogic.h:67
MSJunctionLogic::MSJunctionLogic
MSJunctionLogic()
Default constructor.
MSJunctionLogic::nLinks
int nLinks()
Returns the logic's number of links.
Definition: MSJunctionLogic.cpp:38
config.h
StdDefs.h
MSLogicJunction.h
MSLogicJunction::LinkBits
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.
Definition: MSLogicJunction.h:58
MSJunctionLogic::myDummyFoes
static MSLogicJunction::LinkBits myDummyFoes
A dummy foe container.
Definition: MSJunctionLogic.h:82
MSJunctionLogic::getFoesFor
virtual const MSLogicJunction::LinkBits & getFoesFor(int linkIndex) const
Returns the foes for the given link.
Definition: MSJunctionLogic.h:53
MSJunctionLogic::~MSJunctionLogic
virtual ~MSJunctionLogic()
Destructor.
Definition: MSJunctionLogic.cpp:47
MSJunctionLogic::getIsCont
virtual bool getIsCont(int linkIndex) const
Definition: MSJunctionLogic.h:57
MSJunctionLogic::operator=
MSJunctionLogic & operator=(const MSJunctionLogic &)
Assignment operator.