#include <GiaKeyList.h>
Public Member Functions | |
| void | addKeyItem (const OverlayKey &item) |
| Add key-item to keyList. | |
| void | removeKeyItem (const OverlayKey &item) |
| Removes key-item from keyList. | |
| bool | contains (const OverlayKey &item) |
| const std::vector< OverlayKey > & | getVector () |
| uint32_t | getSize () |
| const OverlayKey & | get (uint32_t i) |
Protected Member Functions | |
| int | getPosition (const OverlayKey &item) |
Protected Attributes | |
| std::vector< OverlayKey > | keyList |
| contains all search keys | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const GiaKeyList &k) |
Definition at line 31 of file GiaKeyList.h.
| void GiaKeyList::addKeyItem | ( | const OverlayKey & | item | ) |
Add key-item to keyList.
| item | to add |
Definition at line 29 of file GiaKeyList.cc.
Referenced by Gia::handleAppMessage(), and Gia::handleUDPMessage().
| bool GiaKeyList::contains | ( | const OverlayKey & | item | ) |
| item | to check |
Definition at line 42 of file GiaKeyList.cc.
Referenced by addKeyItem(), Gia::processSearchMessage(), and removeKeyItem().
00043 { 00044 if(getPosition(item) != -1) 00045 return true; 00046 return false; 00047 }
| const OverlayKey & GiaKeyList::get | ( | uint32_t | i | ) |
Definition at line 68 of file GiaKeyList.cc.
Referenced by Gia::sendKeyListToNeighbor().
00069 { 00070 return keyList[i]; 00071 }
| int GiaKeyList::getPosition | ( | const OverlayKey & | item | ) | [protected] |
| item | to get position |
Definition at line 49 of file GiaKeyList.cc.
Referenced by contains(), and removeKeyItem().
00050 { 00051 for(uint32_t i = 0; i < keyList.size(); i++) 00052 if(keyList[i] == item) 00053 return i; 00054 return -1; 00055 }
| uint32_t GiaKeyList::getSize | ( | ) |
Definition at line 62 of file GiaKeyList.cc.
Referenced by Gia::addNeighbor(), Gia::handleTimerEvent(), and Gia::sendKeyListToNeighbor().
00063 { 00064 return keyList.size(); 00065 }
| const std::vector< OverlayKey > & GiaKeyList::getVector | ( | ) |
Definition at line 57 of file GiaKeyList.cc.
Referenced by Gia::handleAppMessage().
00058 { 00059 return keyList; 00060 }
| void GiaKeyList::removeKeyItem | ( | const OverlayKey & | item | ) |
Removes key-item from keyList.
| item | to remove |
Definition at line 35 of file GiaKeyList.cc.
00036 { 00037 std::vector<OverlayKey>::iterator it = keyList.begin(); 00038 if(contains(item)) 00039 keyList.erase(it + getPosition(item)); 00040 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const GiaKeyList & | k | |||
| ) | [friend] |
Definition at line 73 of file GiaKeyList.cc.
00074 { 00075 for ( uint32_t i = 0; i<k.keyList.size(); i++ ) 00076 os << k.keyList[i]; 00077 return os; 00078 }
std::vector<OverlayKey> GiaKeyList::keyList [protected] |
contains all search keys
Definition at line 70 of file GiaKeyList.h.
Referenced by addKeyItem(), getPosition(), getSize(), getVector(), operator<<(), and removeKeyItem().
1.5.8