10 #ifndef EVENTDISPATCHER_H
11 #define EVENTDISPATCHER_H
13 #include <vrecko/Export>
80 VRECKO_EXPORT
BaseClass* getReceiverPtrCore();
118 StringWithHash(
const std::string &str) { originalString = str; hashValue = calculateHash(originalString.c_str()); }
121 std::string originalString;
127 unsigned int hash = 1315423911;
131 hash ^= ((hash << 5) + str[i] + (hash >> 2));
156 typedef std::multimap<StringWithHash, ICS *, StringWithHashComparator>
EI_Type;
159 typedef std::map<StringWithHash, REQUEST_Struct, StringWithHashComparator>
REQUEST_Map;
162 void setMainThreadId(DWORD dwID) { hMainThreadId = dwID; }
174 bool insertEventInterconnection(
const std::string &sender,
const std::string &receiver, InterconnectionType
type = FORWARD_OUTPUT,
const std::string &sceneFile = *((std::string*)NULL));
178 bool deleteEventInterconnection(
const std::string &sender,
const std::string &receiver, InterconnectionType
type = FORWARD_OUTPUT);
183 void dirtyInterconnectionsForObject(
BaseClass *
object,
bool bProcessEvents =
true,
bool bProcessRequests =
true);
191 return reportEventCore(NULL, senderAndOutputString, pMessage, eType);
198 return reportEventCore(receiver_ptr, input_name, pMessage, eType);
202 osg::ref_ptr<VreckoMessage> request(
const std::string &req_sender,
VreckoMessage *pMessage);
205 osg::ref_ptr<VreckoMessage> request(
BaseClass *receiver_ptr,
const std::string &request_name,
VreckoMessage *pMessage);
224 bool addOuterObject(
const std::string &object_id,
BaseClass *pOObject);
227 bool removeOuterObject(
const std::string &object_id);
230 bool removeOuterObject(
BaseClass *pOObject);
272 void setNetSupport(
bool status);
290 bool parseSR(
const std::string &sr,
bool isSender,
BaseClass **pEntity, SRType *pSRType, std::string *pIOName, osg::ref_ptr<VreckoMessage> *pRefMessage,
bool isRequest =
false,
bool noErrorOuptut =
false);
304 std::vector<EventStruct*> incoming_events[2];
347 bool isInMainThread();
357 void processBatchOfEvents(std::vector<EventStruct*> *ref_incoming_events,
bool bTurnOffForegroundQueing);
372 void debugPrintInterconnectionMap(
EI_Type *map);
383 bool checkInterconnection(
const std::string &sender,
const std::string &receiver,
bool bRequest);