#ifndef BLITE_MESSAGE_H
#define BLITE_MESSAGE_H

#include <stdlib.h>

namespace blite
{

// A simple construct of a message. Contains the message and where it comes from.
class Message
{
   friend class ClientImpl;
public:

   // Get the pointer to the buffer of the message. If you are going to use it often, store it somewhere instead
   // of repeatedly calling this function. NB! the buffer is not necessarily null-terminated.
   const char *buffer();

   // Get the size of the buffer.
   size_t bufferSize();

   // Description of what is in buffer... JSON, text, html?
   const char *bufferType();

   // Which application sent this message to you.
   const char *appId();

   ~Message();
private:
   Message(void *payload, char *app_id);

   void *_payload;
   char *_app_id;
};


}



#endif // BLITE_MESSAGE_H
