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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // kinds of logic-implementations.
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 #include <utils/common/StdDefs.h>
26 #include "MSLogicJunction.h"
27 #include <string>
28 
29 
30 // ===========================================================================
31 // class definitions
32 // ===========================================================================
37 public:
39  virtual ~MSJunctionLogic();
40 
42  int nLinks();
43 
45  virtual const MSLogicJunction::LinkBits& getResponseFor(int linkIndex) const {
46  UNUSED_PARAMETER(linkIndex);
47  return myDummyFoes;
48  }
49 
51  virtual const MSLogicJunction::LinkBits& getFoesFor(int linkIndex) const {
52  UNUSED_PARAMETER(linkIndex);
53  return myDummyFoes;
54  }
55  virtual bool getIsCont(int linkIndex) const {
56  UNUSED_PARAMETER(linkIndex);
57  return false;
58  }
59 
60 
61  int getLogicSize() const {
62  return myNLinks;
63  }
64 
65  virtual bool hasFoes() const {
66  return false;
67  }
68 
69 
70 
71 
72 protected:
75 
77  int myNLinks;
78 
81 
82 private:
85 
88 
91 
92 };
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:29
virtual const MSLogicJunction::LinkBits & getFoesFor(int linkIndex) const
Returns the foes for the given link.
virtual const MSLogicJunction::LinkBits & getResponseFor(int linkIndex) const
Returns the response for the given link.
virtual bool getIsCont(int linkIndex) const
virtual bool hasFoes() const
virtual ~MSJunctionLogic()
Destructor.
int nLinks()
Returns the logic's number of links.
MSJunctionLogic & operator=(const MSJunctionLogic &)
Assignment operator.
static MSLogicJunction::LinkBits myDummyFoes
A dummy foe container.
int getLogicSize() const
int myNLinks
The logic's number of links.
MSJunctionLogic()
Default constructor.
MSJunctionLogic(const MSJunctionLogic &)
Copy constructor.
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.