2 * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
4 * This program is licensed under the terms and conditions of the
5 * Apache License, version 2.0. The full text of the Apache License is at
6 * http://www.apache.org/licenses/LICENSE-2.0
10 //==========================================================================
12 * @file CicoSCMessage.h
14 * @brief This file is definition of CicoSCMessage class
16 //==========================================================================
17 #ifndef __CICO_SC_MESSAGE_H__
18 #define __CICO_SC_MESSAGE_H__
22 #include <json-glib/json-glib.h>
24 //==========================================================================
25 // forward declaration
26 //==========================================================================
27 class CicoSCUwsHandle;
29 //==========================================================================
31 * @brief This class hold communication message
33 //==========================================================================
37 // default constructor
41 virtual ~CicoSCMessage();
44 unsigned int getId(void);
46 // add root object for char pointer type
47 void addRootObject(const char * key, const char * value);
49 // add root object for string type
50 void addRootObject(const char * key, const std::string & value);
52 // add root object for integer type
53 void addRootObject(const char * key, int value);
55 // add argument object for char pointer type
56 void addArgObject(const char * key, const char * value);
58 // add argument object for string type
59 void addArgObject(const char * key, const std::string & value);
61 // add argument object for integer type
62 void addArgObject(const char * key, int value);
64 // add argument object for array type
65 void addArgObject(const char * key);
67 // add element to array for char pointer type
68 void addElmArray(const char * value);
70 // add element to array for string type
71 void addElmArray(const std::string & value);
73 // get destination handle
74 CicoSCUwsHandle* getHandle(void);
76 // set destination handle
77 void setHandle(CicoSCUwsHandle* handle);
80 virtual const char* getData(void);
82 // set application id of destination
83 void setSendToAppid(const std::string & appid);
85 // get application id of destination
86 const std::string & getSendToAppid(void);
89 // assignment operator
90 CicoSCMessage& operator=(const CicoSCMessage &object);
93 CicoSCMessage(const CicoSCMessage &object);
96 static unsigned int ms_counter; //!< message id counter
97 int m_id; //!< message id
98 CicoSCUwsHandle *m_uwsHandle; //!< communication handler
99 JsonGenerator *m_generator; //!< json generator
100 JsonNode *m_root; //!< json root node
101 JsonObject *m_rootObj; //!< json root objects
102 JsonObject *m_argObj; //!< json arg objects
103 JsonArray *m_array; //!< json array
104 std::string m_toAppid; //!< send to appid
105 std::string m_data; //!< json format data
107 #endif // __CICO_SC_MESSAGE_H__
108 // vim:set expandtab ts=4 sw=4: