| 50 | //============================================================================// |
| 51 | |
| 52 | bool EventClientList::insert(EventClient* ec) { |
| 53 | // forbid duplicates |
| 54 | for (iterator it = clients.begin(); it != clients.end(); ++it) { |
| 55 | EventClient* ec2 = *it; |
| 56 | if ((ec->GetName() == ec2->GetName()) && |
| 57 | (ec->GetOrder(orderType) == ec2->GetOrder(orderType))) { |
| 58 | return true; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | // insert if lessThan |
| 63 | for (iterator it = clients.begin(); it != clients.end(); ++it) { |
| 64 | EventClient* ec2 = *it; |
| 65 | if (lessThan(ec, ec2)) { |
| 66 | clients.insert(it, ec); |
| 67 | return true; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | clients.push_back(ec); |
| 72 | |
| 73 | return true; |
| 74 | } |
| 75 | |
| 76 | |
| 77 | //============================================================================// |
no test coverage detected