xref: /haiku/headers/os/support/Flattenable.h (revision f2b4344867e97c3f4e742a1b4a15e6879644601a)
1 /*
2  * Copyright 2007-2010, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef	_FLATTENABLE_H
6 #define	_FLATTENABLE_H
7 
8 
9 #include <SupportDefs.h>
10 
11 
12 class BFlattenable {
13 public:
14 	virtual	bool				IsFixedSize() const = 0;
15 	virtual	type_code			TypeCode() const = 0;
16 	virtual	ssize_t				FlattenedSize() const = 0;
17 	virtual	status_t			Flatten(void* buffer, ssize_t size) const = 0;
18 	virtual	bool				AllowsTypeCode(type_code code) const;
19 	virtual	status_t			Unflatten(type_code code, const void* buffer,
20 									ssize_t size) = 0;
21 
22 	virtual						~BFlattenable();
23 
24 private:
25 			void				_ReservedFlattenable1();
26 	virtual	void				_ReservedFlattenable2();
27 	virtual	void				_ReservedFlattenable3();
28 };
29 
30 
31 #endif	// _FLATTENABLE_H
32