xref: /haiku/headers/os/support/Flattenable.h (revision be3db2942c0e8dda63cdd226ec3c99309d3eab0c)
1 /*
2  * Copyright 2007, 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, ssize_t size) = 0;
20 
21 		virtual	~BFlattenable();
22 
23 	private:
24 		void _ReservedFlattenable1();
25 		virtual	void _ReservedFlattenable2();
26 		virtual	void _ReservedFlattenable3();
27 };
28 
29 #endif	// _FLATTENABLE_H
30