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-2018 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:
77  MSJunctionLogic(int nLinks);
78 
80  int myNLinks;
81 
84 
85 private:
88 
91 
94 
95 };
96 
97 
98 #endif
99 
100 /****************************************************************************/
101 
int nLinks()
Returns the logic&#39;s number of links.
int getLogicSize() const
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:33
int myNLinks
The logic&#39;s number of links.
virtual bool hasFoes() const
virtual const MSLogicJunction::LinkBits & getFoesFor(int linkIndex) const
Returns the foes for the given link.
MSJunctionLogic()
Default constructor.
MSJunctionLogic & operator=(const MSJunctionLogic &)
Assignment operator.
virtual const MSLogicJunction::LinkBits & getResponseFor(int linkIndex) const
Returns the response for the given link.
static MSLogicJunction::LinkBits myDummyFoes
A dummy foe container.
virtual bool getIsCont(int linkIndex) const
virtual ~MSJunctionLogic()
Destructor.
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.