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 #include <cstddef>
29 
30 namespace fawkes {
31 
33 {
34  public:
37 
38  virtual void serialize() = 0;
39  virtual void * payload();
40  virtual size_t payload_size();
41 
42  protected:
43  void copy_payload(size_t offset, const void *buf, size_t len);
44 
45  protected:
46  /** Pointer to payload. */
47  void * _payload;
48  /** Payloda size. */
49  size_t _payload_size;
50 };
51 
52 } // end namespace fawkes
53 
54 #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.