ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
figurestubfactory.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2017-2020 German Aerospace Center (DLR).
3  * Eclipse ADORe, Automated Driving Open Research https://eclipse.org/adore
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License 2.0 which is available at
7  * http://www.eclipse.org/legal/epl-2.0.
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  * Daniel Heß - initial API and implementation
13  ********************************************************************************/
14 
15 #pragma once
16 #include "figurestubzmq.h"
17 #include "dummyfigure.h"
18 #include <string>
19 
20 namespace DLR_TS
21 {
22  namespace PlotLab
23  {
25  {
26  private:
27  zmq::context_t* m_context;
28  std::string m_url;
30  public:
32  {
33  m_context = new zmq::context_t(1);
34  m_url = "localhost";
35  char* envVar = getenv("PlotLabServerURL");
36  if(envVar!=0)
37  {
38  m_url = envVar;
39  }
40  }
41  FigureStubFactory(std::string url)
42  {
43  m_url = url;
44  }
46  {
47  return new FigureStubZMQ(*m_context,m_url,windowID);
48  }
49  AFigureStub* getDummy(){return &dummy;}
50  void parseCommandLine(int _argc,char** _argv)
51  {
52  for (short i = 0; i < _argc-1; i++)
53  {
54  char argumentName[] = "PlotLabServerURL";
55  if (strcmp(_argv[i], argumentName) == 0 )
56  {
57  m_url = _argv[i+1];
58  }
59  }
60  }
61  };
62  }
63 }
Definition: afigurestub.h:24
Definition: dummyfigure.h:26
Definition: figurestubfactory.h:25
FigureStubFactory(std::string url)
Definition: figurestubfactory.h:41
zmq::context_t * m_context
Definition: figurestubfactory.h:27
AFigureStub * getDummy()
Definition: figurestubfactory.h:49
FigureStubFactory()
Definition: figurestubfactory.h:31
AFigureStub * createFigureStub(int windowID)
Definition: figurestubfactory.h:45
DummyFigure dummy
Definition: figurestubfactory.h:29
void parseCommandLine(int _argc, char **_argv)
Definition: figurestubfactory.h:50
std::string m_url
Definition: figurestubfactory.h:28
Definition: figurestubzmq.h:30
Definition: afigurestub.h:20