\doxysection{Application.\+hpp}
\hypertarget{Application_8hpp_source}{}\label{Application_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/UI/Application.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/UI/Application.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_UI\_APPLICATION\_H}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_UI\_APPLICATION\_H}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ <thread>}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ <mutex>}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ <semaphore>}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <future>}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <cassert>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{comment}{//\ FIXME:\ We\ can't\ include\ the\ Log.hpp\ file\ here\ because\ of\ Qt.\ Why?}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classAgent}{Agent}};}
\DoxyCodeLine{00014\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classPCBoard}{PCBoard}};}
\DoxyCodeLine{00015\ }
\DoxyCodeLine{00016\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classIUIApplication}{IUIApplication}}}
\DoxyCodeLine{00017\ \{}
\DoxyCodeLine{00018\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00019\ \ \ \ \ \textcolor{keyword}{static}\ \mbox{\hyperlink{classIUIApplication}{IUIApplication}}\ *create();}
\DoxyCodeLine{00020\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00021\ \ \ \ \ \textcolor{keyword}{virtual}\ \mbox{\hyperlink{classIUIApplication}{\string~IUIApplication}}();}
\DoxyCodeLine{00022\ \ \ \ \ \textcolor{keyword}{virtual}\ std::future<bool>\ runAsync()\ \{\ \textcolor{keywordflow}{return}\ std::future<bool>();\ \}}
\DoxyCodeLine{00023\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ show()\ \{\ \}}
\DoxyCodeLine{00024\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ hide()\ \{\ \}}
\DoxyCodeLine{00025\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ wait();\ \textcolor{comment}{//\ NOTE:\ This\ is\ on\ by\ default\ by\ reacts\ to\ the\ Lock\ setting\ in\ the\ UI.}}
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ quit(\textcolor{keywordtype}{int}\ code)\ \{\ \}\ \textcolor{comment}{//\ This\ may\ terminate\ Python.}}
\DoxyCodeLine{00027\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ setPCB(\textcolor{keyword}{const}\ std::shared\_ptr<PCBoard>\&,\ \textcolor{keywordtype}{bool}\ wait\ =\ \textcolor{keyword}{true})\ \{\ \}}
\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keyword}{virtual}\ \textcolor{keywordtype}{void}\ setAutonomousAgent(\textcolor{keyword}{const}\ std::shared\_ptr<Agent>\&,\ \textcolor{keyword}{const}\ std::shared\_ptr<PCBoard>\&)\ \{\ \}}
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keywordtype}{void}\ startExclusiveTask(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *warn\ =\ 0);}
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keywordtype}{bool}\ tryStartExclusiveTask(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *name\ =\ 0);}
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keywordtype}{bool}\ endExclusiveTask(\textcolor{keywordtype}{bool}\ rv\ =\ \textcolor{keyword}{true},\ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *reason\ =\ 0);}
\DoxyCodeLine{00032\ \textcolor{keyword}{protected}:}
\DoxyCodeLine{00033\ \ \ \ \ std::shared\_ptr<PCBoard>\ mPCB;}
\DoxyCodeLine{00034\ \ \ \ \ std::unique\_ptr<Agent>\ mUserAgent;}
\DoxyCodeLine{00035\ \ \ \ \ std::shared\_ptr<Agent>\ mAutoAgent;}
\DoxyCodeLine{00036\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00037\ \ \ \ \ std::binary\_semaphore\ mTaskLock\{1\};}
\DoxyCodeLine{00038\ \};}
\DoxyCodeLine{00039\ }
\DoxyCodeLine{00040\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classUIApplication}{UIApplication}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{classIUIApplication}{IUIApplication}}}
\DoxyCodeLine{00041\ \{}
\DoxyCodeLine{00042\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00044\ \ \ \ \ \mbox{\hyperlink{classAgent}{Agent}}\ *\mbox{\hyperlink{classUIApplication_a91628fc243bcbbc9978714569ab226bf}{getUserAgent}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mUserAgent.get();\ \}}
\DoxyCodeLine{00045\ \ \ \ \ \mbox{\hyperlink{classAgent}{Agent}}\ *getAutoAgent()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mAutoAgent.get();\ \}}
\DoxyCodeLine{00046\ \ \ \ \ PCBoard\ *getPCB()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPCB.get();\ \}}
\DoxyCodeLine{00047\ \};}
\DoxyCodeLine{00048\ }
\DoxyCodeLine{00049\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_UI\_APPLICATION\_H}}

\end{DoxyCode}
