Fawkes API  Fawkes Development Version
message_content.h
1 
2 /***************************************************************************
3  * message_content.h - Fawkes network message content
4  *
5  * Created: Fri Jun 01 13:29:09 2007
6  * Copyright 2006-2007 Tim Niemueller [www.niemueller.de]
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef _NETCOMM_FAWKES_MESSAGE_CONTENT_H_
25 #define _NETCOMM_FAWKES_MESSAGE_CONTENT_H_
26 
27 #include <sys/types.h>
28 
29 #include <cstddef>
30 
31 namespace fawkes {
32 
34 {
35 public:
38 
39  virtual void serialize() = 0;
40  virtual void * payload();
41  virtual size_t payload_size();
42 
43 protected:
44  void copy_payload(size_t offset, const void *buf, size_t len);
45 
46 protected:
47  /** Pointer to payload. */
48  void *_payload;
49  /** Payloda size. */
50  size_t _payload_size;
51 };
52 
53 } // end namespace fawkes
54 
55 #endif
void * _payload
Pointer to payload.
Fawkes library namespace.
Fawkes network message content.
virtual void serialize()=0
Serialize message content.
virtual void * payload()
Return pointer to payload.
void copy_payload(size_t offset, const void *buf, size_t len)
Copy payload into payload buffer to a specified offset.
virtual ~FawkesNetworkMessageContent()
Virtual empty destructor.
virtual size_t payload_size()
Return payload size.