Fawkes API  Fawkes Development Version
fuse_message_content.h
1 
2 /***************************************************************************
3  * fuse_message_content.h - FUSE complex message content
4  *
5  * Created: Thu Nov 22 17:17:16 2007
6  * Copyright 2005-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 _FIREVISION_FVUTILS_NET_FUSE_MESSAGE_CONTENT_H_
25 #define _FIREVISION_FVUTILS_NET_FUSE_MESSAGE_CONTENT_H_
26 
27 #include <sys/types.h>
28 
29 namespace firevision {
30 
32 {
33 public:
35  virtual ~FuseMessageContent();
36 
37  virtual void serialize() = 0;
38  virtual void * payload() const;
39  virtual size_t payload_size() const;
40 
41  void free_payload();
42 
43 protected:
44  void copy_payload(size_t offset, 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 firevision
54 
55 #endif
void free_payload()
Free message payload.
void copy_payload(size_t offset, void *buf, size_t len)
Copy payload into payload buffer to a specified offset.
virtual void * payload() const
Return pointer to payload.
virtual size_t payload_size() const
Return payload size.
void * _payload
Pointer to payload.
virtual ~FuseMessageContent()
Virtual empty destructor.
virtual void serialize()=0
Serialize message content.