    

 ## On this page

  

 

 # cli\_server

 Last update: 16.07.2025 

<a id="l00001" name="l00001"></a> 1 

<a id="l00005" name="l00005"></a> 5 

<a id="l00006" name="l00006"></a> 6\#pragma once

<a id="l00007" name="l00007"></a> 7 

<a id="l00008" name="l00008"></a> 8\#include "core/service/grpc/cli/i\_cli\_server.h"

<a id="l00009" name="l00009"></a> 9\#include "core/service/sim\_runner/i\_sim\_runner.h"

<a id="l00010" name="l00010"></a> 10\#include &lt;atomic&gt;

<a id="l00011" name="l00011"></a> 11\#include &lt;thread&gt;

<a id="l00012" name="l00012"></a> 12 

<a id="l00017" name="l00017"></a> 17namespace [simulation\_framework](namespacesimulation__framework.xhtml)

<a id="l00018" name="l00018"></a> 18{

<a id="l00019" name="l00019"></a> 19namespace [core](namespacecore.xhtml)

<a id="l00020" name="l00020"></a> 20{

<a id="l00021" name="l00021"></a> 21 

<a id="l00023" name="l00023"></a> 23 

<a id="l00027" name="l00027"></a>[ 27](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml)class [SimfwkCliServer](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml) : public [ISimfwkCliServer](classsimulation__framework_1_1core_1_1ISimfwkCliServer.xhtml)

<a id="l00028" name="l00028"></a> 28{

<a id="l00029" name="l00029"></a> 29 public:

<a id="l00032" name="l00032"></a>[ 32](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a7d45c7dc24e6751063c9894339912009) [SimfwkCliServer](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a7d45c7dc24e6751063c9894339912009)(const std::string&amp; [server\_address](classsimulation__framework_1_1core_1_1Topic.xhtml));

<a id="l00033" name="l00033"></a> 33 

<a id="l00035" name="l00035"></a>[ 35](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a8cd61043746cbaa3ac45453188b51d99) [~SimfwkCliServer](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a8cd61043746cbaa3ac45453188b51d99)();

<a id="l00036" name="l00036"></a> 36 

<a id="l00038" name="l00038"></a>[ 38](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#ab9d3d3b02f9601efb7c4c979ffccce06) void [WaitForCommand](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#ab9d3d3b02f9601efb7c4c979ffccce06)();

<a id="l00039" name="l00039"></a> 39 

<a id="l00041" name="l00041"></a>[ 41](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a8f16cb74b31d87361ee4da1b5c7ab9da) std::string [GetServerAddress](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a8f16cb74b31d87361ee4da1b5c7ab9da)();

<a id="l00042" name="l00042"></a> 42 

<a id="l00047" name="l00047"></a>[ 47](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a2298836e929027f610ee47cc6596616d) void [BindSimRunner](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a2298836e929027f610ee47cc6596616d)(std::unique_ptr&lt;simulation_framework::core::ISimRunner&gt; [sim\_runner](classsimulation__framework_1_1core_1_1Topic.xhtml));

<a id="l00048" name="l00048"></a> 48 

<a id="l00049" name="l00049"></a> 49 private:

<a id="l00050" name="l00050"></a> 50 std::string server_address_;

<a id="l00051" name="l00051"></a> 51 std::atomic_bool sim_runner_binded_{false};

<a id="l00052" name="l00052"></a> 52 std::thread grpc_server_thread_;

<a id="l00053" name="l00053"></a> 53};



<a id="l00054" name="l00054"></a> 54 

<a id="l00055" name="l00055"></a> 55} // namespace core

<a id="l00056" name="l00056"></a> 56} // namespace simulation\_framework

[simulation\_framework::core::ISimfwkCliServer](classsimulation__framework_1_1core_1_1ISimfwkCliServer.xhtml)

class ISimfwkCliServer

**Definition** [i\_cli\_server.h:25](i__cli__server_8h_source.xhtml#l00024)



[simulation\_framework::core::SimfwkCliServer](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml)

class SimfwkCliServer

**Definition** [cli\_server.h:28](cli__server_8h_source.xhtml#l00027)



[simulation\_framework::core::SimfwkCliServer::BindSimRunner](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a2298836e929027f610ee47cc6596616d)

void BindSimRunner(std::unique_ptr&lt; simulation_framework::core::ISimRunner &gt; sim_runner)

set sim runner pointer which to be controlled



[simulation\_framework::core::SimfwkCliServer::SimfwkCliServer](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a7d45c7dc24e6751063c9894339912009)

SimfwkCliServer(const std::string &amp;server_address)

ctor of grpc cli server



[simulation\_framework::core::SimfwkCliServer::~SimfwkCliServer](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a8cd61043746cbaa3ac45453188b51d99)

~SimfwkCliServer()

dtor of grpc cli server



[simulation\_framework::core::SimfwkCliServer::GetServerAddress](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#a8f16cb74b31d87361ee4da1b5c7ab9da)

std::string GetServerAddress()

get grpc server address of cli server



[simulation\_framework::core::SimfwkCliServer::WaitForCommand](classsimulation__framework_1_1core_1_1SimfwkCliServer.xhtml#ab9d3d3b02f9601efb7c4c979ffccce06)

void WaitForCommand()

calling this to ensure the server is running and waiting for command to do any action.



[simulation\_framework::core::Topic](classsimulation__framework_1_1core_1_1Topic.xhtml)

This is the concrete Topic class that can be used for creation of a communication channel with given ...

**Definition** [topic.h:38](topic_8h_source.xhtml#l00037)



[core](namespacecore.xhtml)

The namespace for all core functionalities under namespace simulation_framework.



[simulation\_framework](namespacesimulation__framework.xhtml)

The top namespace for simulation framework.