xref: /haiku/src/add-ons/kernel/file_systems/netfs/client/VolumeEvent.h (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 // VolumeEvent.h
2 
3 #ifndef NETFS_VOLUME_EVENT_H
4 #define NETFS_VOLUME_EVENT_H
5 
6 #include <fsproto.h>
7 
8 #include <Referenceable.h>
9 #include <util/DoublyLinkedList.h>
10 
11 
12 // event types
13 enum {
14 	CONNECTION_BROKEN_EVENT,
15 };
16 
17 // VolumeEvent
18 class VolumeEvent : public BReferenceable,
19 	public DoublyLinkedListLinkImpl<VolumeEvent> {
20 public:
21 								VolumeEvent(uint32 type, vnode_id target = -1);
22 	virtual						~VolumeEvent();
23 
24 			uint32				GetType() const;
25 
26 			void				SetTarget(vnode_id target);
27 			vnode_id			GetTarget() const;
28 				// a node ID identifying the target volume (usually the ID
29 				// of the root node)
30 
31 private:
32 			uint32				fType;
33 			vnode_id			fTarget;
34 };
35 
36 // ConnectionBrokenEvent
37 class ConnectionBrokenEvent : public VolumeEvent {
38 public:
39 								ConnectionBrokenEvent(vnode_id target = -1);
40 	virtual						~ConnectionBrokenEvent();
41 };
42 
43 #endif	// NETFS_VOLUME_EVENT_H
44