xref: /haiku/src/apps/cortex/NodeManager/node_manager_impl.h (revision ba499cdc3336fb89429027418871bf263f1f5e14)
1 // node_manager_impl.h
2 // * PURPOSE
3 //   Helper classes & functions used by NodeManager,
4 //   NodeGroup, and NodeRef.
5 // * HISTORY
6 //   e.moon		10jul99		Begun
7 
8 #ifndef __node_manager_impl_H__
9 #define __node_manager_impl_H__
10 
11 #include "Connection.h"
12 
13 #include "ILockable.h"
14 
15 #include "cortex_defs.h"
16 __BEGIN_CORTEX_NAMESPACE
17 
18 inline void assert_locked(const ILockable* target) {
19 	ASSERT(target);
20 	ASSERT(target->isLocked());
21 }
22 //
23 //// functor: disconnect Connection
24 //
25 //class disconnectFn { public:
26 //	NodeManager* manager;
27 //	disconnectFn(NodeManager* _manager) : manager(_manager) {}
28 //	void operator()(Connection* c) {
29 //		ASSERT(c);
30 //		ASSERT(c->isValid());
31 //
32 //		status_t err = manager->disconnect(c);
33 //
34 //#if DEBUG
35 //		if(err < B_OK)
36 //			PRINT((
37 //				"* disconnect():\n"
38 //				"  output %s:%s\n"
39 //				"  input  %s:%s\n"
40 //				"  error '%s'\n\n",
41 //				c->sourceNode()->name(), c->outputName(),
42 //				c->destinationNode()->name(), c->inputName(),
43 //				strerror(err)));
44 //#endif
45 //	}
46 //};
47 //
48 //// functor: release NodeRef or NodeGroup (by pointer)
49 //// +++++ currently no error checking; however, the only error
50 ////       release() is allowed to return is that the object has
51 ////       already been released.
52 //
53 //template <class T>
54 //class releaseFn { public:
55 //	void operator()(T* object) {
56 //		ASSERT(object);
57 //		object->release();
58 //	}
59 //};
60 
61 __END_CORTEX_NAMESPACE
62 #endif /*__node_manager_impl_H__*/
63 
64