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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // kinds of logic-implementations.
20 /****************************************************************************/
21 #ifndef MSJunctionLogic_h
22 #define MSJunctionLogic_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <utils/common/StdDefs.h>
35 #include "MSLogicJunction.h"
36 #include <string>
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
46 public:
48  virtual ~MSJunctionLogic();
49 
51  int nLinks();
52 
54  virtual const MSLogicJunction::LinkBits& getResponseFor(int linkIndex) const {
55  UNUSED_PARAMETER(linkIndex);
56  return myDummyFoes;
57  }
58 
60  virtual const MSLogicJunction::LinkBits& getFoesFor(int linkIndex) const {
61  UNUSED_PARAMETER(linkIndex);
62  return myDummyFoes;
63  }
64  virtual bool getIsCont(int linkIndex) const {
65  UNUSED_PARAMETER(linkIndex);
66  return false;
67  }
68 
69 
70  int getLogicSize() const {
71  return myNLinks;
72  }
73 
74  virtual bool hasFoes() const {
75  return false;
76  }
77 
78 
79 
80 
81 protected:
83  MSJunctionLogic(int nLinks);
84 
86  int myNLinks;
87 
90 
91 private:
94 
97 
100 
101 };
102 
103 
104 #endif
105 
106 /****************************************************************************/
107 
int nLinks()
Returns the logic&#39;s number of links.
int getLogicSize() const
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
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.