source: pacpussensors/trunk/CanGateway/CanSubscription.h@ 1

Last change on this file since 1 was 1, checked in by DHERBOMEZ Gérald, 11 years ago

ajout des capteurs CanGateway et Alasca

File size: 1.2 KB
Line 
1
2#ifndef __CANSUBSCRIPTION_H__
3#define __CANSUBSCRIPTION_H__
4
5#include <QMultiHash>
6
7#include "CanGatewayConfig.h"
8#include "CanDecoderBase.h"
9
10#include "structure/structureCanCarmen.h"
11
12
13template <class T> class QList;
14//template <class T, class R> class QMultiHash;
15
16namespace pacpus {
17
18class CANGATEWAY_API CanSubscription
19{
20public:
21 CanSubscription() { subscribers_.clear();}
22 virtual ~CanSubscription() {}
23
24 // return true if the subscription of the component to the specified can ID list succeeds, false else
25 // warning: it is possible that some <Component*,id> pairs have been registered and other not.
26 bool subscribe(const CanDecoderBase* who, const QList<int>& canId);
27
28 // TODO
29 bool unsubscribe(const CanDecoderBase* who, const QList<int>& canId);
30
31 // TODO
32 //QList<int> getSubscription(const ComponentBase* who) {};
33
34 bool dispatchCanFrame(const TimestampedCanFrame & message);
35
36private:
37 // list of subscribers, we provide them can data
38 // structure of the hash: key is the can ID and value is the pointer to the subscribed component
39 QMultiHash<int, CanDecoderBase *> subscribers_;
40
41};
42
43}
44
45#endif
Note: See TracBrowser for help on using the repository browser.