OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::anonymous_namespace{NetworkAgentFactory.cpp} Namespace Reference

Classes

struct  PythonPrinterAgentRegistrationToken

Functions

std::map< std::string, PrinterAgentInfo > & get_printer_agents ()
std::map< std::string, std::shared_ptr< IPrinterAgent > > & get_printer_agent_cache ()
std::map< std::pair< std::string, std::string >, std::string > & get_python_printer_agent_ids ()
std::string plugin_printer_agent_full_ref (const PluginDescriptor &descriptor, const std::string &capability_name)
template<typename T>
void register_agent ()

Variables

static std::mutex s_registry_mutex
static std::map< std::pair< std::string, std::string >, std::shared_ptr< PythonPrinterAgentRegistrationToken > > s_python_printer_agent_registration_tokens

Class Documentation

◆ Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::PythonPrinterAgentRegistrationToken

struct Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::PythonPrinterAgentRegistrationToken

Function Documentation

◆ get_printer_agent_cache()

std::map< std::string, std::shared_ptr< IPrinterAgent > > & Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::get_printer_agent_cache ( )
49{
50 static std::map<std::string, std::shared_ptr<IPrinterAgent>> cache;
51 return cache;
52}

References get_printer_agent_cache().

Referenced by get_printer_agent_cache().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_printer_agents()

std::map< std::string, PrinterAgentInfo > & Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::get_printer_agents ( )
43{
44 static std::map<std::string, PrinterAgentInfo> agents;
45 return agents;
46}

References get_printer_agents().

Referenced by get_printer_agents().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_python_printer_agent_ids()

std::map< std::pair< std::string, std::string >, std::string > & Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::get_python_printer_agent_ids ( )
55{
56 static std::map<std::pair<std::string, std::string>, std::string> capability_to_agent_id;
57 return capability_to_agent_id;
58}

References get_python_printer_agent_ids().

Referenced by get_python_printer_agent_ids().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ plugin_printer_agent_full_ref()

std::string Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::plugin_printer_agent_full_ref ( const PluginDescriptor & descriptor,
const std::string & capability_name )
61{
62 const std::string identity = descriptor.is_cloud_plugin() ? descriptor.name : descriptor.plugin_key;
63 return identity + ';' + descriptor.cloud_uuid() + ';' + capability_name;
64}
Transform< N, T > identity()
Definition Point.hpp:106
std::string plugin_key
Definition PluginDescriptor.hpp:54
bool is_cloud_plugin() const
Definition PluginDescriptor.hpp:82
std::string name
Definition PluginDescriptor.hpp:55
std::string cloud_uuid() const
Definition PluginDescriptor.hpp:83

References Slic3r::PluginDescriptor::cloud_uuid(), Slic3r::identity(), Slic3r::PluginDescriptor::is_cloud_plugin(), Slic3r::PluginDescriptor::name, Slic3r::PluginDescriptor::plugin_key, and plugin_printer_agent_full_ref().

Referenced by plugin_printer_agent_full_ref().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ register_agent()

template<typename T>
void Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::register_agent ( )
70{
71 auto info = T::get_agent_info_static();
73 [](std::shared_ptr<ICloudServiceAgent> cloud_agent,
74 const std::string& log_dir) -> std::shared_ptr<IPrinterAgent> {
75 auto agent = std::make_shared<T>(log_dir);
76 if (cloud_agent)
77 agent->set_cloud_agent(cloud_agent);
78 return agent;
79 });
80}
static bool register_printer_agent(const std::string &id, const std::string &display_name, PrinterAgentFactory factory)
Definition NetworkAgentFactory.cpp:84

References register_agent(), and Slic3r::NetworkAgentFactory::register_printer_agent().

Referenced by register_agent().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_python_printer_agent_registration_tokens

std::map<std::pair<std::string, std::string>, std::shared_ptr<PythonPrinterAgentRegistrationToken> > Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::s_python_printer_agent_registration_tokens
static

◆ s_registry_mutex

std::mutex Slic3r::anonymous_namespace{NetworkAgentFactory.cpp}::s_registry_mutex
static