Skip to content
Snippets Groups Projects
Commit f333d077 authored by Jacopo Zorzetto's avatar Jacopo Zorzetto
Browse files

linux: add Doxygen comments to functions


Signed-off-by: default avatarJacopo Zorzetto <jacopo.zorzetto@mail.polimi.it>
parent b85e0d6f
No related branches found
No related tags found
No related merge requests found
Pipeline #15478 failed with stages
in 0 seconds
......@@ -28,14 +28,32 @@ private:
std::multimap<int, Link> apply_objective_functions(const Json::Value& functions);
public:
/**
* Engine constructor.
*/
Engine();
/**
* Engine destructor
*/
~Engine();
/**
* Perform the requested action on a device/peripheral present in the network.
* @param command string in JSON format detailing the action to perform.
* @return JSON formatted string explaining the result of the action.
*/
std::string perform(const std::string &command);
/**
* Set the link to the communication layer.
* @param ep Communication layer endpoint.
*/
void set_endpoint(EddieEndpoint *ep);
/**
* Update the data on the available resources in the network
*/
void update_resources();
};
......
......@@ -43,10 +43,25 @@ private:
on_name_lost(GDBusConnection *connection, const gchar *name, gpointer user_data);
public:
/**
* Virtualization constructor
* Initialize the Communication layer component as well as acquiring ownership of the EDDIE dbus name
* @param ip The Ip address used to initialize the communication layer components.
* @param port The port number used to initialize the communication layer components.
*/
explicit VirtualizationReceiver(const std::string& ip = "", const std::string& port = "5683");
/**
* Start the dbus polling loop and start the Communication layer.
* @param local_resources list of EddieResources to add to the local node.
* @return 0 on success, negative integer on failure.
*/
int run(const std::vector<EddieResource*>& local_resources);
/**
* Remove the registration to the Resource Directory of this node
* and release the EDDIE dbus name
*/
void stop() const;
};
......
......@@ -14,17 +14,42 @@
#include <vector>
#include <json/json.h>
/**
* Create a connection over dbus with the VirtualizationReceiver component.
* @return An identifier (never 0) that can be used to close the connection
*/
guint connect();
/**
* Close the connection with VirtualizationReceiver
* @param watcher_id The identifier of the connection
*/
void disconnect(guint watcher_id);
/**
* Create a JSON request message to send to the VirtualizationReceiver component
* @param action one of "find", "get" and "actuate"
* @param action_description a string detailing the action to be performed; valid only if "action=actuate"
* @param h_constraints JSON array containing the list of hard constraints the engine will apply to the request
* @param o_functions JSON array containing the list of objective functions the engine will apply to the request
* @return The JSON request message
*/
Json::Value compose_message(const std::string& action,
const std::string& action_description,
Json::Value h_constraints,
Json::Value o_functions);
/**
* Translate a JSON message into a Virtualization Layer request
* and send the request to the VirtualizationReceiver using dbus
* @param message The JSON message to send
* @return The response as a JSON-formatted string
*/
std::string send_message(const Json::Value& message);
/**
* Start the dbus polling loop
*/
void run();
#endif //EDDIE_VIRTUALIZATION_SENDER_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment