Alex Bikfalvi
SimStream Documentation
ModelSelect.h
00001 #pragma once 00002 00003 #include "Peer.h" 00004 #include "Address.h" 00005 00006 class CModelSelect 00007 { 00008 protected: 00009 __uint32 numChannels; 00010 __uint32 numLayers; 00011 __uint32 numPeers; 00012 00013 CPeer* peers; 00014 set<CPeer*>* index; 00015 00016 CPeer* result[MAX_LAYERS]; 00017 00018 public: 00019 CModelSelect( 00020 __uint32 numChannels, 00021 __uint32 numLayers, 00022 __uint32 numPeers 00023 ); 00024 virtual ~CModelSelect(); 00025 00026 inline void Address(__uint32 index, CAddress address) { this->peers[index].SetAddress(address); } 00027 00028 __uint32 Add(__uint32 channel, __uint32 peer, __time timestamp, __time duration); 00029 void Add(__uint32 session, __uint32 channel, __uint32 peer); 00030 void Remove(__uint32 session, __uint32 channel, __uint32 peer); 00031 00032 void Clear(); 00033 00034 virtual CPeer** Select(__time time, __uint32 channel, __uint32 child) = 0; 00035 virtual CPeer* Select(__time time, __uint32 channel, __uint32 layer, __uint32 child) = 0; 00036 CPeer** SelectOptimal(__time time, __uint32 channel, __uint32 child); 00037 CPeer* SelectOptimal(__time time, __uint32 channel, __uint32 layer, __uint32 child); 00038 00039 protected: 00040 bool IsResult(CPeer* peer, __uint32 layer); 00041 }; 00042 00043
Last updated: February 8, 2011