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 #if 0 /* just to make Emacs auto-indent happy */
31 }
32 #endif
33 
35 {
36  public:
38  virtual ~FuseMessageContent();
39 
40  virtual void serialize() = 0;
41  virtual void * payload() const;
42  virtual size_t payload_size() const;
43 
44  void free_payload();
45 
46  protected:
47  void copy_payload(size_t offset, void *buf, size_t len);
48 
49  protected:
50  /** Pointer to payload. */
51  void * _payload;
52  /** Payloda size. */
53  size_t _payload_size;
54 
55 };
56 
57 } // end namespace firevision
58 
59 #endif
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.
void free_payload()
Free message payload.
void * _payload
Pointer to payload.
virtual size_t payload_size() const
Return payload size.
virtual void serialize()=0
Serialize message content.
virtual ~FuseMessageContent()
Virtual empty destructor.