36#include "nexuslua_export.h"
62 std::unique_ptr<Impl> _impl;
79 virtual const std::map<std::string, AgentMessage>&
GetMessages()
const;
87 void Start(
const std::filesystem::path& luaPath,
const std::string& luaCode);
89 virtual void AddMessage(
const std::string& messageName,
const LuaTable::nested_tables& parameterDescriptions,
const std::string& displayName,
const std::string&
description,
const std::string& icon);
92 friend void ::nexuslua::LuaExtension::AddMessage(
Agent* agent,
const std::string& luaPath,
const std::string& messageName,
const LuaTable& parameters);
This class describes a message that can be sent via nexuslua send or AgentMessage::Send.
Definition agent_message.hpp:50
base class of the three types of agents
Definition agent.hpp:60
virtual std::filesystem::path GetInstallFolder() const
if this agent is installed as a plugin, return its installation folder, otherwise an empty string
std::shared_ptr< agents > GetAgents()
virtual bool IsFreeware() const
if this agent is installed as a plugin, return if it is freeware, otherwise false
Configuration & GetConfiguration()
void Start(const std::filesystem::path &luaPath, const std::string &luaCode)
virtual const AgentMessage & GetMessage(const std::string &messageName) const
return the message with the given name that this agent accepts
int GetId() const
returns a unique ID of this agent
virtual std::string GetUrlLicense() const
if this agent is installed as a plugin, return an URL with license information, otherwise an empty st...
virtual std::string GetLicensee() const
if this agent is installed as a plugin and a license file has been installed, return the licensee,...
Agent(const std::shared_ptr< agents > &agents)
virtual void AddMessage(const std::string &messageName, const LuaTable::nested_tables ¶meterDescriptions, const std::string &displayName, const std::string &description, const std::string &icon)
virtual std::filesystem::path GetPersistentFolder() const
if this agent is installed as a plugin, return the sub folder inside the installation folder that per...
virtual std::string GetUrlPurchase() const
if this agent is installed as a plugin, return an URL where you can purchase a license,...
virtual std::string GetUrlHelp() const
if this agent is installed as a plugin, return the URL that contains help about it,...
virtual std::string GetVersionOnline() const
if this agent is installed as a plugin, return the online version, otherwise an empty string
std::map< std::string, AgentMessage > _messages
Definition agent.hpp:91
virtual const std::map< std::string, AgentMessage > & GetMessages() const
return a reference to all of the messages this agent supports, using the message name as key
virtual std::string GetName() const =0
return the name of the agent
virtual std::string GetVersionInstalled() const
if this agent is installed as a plugin, return its installed version, otherwise an empty string
virtual std::string GetUrlDownload() const
if this agent is installed as a plugin, return its download URL, otherwise an empty string
void Start(const CppHandler &cppHandler)
stores internal and user configuration
Definition configuration.hpp:42
Functions related to agents or plugins, which are (un-)installable agents with meta data like a versi...
Definition agents.hpp:49
void RegisterTableForAgent(const Agent *agent, const nexuslua::LuaTable &table)
void AddMessage(Agent *agent, const std::string &luaPath, const std::string &messageName, const LuaTable ¶meters)
Definition description.hpp:33
The nexuslua library is implemented inside this namespace.
std::function< void(std::shared_ptr< Message >)> CppHandler
the signature of a function that is called whenever a C++ nexuslua::agent receives a message
Definition cpp_handler.hpp:38
This type is used for the parameters of nexuslua::Message. In its serialized representation,...
Definition lua_table.hpp:54