summaryrefslogtreecommitdiff
path: root/src/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/message.h')
-rw-r--r--src/message.h103
1 files changed, 54 insertions, 49 deletions
diff --git a/src/message.h b/src/message.h
index 6e1804d..ea1c444 100644
--- a/src/message.h
+++ b/src/message.h
@@ -25,81 +25,86 @@
* along with Munia; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __MUNIA_MESSAGE_H__
-#define __MUNIA_MESSAGE_H__
+#pragma once
#include <list>
#include <string>
#include "task.h"
-namespace cmd {
- typedef enum {
- observe,
- unobserve,
- update,
- move,
- create,
- remove,
- login,
- logout,
- error,
- } cmd_t;
+namespace cmd
+{
+typedef enum {
+ observe,
+ unobserve,
+ update,
+ move,
+ create,
+ remove,
+ login,
+ logout,
+ error,
+} cmd_t;
};
-typedef struct {
- std::string user;
- std::string password;
+typedef struct
+{
+ std::string user;
+ std::string password;
} login_t;
-typedef struct {
- taskid_t id;
+typedef struct
+{
+ taskid_t id;
} observe_t;
-typedef struct {
- taskid_t id;
+typedef struct
+{
+ taskid_t id;
} unobserve_t;
-typedef struct {
- taskid_t id;
- taskid_t parentid;
+typedef struct
+{
+ taskid_t id;
+ taskid_t parentid;
} create_t;
-typedef struct {
- taskid_t id;
+typedef struct
+{
+ taskid_t id;
} remove_t;
-typedef struct {
- taskid_t id;
- taskid_t parentid;
+typedef struct
+{
+ taskid_t id;
+ taskid_t parentid;
} move_t;
-typedef struct {
- taskid_t id;
- std::string name;
- std::string value;
+typedef struct
+{
+ taskid_t id;
+ std::string name;
+ std::string value;
} update_t;
-typedef struct {
- cmd::cmd_t cmd;
+typedef struct
+{
+ cmd::cmd_t cmd;
- observe_t observe;
- unobserve_t unobserve;
- create_t create;
- remove_t remove;
- move_t move;
- update_t update;
- login_t login;
+ observe_t observe;
+ unobserve_t unobserve;
+ create_t create;
+ remove_t remove;
+ move_t move;
+ update_t update;
+ login_t login;
- TaskIdList nodes;
+ TaskIdList nodes;
- // tagret node id (observed task id) used for transmissions only.
- taskid_t tid;
-
-} message_t;
+ // tagret node id (observed task id) used for transmissions only.
+ taskid_t tid;
+} message_t;
typedef std::list<message_t> MessageList;
-
-#endif/*__MUNIA_MESSAGE_H__*/