SUMO - Simulation of Urban MObility
MSJunctionLogic.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // kinds of logic-implementations.
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef MSJunctionLogic_h
23 #define MSJunctionLogic_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <utils/common/StdDefs.h>
36 #include "MSLogicJunction.h"
37 #include <string>
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 public:
49  virtual ~MSJunctionLogic();
50 
52  unsigned int nLinks();
53 
55  virtual const MSLogicJunction::LinkBits& getResponseFor(unsigned int linkIndex) const {
56  UNUSED_PARAMETER(linkIndex);
57  return myDummyFoes;
58  }
59 
61  virtual const MSLogicJunction::LinkBits& getFoesFor(unsigned int linkIndex) const {
62  UNUSED_PARAMETER(linkIndex);
63  return myDummyFoes;
64  }
65  virtual bool getIsCont(unsigned int linkIndex) const {
66  UNUSED_PARAMETER(linkIndex);
67  return false;
68  }
69 
70 
71  unsigned int getLogicSize() const {
72  return myNLinks;
73  }
74 
75  virtual bool hasFoes() const {
76  return false;
77  }
78 
79 
80 
81 
82 protected:
84  MSJunctionLogic(unsigned int nLinks);
85 
87  unsigned int myNLinks;
88 
91 
92 private:
95 
98 
101 
102 };
103 
104 
105 #endif
106 
107 /****************************************************************************/
108 
unsigned int nLinks()
Returns the logic&#39;s number of links.
virtual bool getIsCont(unsigned int linkIndex) const
unsigned int getLogicSize() const
unsigned int myNLinks
The logic&#39;s number of links.
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
virtual const MSLogicJunction::LinkBits & getFoesFor(unsigned int linkIndex) const
Returns the foes for the given link.
virtual const MSLogicJunction::LinkBits & getResponseFor(unsigned int linkIndex) const
Returns the response for the given link.
virtual bool hasFoes() const
MSJunctionLogic()
Default constructor.
MSJunctionLogic & operator=(const MSJunctionLogic &)
Assignment operator.
static MSLogicJunction::LinkBits myDummyFoes
A dummy foe container.
virtual ~MSJunctionLogic()
Destructor.
std::bitset< SUMO_MAX_CONNECTIONS > LinkBits
Container for link response and foes.