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 /****************************************************************************/
17 // kinds of logic-implementations.
18 /****************************************************************************/
19 #ifndef MSJunctionLogic_h
20 #define MSJunctionLogic_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <utils/common/StdDefs.h>
29 #include "MSLogicJunction.h"
30 #include <string>
31 
32 
33 // ===========================================================================
34 // class definitions
35 // ===========================================================================
40 public:
42  virtual ~MSJunctionLogic();
43 
45  int nLinks();
46 
48  virtual const MSLogicJunction::LinkBits& getResponseFor(int linkIndex) const {
49  UNUSED_PARAMETER(linkIndex);
50  return myDummyFoes;
51  }
52 
54  virtual const MSLogicJunction::LinkBits& getFoesFor(int linkIndex) const {
55  UNUSED_PARAMETER(linkIndex);
56  return myDummyFoes;
57  }
58  virtual bool getIsCont(int linkIndex) const {
59  UNUSED_PARAMETER(linkIndex);
60  return false;
61  }
62 
63 
64  int getLogicSize() const {
65  return myNLinks;
66  }
67 
68  virtual bool hasFoes() const {
69  return false;
70  }
71 
72 
73 
74 
75 protected:
78 
80  int myNLinks;
81 
84 
85 private:
88 
91 
94 
95 };
96 
97 
98 #endif
99 
100 /****************************************************************************/
101 
UNUSED_PARAMETER
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:32
MSJunctionLogic::myNLinks
int myNLinks
The logic's number of links.
Definition: MSJunctionLogic.h:80
MSJunctionLogic::getLogicSize
int getLogicSize() const
Definition: MSJunctionLogic.h:64
MSJunctionLogic
Definition: MSJunctionLogic.h:39
MSJunctionLogic::getResponseFor
virtual const MSLogicJunction::LinkBits & getResponseFor(int linkIndex) const
Returns the response for the given link.
Definition: MSJunctionLogic.h:48
MSJunctionLogic::hasFoes
virtual bool hasFoes() const
Definition: MSJunctionLogic.h:68
MSJunctionLogic::MSJunctionLogic
MSJunctionLogic()
Default constructor.
MSJunctionLogic::nLinks
int nLinks()
Returns the logic's number of links.
Definition: MSJunctionLogic.cpp:39
config.h
StdDefs.h
MSLogicJunction.h
MSLogicJunction::LinkBits
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.
Definition: MSLogicJunction.h:59
MSJunctionLogic::myDummyFoes
static MSLogicJunction::LinkBits myDummyFoes
A dummy foe container.
Definition: MSJunctionLogic.h:83
MSJunctionLogic::getFoesFor
virtual const MSLogicJunction::LinkBits & getFoesFor(int linkIndex) const
Returns the foes for the given link.
Definition: MSJunctionLogic.h:54
MSJunctionLogic::~MSJunctionLogic
virtual ~MSJunctionLogic()
Destructor.
Definition: MSJunctionLogic.cpp:48
MSJunctionLogic::getIsCont
virtual bool getIsCont(int linkIndex) const
Definition: MSJunctionLogic.h:58
MSJunctionLogic::operator=
MSJunctionLogic & operator=(const MSJunctionLogic &)
Assignment operator.