biblioteca que serve como midleware para as diversas placas que podem implementar esse padrão !

Dependents:   sgam_mdw_test

Committer:
AndersonIctus
Date:
Sat Jul 13 11:17:03 2019 -0300
Revision:
7:cb5a0a555a53
Parent:
5:8e160ad9adf3
- mudancas para write de conteudo !!

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AndersonIctus 0:67c0b22f99f0 1 #ifndef SGAM_MDW_CONTROL_H
AndersonIctus 0:67c0b22f99f0 2 #define SGAM_MDW_CONTROL_H
AndersonIctus 3:c87e6b48834e 3
AndersonIctus 3:c87e6b48834e 4 #include <string>
AndersonIctus 3:c87e6b48834e 5 #include <map>
AndersonIctus 3:c87e6b48834e 6
AndersonIctus 1:3a7f743de36f 7 #include "utils/const_types.h"
AndersonIctus 1:3a7f743de36f 8
AndersonIctus 1:3a7f743de36f 9 #include "peripheral/Sensor.h"
AndersonIctus 1:3a7f743de36f 10 #include "protocol/Protocol.h"
AndersonIctus 1:3a7f743de36f 11 #include "communication/Communication.h"
AndersonIctus 0:67c0b22f99f0 12
AndersonIctus 3:c87e6b48834e 13 using namespace std;
AndersonIctus 3:c87e6b48834e 14
AndersonIctus 0:67c0b22f99f0 15 class Control {
AndersonIctus 1:3a7f743de36f 16 public:
AndersonIctus 1:3a7f743de36f 17 virtual Control* getControler() = 0;
AndersonIctus 1:3a7f743de36f 18 virtual void initialize() = 0;
AndersonIctus 3:c87e6b48834e 19 virtual void finalize() = 0;
AndersonIctus 0:67c0b22f99f0 20
AndersonIctus 3:c87e6b48834e 21 // Incluir ...
AndersonIctus 3:c87e6b48834e 22 void includeSensor(Sensor<void*>* nSensor);
AndersonIctus 4:17005b72a3d8 23 void includeProtocol(Protocol* nProtocol);
AndersonIctus 5:8e160ad9adf3 24 void includeCommunication(Communication<void*>* nCommunication);
AndersonIctus 1:3a7f743de36f 25
AndersonIctus 3:c87e6b48834e 26 // metodos de GET
AndersonIctus 3:c87e6b48834e 27 Sensor<void*>* getSensor(const char* name);
AndersonIctus 3:c87e6b48834e 28 Protocol* getProtocol(const char* name);
AndersonIctus 5:8e160ad9adf3 29 Communication<void*>* getCommunication(const char* name);
AndersonIctus 3:c87e6b48834e 30
AndersonIctus 3:c87e6b48834e 31 // metodo para listar valores !!
AndersonIctus 3:c87e6b48834e 32 // list<const& char*> getAvailableSensors();
AndersonIctus 3:c87e6b48834e 33 // list<std::string> getAvailableCommunications();
AndersonIctus 3:c87e6b48834e 34 // list<std::string> getAvailableProtocols();
AndersonIctus 1:3a7f743de36f 35
AndersonIctus 1:3a7f743de36f 36 protected:
AndersonIctus 2:f8bb56af3c6e 37 Control(){}
AndersonIctus 2:f8bb56af3c6e 38 virtual ~Control(){}
AndersonIctus 3:c87e6b48834e 39
AndersonIctus 3:c87e6b48834e 40 map<std::string, Sensor<void*>*> mp_sensors;
AndersonIctus 3:c87e6b48834e 41 map<std::string, Protocol*> mp_protocols;
AndersonIctus 5:8e160ad9adf3 42 map<std::string, Communication<void*>*> mp_communications;
AndersonIctus 0:67c0b22f99f0 43 };
AndersonIctus 0:67c0b22f99f0 44 #endif