xref: /haiku/src/apps/cortex/NodeManager/AddOnHost.h (revision 2f470aec1c92ce6917b8a903e343795dc77af41f)
1 // cortex::NodeManager::AddOnHost.h
2 // * PURPOSE
3 //   Provides an interface to a separate BApplication whose
4 //   single responsibility is to launch nodes.
5 //   NodeManager-launched nodes now run in a separate team,
6 //   helping to lower the likelihood of a socially maladjusted
7 //   young node taking you out.
8 //
9 // * HISTORY
10 //   e.moon			6nov99
11 
12 #ifndef __NodeManager_AddOnHost_H__
13 #define __NodeManager_AddOnHost_H__
14 
15 #include <Application.h>
16 #include <MediaAddOn.h>
17 #include <MediaDefs.h>
18 
19 #include "cortex_defs.h"
20 __BEGIN_CORTEX_NAMESPACE
21 
22 class AddOnHost {
23 
24 public:												// *** static interface
25 
26 	static status_t FindInstance(
27 		BMessenger*								outMessenger);
28 
29 	static status_t Kill(
30 		bigtime_t									timeout=B_INFINITE_TIMEOUT);
31 
32 	// returns B_NOT_ALLOWED if an instance has already been launched
33 	static status_t Launch(
34 		BMessenger*								outMessenger=0);
35 
36 	static status_t InstantiateDormantNode(
37 		const dormant_node_info&	info,
38 		media_node*								outNode,
39 		bigtime_t									timeout=B_INFINITE_TIMEOUT);
40 
41 	static status_t ReleaseInternalNode(
42 		const live_node_info&			info,
43 		bigtime_t									timeout=B_INFINITE_TIMEOUT);
44 
45 	static BMessenger						s_messenger;
46 
47 private:											// implementation
48 	friend class _AddOnHostApp;
49 };
50 
51 __END_CORTEX_NAMESPACE
52 #endif /*__NodeManager_AddOnHost_H__*/
53 
54