Changeset 6073 for code/trunk/src/libraries
- Timestamp:
- Nov 15, 2009, 11:44:58 PM (15 years ago)
- Location:
- code/trunk/src/libraries
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/DynLib.cc
r5750 r6073 70 70 COUT(2) << "Loading module " << mName << std::endl; 71 71 72 72 std::string name = mName; 73 73 #ifdef ORXONOX_PLATFORM_LINUX 74 74 // dlopen() does not add .so to the filename, like windows does for .dll … … 93 93 94 94 if( DYNLIB_UNLOAD( m_hInst ) ) 95 95 { 96 96 ThrowException( 97 97 General, 98 98 "Could not unload dynamic library " + mName + 99 99 ". System Error: " + dynlibError()); 100 100 } 101 101 102 102 } -
code/trunk/src/libraries/core/DynLib.h
r5738 r6073 72 72 Resource 73 73 */ 74 74 class _CoreExport DynLib 75 75 { 76 77 76 protected: 77 std::string mName; 78 78 /// Gets the last loading error 79 79 std::string dynlibError(void); … … 95 95 */ 96 96 void unload(); 97 98 97 /// Get the name of the library 98 const std::string& getName(void) const { return mName; } 99 99 100 100 /** -
code/trunk/src/libraries/core/DynLibManager.cc
r5738 r6073 41 41 42 42 //----------------------------------------------------------------------- 43 44 45 46 43 DynLibManager::DynLibManager() 44 { 45 } 46 //----------------------------------------------------------------------- 47 47 DynLib* DynLibManager::load( const std::string& filename) 48 48 { 49 50 51 52 53 54 55 56 57 58 59 60 49 DynLibList::iterator i = mLibList.find(filename); 50 if (i != mLibList.end()) 51 { 52 return i->second; 53 } 54 else 55 { 56 DynLib* pLib = new DynLib(filename); 57 pLib->load(); 58 mLibList[filename] = pLib; 59 return pLib; 60 } 61 61 } 62 63 64 65 66 67 68 69 70 71 72 73 62 //----------------------------------------------------------------------- 63 void DynLibManager::unload(DynLib* lib) 64 { 65 DynLibList::iterator i = mLibList.find(lib->getName()); 66 if (i != mLibList.end()) 67 { 68 mLibList.erase(i); 69 } 70 lib->unload(); 71 delete lib; 72 } 73 //----------------------------------------------------------------------- 74 74 DynLibManager::~DynLibManager() 75 75 { -
code/trunk/src/libraries/network/FunctionCallManager.cc
r5781 r6073 43 43 FunctionCallManager::clientMap_[clientID]->setClientID(clientID); 44 44 } 45 FunctionCallManager:: 45 FunctionCallManager::clientMap_[clientID]->addCallStatic(functionID); 46 46 } 47 47 void FunctionCallManager::addCallStatic(uint32_t functionID, uint32_t clientID, const MultiType& mt1) -
code/trunk/src/libraries/network/FunctionCallManager.h
r5781 r6073 37 37 namespace orxonox { 38 38 /** 39 39 @author 40 40 */ 41 41 -
code/trunk/src/libraries/network/GamestateHandler.h
r5781 r6073 35 35 36 36 /** 37 37 @author Oliver Scheuss 38 38 */ 39 39 class _NetworkExport GamestateHandler{ -
code/trunk/src/libraries/network/Host.h
r5961 r6073 45 45 * - defines static functions available on both server and client 46 46 * - is the interface to be used when communicating with the network 47 * 47 * @author Oliver Scheuss 48 48 */ 49 49 class _NetworkExport Host{ -
code/trunk/src/libraries/network/TrafficControl.cc
r5781 r6073 64 64 *Initializing protected members 65 65 */ 66 67 68 69 70 71 72 66 TrafficControl *TrafficControl::instance_=0; 67 68 /** 69 * @brief Constructor: assures that only one reference will be created and sets the pointer 70 */ 71 TrafficControl::TrafficControl() 72 { 73 73 RegisterObject(TrafficControl); 74 75 74 assert(instance_==0); 75 instance_=this; 76 76 this->setConfigValues(); 77 78 79 80 81 82 83 84 85 77 } 78 79 /** 80 * @brief Destructor: resets the instance pointer to 0 81 */ 82 TrafficControl::~TrafficControl() 83 { 84 instance_=0; 85 } 86 86 87 87 /** … … 121 121 122 122 123 124 125 126 127 128 129 123 void TrafficControl::processObjectList(unsigned int clientID, unsigned int gamestateID, std::list<obj>& list) 124 { 125 currentClientID=clientID; 126 currentGamestateID=gamestateID; 127 evaluateList(clientID, list); 128 return; 129 } 130 130 131 131 TrafficControl *TrafficControl::getInstance() … … 135 135 } 136 136 137 138 137 void TrafficControl::ack(unsigned int clientID, unsigned int gamestateID) 138 { 139 139 if ( !this->bActive_ ) 140 140 return; 141 141 std::list<obj>::iterator itvec; // iterator to iterate through the acked objects 142 142 143 143 //assertions to make sure the maps already exist … … 151 151 152 152 for(itvec = objectListTemp[gamestateID].begin(); itvec != objectListTemp[gamestateID].end(); itvec++) 153 153 { 154 154 if(objectListPerm.find((*itvec).objID) != objectListPerm.end()) // check whether the obj already exists in our lists 155 155 { … … 165 165 objectListPerm[(*itvec).objID].objSize = (*itvec).objSize; 166 166 } 167 168 167 } 168 // remove temporary list (with acked objects) from the map 169 169 objectListTemp.erase( objectListTemp.find(gamestateID) ); 170 170 } 171 171 172 172 /** … … 174 174 */ 175 175 176 177 178 179 180 181 182 176 /** 177 *updateClientListPerm 178 *returns void 179 */ 180 void TrafficControl::insertinClientListPerm(unsigned int clientID, obj objinf) 181 { 182 std::map<unsigned int,std::map<unsigned int, objInfo> >::iterator itperm;//iterator clientListPerm over clientIDs 183 183 unsigned int gsid=GAMESTATEID_INITIAL, gsdiff=currentGamestateID, prioperm=Synchronisable::getSynchronisable(objinf.objID)->getPriority(), priomom=0; 184 184 clientListPerm_[clientID][objinf.objID] = objInfo(objinf.objID, objinf.objCreatorID,gsid,gsdiff, objinf.objSize,prioperm,priomom); 185 185 } 186 186 187 187 /** … … 223 223 224 224 225 226 227 228 229 225 /** 226 *evaluateList evaluates whether new obj are there, whether there are things to be updatet and manipulates all this. 227 */ 228 void TrafficControl::evaluateList(unsigned int clientID, std::list<obj>& list) 229 { 230 230 231 231 if( bActive_ ) -
code/trunk/src/libraries/network/TrafficControl.h
r5781 r6073 130 130 static void processAck(unsigned int clientID, unsigned int gamestateID) 131 131 { return instance_->ack(clientID, gamestateID); } 132 void deleteObject(unsigned int objectID); 132 void deleteObject(unsigned int objectID); // this function gets called when an object has been deleted (in order to clean up lists and maps) 133 133 134 134 bool prioritySort(uint32_t clientID, obj i, obj j); -
code/trunk/src/libraries/network/packet/Acknowledgement.h
r5781 r6073 37 37 namespace packet { 38 38 /** 39 39 @author 40 40 */ 41 41 class _NetworkExport Acknowledgement : public Packet -
code/trunk/src/libraries/network/packet/Chat.h
r5781 r6073 36 36 namespace packet { 37 37 /** 38 38 @author 39 39 */ 40 40 class _NetworkExport Chat : public Packet -
code/trunk/src/libraries/network/packet/ClassID.h
r5781 r6073 38 38 39 39 /** 40 40 @author 41 41 */ 42 42 class _NetworkExport ClassID : public Packet -
code/trunk/src/libraries/network/packet/DeleteObjects.h
r5781 r6073 35 35 namespace packet { 36 36 /** 37 37 @author 38 38 */ 39 39 class _NetworkExport DeleteObjects : public Packet -
code/trunk/src/libraries/network/packet/FunctionCalls.h
r5781 r6073 40 40 namespace packet { 41 41 /** 42 42 @author 43 43 */ 44 44 -
code/trunk/src/libraries/network/packet/FunctionIDs.h
r5781 r6073 38 38 39 39 /** 40 40 @author 41 41 */ 42 42 class _NetworkExport FunctionIDs : public Packet -
code/trunk/src/libraries/network/packet/Gamestate.h
r5781 r6073 96 96 97 97 /** 98 98 @author Oliver Scheuss 99 99 */ 100 100 class _NetworkExport Gamestate: public Packet{ -
code/trunk/src/libraries/network/packet/Packet.h
r5781 r6073 57 57 58 58 /** 59 59 @author Oliver Scheuss <scheusso [at] ee.ethz.ch> 60 60 */ 61 61 class _NetworkExport Packet{ -
code/trunk/src/libraries/network/packet/Welcome.h
r5781 r6073 36 36 37 37 /** 38 38 @author 39 39 */ 40 40 class _NetworkExport Welcome : public Packet -
code/trunk/src/libraries/network/synchronisable/NetworkCallback.h
r5781 r6073 49 49 public: 50 50 NetworkCallback(T* object, void (T::*function) (void)) : object_(object), function_(function) {} 51 51 virtual ~NetworkCallback() {} 52 52 virtual void call() 53 53 { (this->object_->*function_)(); }
Note: See TracChangeset
for help on using the changeset viewer.