-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiaServiceDistributor.cpp
More file actions
46 lines (36 loc) · 959 Bytes
/
iaServiceDistributor.cpp
File metadata and controls
46 lines (36 loc) · 959 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* File: iaServiceDistributor.cpp
* Author: georgez
*
* Created on 23 October 2014, 23:15
*/
#include "iaServiceDistributor.h"
#include "session.h"
iaService* iaServiceDistributor::make(){
return (iaService*)new iaServiceDistributor();
}
iaServiceDistributor::iaServiceDistributor() {
}
iaServiceDistributor::~iaServiceDistributor() {
}
const char* iaServiceDistributor::getServiceName(){
return "iasServices:distributor";
}
const char* iaServiceDistributor::getServiceType(){
return "distributor" ;
}
void iaServiceDistributor::process(task* ptask){
// Do any cleanup with raw data first
// Then publish to all listeners
auto i= _listeners.begin();
while(i != _listeners.end()){
if(auto ptr=i->lock()){
ptr->writeToListener(ptask);
}else{
// erase any expired pointers
i=_listeners.erase(i);
continue;
}
i++;
}
}