Set parent from configuration_generated objects.
[apps/agl-service-can-low-level.git] / CAN-binder / low-can-binding / can / can-signals.hpp
index 4b726c3..cc4b6da 100644 (file)
@@ -24,6 +24,7 @@
 #include <memory>
 
 #include "openxc.pb.h"
+#include "can-message-definition.hpp"
 #include "../utils/timer.hpp"
 #include "../utils/socketcan-bcm.hpp"
 #include "can-message.hpp"
@@ -38,8 +39,6 @@ extern "C"
 #define MESSAGE_SET_ID 0
 
 class can_signal_t;
-class can_message_definition_t;
-
 ///
 /// @brief The type signature for a CAN signal decoder.
 ///
@@ -76,7 +75,7 @@ typedef uint64_t (*SignalEncoder)(can_signal_t* signal,
 class can_signal_t
 {
 private:
-       std::shared_ptr<can_message_definition_t> parent_; /*!< parent_ - pointer to the parent message definition holding this signal*/
+       can_message_definition_t* parent_; /*!< parent_ - pointer to the parent message definition holding this signal*/
        utils::socketcan_bcm_t  socket_; /*!< socket_ - Specific BCM socket that filter the signal read from CAN device */
        std::string generic_name_; /*!< generic_name_ - The name of the signal to be output.*/
        static std::string prefix_; /*!< prefix_ - generic_name_ will be prefixed with it. It has to reflect the used protocol.
@@ -111,7 +110,6 @@ private:
                                                *       this value is undefined. */
 
 public:
-       //can_signal_t(const can_signal_t& b);
        can_signal_t(
                std::string generic_name,
                uint8_t bit_position,
@@ -130,10 +128,10 @@ public:
                bool received);
 
        utils::socketcan_bcm_t get_socket() const;
-       std::shared_ptr<can_message_definition_t> get_message() const;
-       const std::string& get_generic_name() const;
+       can_message_definition_t* get_message() const;
+       const std::string get_generic_name() const;
        const std::string get_name() const;
-       const std::string& get_prefix() const;
+       const std::string get_prefix() const;
        uint8_t get_bit_position() const;
        uint8_t get_bit_size() const;
        float get_factor() const;
@@ -152,11 +150,11 @@ public:
        bool get_received() const;
        float get_last_value() const;
 
-       void set_parent(std::shared_ptr<can_message_definition_t> parent);
+       void set_parent(can_message_definition_t* parent);
        void set_prefix(std::string val);
        void set_received(bool r);
        void set_last_value(float val);
+       void set_timestamp(uint64_t timestamp);
 
        int create_rx_filter();
-       void read_socket();
-};
\ No newline at end of file
+};