![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: aggregator.h,v $ $Revision: 1.3 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00014 00015 #ifndef aggregator_H_ 00016 #define aggregator_H_ 00017 00018 class DtVrfMessageInterface; 00019 class DtVrfObject; 00020 class DtVrfObjectManager; 00021 class DtSubordinateObjectsList; 00022 class DtSubordinateIndividualEntry; 00023 class DtEntityIdentifier; 00024 class DtSubordinateAggregateEntry; 00025 class DtIfSubordinateListRequest; 00026 class DtSimMessage; 00027 class DtIfSubordinateList; 00028 00029 #include <map> 00030 #include <vlpi/entityIdentifier.h> 00031 00035 #include "vrfmodel/vrfmodelDefines.h" 00036 class DT_DLL_vrfmodel DtAggregator 00037 { 00038 public: 00039 00041 DtAggregator(DtVrfObject& aggregate, 00042 DtSubordinateObjectsList& subordinatesObjectList, 00043 DtVrfObjectManager& vrfObjectManager, 00044 DtVrfMessageInterface& messageInterface); 00045 00047 virtual ~DtAggregator(); 00048 00049 virtual void init(); 00050 00052 virtual void startAggregation(); 00053 00055 virtual bool aggregationIsComplete() const; 00056 00057 protected: 00058 00059 virtual void startAggregation(DtVrfObject& parentObj, 00060 DtSubordinateObjectsList& subordinateObjectsList); 00061 00062 virtual void setObjectResources(DtVrfObject& Obj, DtSubordinateIndividualEntry* subIndEntry); 00063 00064 virtual void sendSubordinateListRequestMsg(const DtEntityIdentifier& objIdent); 00065 00066 virtual void removeAndDeleteSubordinates(); 00067 00068 static void subordinateListRequestMessageCallback(DtSimMessage* msg, void* usr); 00069 00070 virtual void processSubordinateListRequestMessageCallback( 00071 DtIfSubordinateListRequest* content, 00072 const DtSimulationAddress & sender); 00073 00074 static void subordinateListMessageCallback(DtSimMessage* msg, void* usr); 00075 virtual void processSubordinateListMessageCallback(DtIfSubordinateList* content); 00076 00078 DtAggregator(const DtAggregator& orig); 00079 00081 DtAggregator& operator=( 00082 const DtAggregator& orig); 00083 00084 protected: 00085 00086 DtVrfObject& myEntity; 00087 00088 DtVrfMessageInterface& myMessageInterface; 00089 00090 DtVrfObjectManager& myObjectManager; 00091 00092 std::map<unsigned long, DtEntityIdentifier> myRequestIDs; 00093 00094 std::map<DtEntityIdentifier, DtSubordinateAggregateEntry*> myPendingSubordinateEntryResponses; 00095 00096 static unsigned long nextRequestId; 00097 00098 std::map<DtVrfObject*,DtSubordinateAggregateEntry*> myDisaggregatedSubordinates; 00099 00100 DtSubordinateObjectsList& mySubordinateObjectsList; 00101 }; 00102 00103 #endif 00104 00105