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
{
24
class
FigureStubFactory
25
{
26
private
:
27
zmq::context_t*
m_context
;
28
std::string
m_url
;
29
DummyFigure
dummy
;
30
public
:
31
FigureStubFactory
()
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
}
45
AFigureStub
*
createFigureStub
(
int
windowID)
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
}
DLR_TS::PlotLab::AFigureStub
Definition:
afigurestub.h:24
DLR_TS::PlotLab::DummyFigure
Definition:
dummyfigure.h:26
DLR_TS::PlotLab::FigureStubFactory
Definition:
figurestubfactory.h:25
DLR_TS::PlotLab::FigureStubFactory::FigureStubFactory
FigureStubFactory(std::string url)
Definition:
figurestubfactory.h:41
DLR_TS::PlotLab::FigureStubFactory::m_context
zmq::context_t * m_context
Definition:
figurestubfactory.h:27
DLR_TS::PlotLab::FigureStubFactory::getDummy
AFigureStub * getDummy()
Definition:
figurestubfactory.h:49
DLR_TS::PlotLab::FigureStubFactory::FigureStubFactory
FigureStubFactory()
Definition:
figurestubfactory.h:31
DLR_TS::PlotLab::FigureStubFactory::createFigureStub
AFigureStub * createFigureStub(int windowID)
Definition:
figurestubfactory.h:45
DLR_TS::PlotLab::FigureStubFactory::dummy
DummyFigure dummy
Definition:
figurestubfactory.h:29
DLR_TS::PlotLab::FigureStubFactory::parseCommandLine
void parseCommandLine(int _argc, char **_argv)
Definition:
figurestubfactory.h:50
DLR_TS::PlotLab::FigureStubFactory::m_url
std::string m_url
Definition:
figurestubfactory.h:28
DLR_TS::PlotLab::FigureStubZMQ
Definition:
figurestubzmq.h:30
dummyfigure.h
figurestubzmq.h
DLR_TS
Definition:
afigurestub.h:20
plotlablib
plotlablib
include
plotlablib
figurestubfactory.h
Generated by
1.9.1