xref: /haiku/src/add-ons/kernel/file_systems/netfs/server/RequestBufferReplacer.h (revision 5a1d355fdf2747f80f8c46e2539f844a0b813346)
1*5a1d355fSStephan Aßmus // RequestBufferReplacer.h
2*5a1d355fSStephan Aßmus 
3*5a1d355fSStephan Aßmus #ifndef NET_FS_REQUEST_BUFFER_REPLACER_H
4*5a1d355fSStephan Aßmus #define NET_FS_REQUEST_BUFFER_REPLACER_H
5*5a1d355fSStephan Aßmus 
6*5a1d355fSStephan Aßmus #include "Request.h"
7*5a1d355fSStephan Aßmus 
8*5a1d355fSStephan Aßmus class RequestBufferReplacer : private RequestMemberVisitor {
9*5a1d355fSStephan Aßmus public:
10*5a1d355fSStephan Aßmus 								RequestBufferReplacer();
11*5a1d355fSStephan Aßmus 								~RequestBufferReplacer();
12*5a1d355fSStephan Aßmus 
13*5a1d355fSStephan Aßmus 			status_t			ReplaceBuffer(Request* request);
14*5a1d355fSStephan Aßmus 
15*5a1d355fSStephan Aßmus private:
16*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, bool& data);
17*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, int8& data);
18*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, uint8& data);
19*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, int16& data);
20*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, uint16& data);
21*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, int32& data);
22*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, uint32& data);
23*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, int64& data);
24*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, uint64& data);
25*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, Data& data);
26*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member, StringData& data);
27*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member,
28*5a1d355fSStephan Aßmus 									RequestMember& subMember);
29*5a1d355fSStephan Aßmus 	virtual	void				Visit(RequestMember* member,
30*5a1d355fSStephan Aßmus 									FlattenableRequestMember& subMember);
31*5a1d355fSStephan Aßmus 
32*5a1d355fSStephan Aßmus private:
33*5a1d355fSStephan Aßmus 			char*				fBuffer;
34*5a1d355fSStephan Aßmus 			int32				fBufferSize;
35*5a1d355fSStephan Aßmus };
36*5a1d355fSStephan Aßmus 
37*5a1d355fSStephan Aßmus #endif	// NET_FS_REQUEST_BUFFER_REPLACER_H
38