1 /***********************************************************************/ 2 /* Open Visualization Data Explorer */ 3 /* (C) Copyright IBM Corp. 1989,1999 */ 4 /* ALL RIGHTS RESERVED */ 5 /* This code licensed under the */ 6 /* "IBM PUBLIC LICENSE - Open Visualization Data Explorer" */ 7 /***********************************************************************/ 8 9 #include <dxconfig.h> 10 #include "../base/defines.h" 11 12 13 14 // NondrivenInteractorNode.h - // 15 // // 16 // Definition for the NondrivenInteractorNode class. // 17 // 18 // There general support for non-data-driven interactors. 19 // To support non-data-driven interactor nodes as a sub-class of 20 // InteractorNode (which IS data-driven), we redefined isDataDriven() 21 // to always return FALSE. For efficiency reasons we also redefine 22 // hasModuleMessageProtocol() expectingModuleMessage() to turn off 23 // the messaging. We also redefined handleNodeMsgInfo() and 24 // handleInteractorMsgInfo() to fail when called. 25 // Also important, we redefined getShadowingInput() so that these 26 // nodes do not have any shadowing inputs, which is generally ok since 27 // the non-data-driven nodes don't have inputs anyway. 28 // 29 // // 30 31 32 #ifndef _NondrivenInteractorNode_h 33 #define _NondrivenInteractorNode_h 34 35 36 #include "InteractorNode.h" 37 38 39 // 40 // Class name definition: 41 // 42 #define ClassNondrivenInteractorNode "NondrivenInteractorNode" 43 44 45 // 46 // NondrivenInteractorNode class definition: 47 // 48 class NondrivenInteractorNode : public InteractorNode 49 { 50 private: 51 // 52 // Private member data: 53 // 54 55 protected: 56 // 57 // Protected member data: 58 // 59 60 // 61 // Return TRUE/FALSE, indicating whether or not we support a message 62 // protocol between the executive module that runs for this node and the UI. 63 // All data-driven interactors have messaging protocol. 64 // hasModuleMessageProtocol()65 virtual boolean hasModuleMessageProtocol() { return FALSE; } 66 67 // 68 // Return FALSE since non-data-driven interactors never get messages. 69 // expectingModuleMessage()70 virtual boolean expectingModuleMessage() { return FALSE; } 71 72 // 73 // Define the mapping of inputs that shadow outputs. 74 // non-data-driven interactors do not have inputs. 75 // 76 virtual int getShadowingInput(int output_index); 77 78 // 79 // Defined, but expected NOT to be called. 80 // 81 int handleNodeMsgInfo(const char *line); 82 int handleInteractorMsgInfo(const char *line); 83 84 85 public: 86 // 87 // Constructor: 88 // 89 NondrivenInteractorNode(NodeDefinition *nd, Network *net, int instnc); 90 91 // 92 // DrivenNode wants to change an input param when instance numbers change. 93 // This is a strange case: we have no input params even though we're driven. 94 // assignNewInstanceNumber()95 int assignNewInstanceNumber() 96 { return this->ModuleMessagingNode::assignNewInstanceNumber(); } 97 98 // 99 // Destructor: 100 // ~NondrivenInteractorNode()101 ~NondrivenInteractorNode(){} 102 103 104 // 105 // Always return FALSE; 106 // 107 virtual boolean isDataDriven(); 108 109 // 110 // Determine if this node is a node of the given class 111 // 112 virtual boolean isA(Symbol classname); 113 114 // 115 // Returns a pointer to the class name. 116 // getClassName()117 const char* getClassName() 118 { 119 return ClassNondrivenInteractorNode; 120 } 121 }; 122 123 #endif // _NondrivenInteractorNode_h 124