uatools 1.0.0-pre2
 
Loading...
Searching...
No Matches
server.hpp File Reference

YAML-driven OPC UA test server, library form. More...

#include <atomic>
#include <cstdint>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  eso::uatools::itest::VariableSimulationConfig
 
struct  eso::uatools::itest::VariableNodeConfig
 
struct  eso::uatools::itest::FolderConfig
 
struct  eso::uatools::itest::MethodArgConfig
 
struct  eso::uatools::itest::MethodSimulationConfig
 
struct  eso::uatools::itest::MethodConfig
 
struct  eso::uatools::itest::ServerConfigYaml
 

Namespaces

namespace  eso
 
namespace  eso::uatools
 
namespace  eso::uatools::itest
 

Functions

ServerConfigYaml eso::uatools::itest::LoadConfig (const std::string &path)
 Load a YAML file into a ServerConfigYaml.
 
int eso::uatools::itest::Serve (const ServerConfigYaml &cfg, std::atomic< bool > &stop_flag)
 Run an OPC UA server defined by cfg until stop_flag is set.
 

Detailed Description

YAML-driven OPC UA test server, library form.

This is the engine that backs UaItestServer. It is exposed as a library so the same server can be embedded in C++ integration tests (gtest) that drive ualib end-to-end without spawning a separate process.

Typical embedded usage:

auto cfg = eso::uatools::itest::LoadConfig("server.yaml");
std::atomic<bool> stop{false};
std::thread t([&]() { eso::uatools::itest::Serve(cfg, stop); });
// ... run client code against cfg.endpoint ...
stop.store(true);
t.join();
int Serve(const ServerConfigYaml &cfg, std::atomic< bool > &stop_flag)
Run an OPC UA server defined by cfg until stop_flag is set.
Definition server.cpp:851
ServerConfigYaml LoadConfig(const std::string &path)
Load a YAML file into a ServerConfigYaml.
Definition server.cpp:702